Grammar
TOX
Tox is a statically typed version of lox that is written in rust.
Usage
USAGE:
tox [FLAGS] [source]
FLAGS:
-h, --help Prints help information
-i, --interpter Run in interpreter mode
-V, --version Prints version information
ARGS:
<source> The source code file
Example Program
fn fib(n:int) -> int {
if (n < 2)
return n;
return fib(n - 2) + fib(n - 1);
}A simple example that makes of uses of the classes
class Toggle {
state:bool;
fn value() -> bool {
return this.state;
}
fn activate() -> Toggle {
this.state = !this.state;
return this;
}
}
fn main() {
var toggle = Toggle{state:true};
print toggle.activate().value();
print toggle.activate().value();
}TODO
[] Implement nested for while loops
[x] Improve documentation
[x] Fix variable scope
[x] Readd inherited methods
[ ] Finish the work on generic function calls
[ ] Readd typechecking of closures
Resources
- rust
- plank
- lox
- menhir-lang
- minicom
- tiger-rs
- Kaleidoscope
- kaleidoscope-rs
- inko
- NovaLang
- gluon
- dora
- Modern Compiler Implementation in ML, java and C
- Developing Statically Typed Programming Language
- /r/ProgrammingLanguages
- awesome-compilers