diff --git a/README.md b/README.md index b73d6c8..a1bf363 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # How to Use + ``` Usage: rust_compiler_construction.exe [OPTIONS] [INPUT] @@ -11,35 +12,60 @@ Options: -V, --version Print version ``` + # Examples -These examples demonstrate how to build and run the compiler using Cargo. -Note that our language returns its expression as the exit code, which is why we use `echo $?`. + +These examples demonstrate how to build and run the compiler using Cargo. Run with input from stdin: + ```sh -echo "(+ 1 2)" | cargo run && ./output ; echo $? +echo "fn main() { print(42); }" | cargo run && ./output ``` + Run with specified input path, without specifying an output path: + ```sh -cargo run -- example.jj && ./example ; echo $? +cargo run -- example.jj && ./example ``` + Run with specified input path and specified output path: + ```sh -cargo run -- input.jj -o output && ./output ; echo $? +cargo run -- input.jj -o output && ./output ``` +# Language Features + +* Literals +* Var +* BinaryOp +* UnaryOp +* Let +* If +* Functions + * Return +* Loop + * Break + * Continue +* While +* Sequences +* Structs + # Fixes + * [ ] Updated README, with 3 new colors! * [ ] Add documentation where necessary. * [x] Improve error handling for parsing pass. * [x] Improve error handling for type checking pass. * [ ] Make errors prettier. * [ ] Improve algorithm for colouring the interference graph. -* [ ] Add read and write functionality to the bencher to update locally. +* [x] Add read and write functionality to the bencher to update locally. * [x] Lots, and lots, of refactoring! * [x] Write test input in comments. # Upcoming Language Features + * [x] Type inference. * [x] Implement comments in code. * [ ] Algebraic Data Types. @@ -48,6 +74,7 @@ cargo run -- input.jj -o output && ./output ; echo $? * [ ] First-class functions. # Upcoming Optimizations + * [ ] Dead code. * [ ] Constant folding. * [ ] Improve prologue and epilogue. @@ -55,6 +82,7 @@ cargo run -- input.jj -o output && ./output ; echo $? * [ ] And probably more... # Lofty Goals + * [ ] Make the compiler suggest hints. * [ ] Nested definitions. * [ ] Match statements.