Dart implementation of Tiny lang
Compile with dart2native main.dart -o bin/dlox
.
Implementations changes:
- Use
print
andprintln
functions instead ofprint
statements - Added native functions
str
andnum
for variable type casting - Use
let
instead ofvar
for variable declarations. - Added
break
support - Added support for native array with call to
Array()
:let array = Array();
- Added support for lambda functions with syntax
fun (arg) {}
- Added native function
exit(code)
to exit program - Added native function
error(errorMessage)
to display an error message to stderr - Added native function
throw(errorInstance)
to display an error message and exit program - Added support for ternary operator (
?:
) - Use
construct
instead ofinit
as class constructor - Use
:
instead of<
for class inheritance - Added support for static methods with keyword
static
- Added support for class getter method
- Added modular programs support through modules importing with keyword
import
- Added standard library implemented in a mix of TinyLang and Dart with error classes (Error and RuntimeError classes), support for basic Math operations (Math class), basic collections (List and Map classes), basic file I/0 (File, Stat and Directory classes), basic string manipulations (String class) and basic I/O (Stdin, Stdout and Repl classes)