|
|
|
|
|
by brendanfh
932 days ago
|
|
I found it relatively easy. I planned a lot of things out of whiteboards and notebooks, but the actual code writing was mostly straight forward. For Onyx, I went straight from AST to WASM. The trickiest part was probably deciding how non-primitive things would be represented in WASM, like structures and tagged unions. But all of that came later after I had the basics down. I started with the simplest little compiler that could only compile binary operations on integers, and basic function calls. Then I expanded the compiler outward once I had the underlying data structures and code paths figured out. |
|