Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanBrouwer committed Nov 27, 2023
1 parent 84789e5 commit 206cc25
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# How to Use

```
Usage: rust_compiler_construction.exe [OPTIONS] [INPUT]
Expand All @@ -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.
Expand All @@ -48,13 +74,15 @@ cargo run -- input.jj -o output && ./output ; echo $?
* [ ] First-class functions.

# Upcoming Optimizations

* [ ] Dead code.
* [ ] Constant folding.
* [ ] Improve prologue and epilogue.
* [ ] Tail calls.
* [ ] And probably more...

# Lofty Goals

* [ ] Make the compiler suggest hints.
* [ ] Nested definitions.
* [ ] Match statements.
Expand Down

0 comments on commit 206cc25

Please sign in to comment.