Skip to content

Commit

Permalink
Add compiler blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
healeycodes authored Dec 30, 2023
1 parent dcf9aad commit 6c41ec2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# nodots lang
> My blog posts:
> - [A Customer WebAssembly Compiler](https://healeycodes.com/a-custom-webassembly-compiler)
> - [Adding For Loops to an Interpreter](https://healeycodes.com/adding-for-loops-to-an-interpreter)
> - [Profiling and Optimizing an Interpreter](https://healeycodes.com/profiling-and-optimizing-an-interpreter)
Expand All @@ -13,7 +14,7 @@ A small programming language without any dots called **nodots**. There are two v

## WebAssembly Compiler (static types)

`compiler.py` is a WebAssembly compiler (w/ type checking) that outputs WebAssembly Text Format. See `grammar_static.py` for the grammar.
`compiler.py` is a WebAssembly compiler (w/ type checking) that outputs WebAssembly Text. See `grammar_static.py` for the grammar.

This version is more experimental than the interpreter but you can compile and run an example program with:

Expand All @@ -22,7 +23,7 @@ pip3 install -r requirements.txt
./compile.sh
```

The example program is a naive algorithm that calculates the n-th Fibonacci number. It requires ~67million function calls and runs 4000x quicker in the compiled version.
The example program is a naive algorithm that calculates the n-th Fibonacci number. It requires ~243k function calls and runs 4000x quicker in the compiled version.

```text
fn fib(i32 n) -> i32
Expand Down

0 comments on commit 6c41ec2

Please sign in to comment.