Thanks @rupert, I’ll look into that!
I guess I just wanted to understand how WebAssembly works and know exactly how I’m mapping to it. Also I’m just not familiar with LLVM so didn’t really think of it or realize it was an option! Maybe I’ll create a branch to write some stuff in LLVM and compare.
To be honest I haven’t found it all that hard writing Wasm though. Wasm is definitely higher-level than “real” assembly languages for hardware. I feel like the name makes it sound scarier than it really is.
For example the text format actually has nested S-expressions, which is a complete game changer because it makes everything composable. I made a Haskell AST and DSL for it and it’s pretty decent to work with. Sure, it’s lower level than the JavaScript AST Evan uses, but the difference isn’t as huge as you would think. It’s not quite Lisp, but not quite assembly either!
But I’ll check it out for sure. Sounds like it has a lot of nice things in it. Maybe it’ll make things way easier.
Thanks for the links too!