Hacker News new | ask | show | jobs
by glebbash 754 days ago
Hi, it's my first time posting here, just wanted to share the language I was working on for some time now.

I've been working on integrating it with WASM-4 runtime this past week. And with minimal changes to the compiler I created this demo game: https://rawcdn.githack.com/glebbash/LO/da8305293f5438967619e...

Game source here: https://github.com/glebbash/LO/blob/main/examples/test/demos...

5 comments

you might want to consider changing the title to a "Show HN" https://news.ycombinator.com/show
Very nice project! I love the fact that you have almost no dependencies for the compiler. I'm interested in learning how to build a compiler for web assembly and your code seems very clean, simple and easy to follow. Thanks!
Do you have (or plan to support) a Wasm build of the compiler so you can compile from within the browser?

Given you have includes I guess you'd need to provide a loadFile(filename) callback to provide it with data.

Yes. Compiling single files is supported by calling the exported `compile` function, example setup here: https://github.com/glebbash/LO/blob/60b80d1b325136ce1ceaf4dc....

For includes to work compiler uses WASI which can be implemented in the browser. LO playground and VSCode extension use this approach. Playground link: https://glebbash.deno.dev/lo-playground/ and source: https://github.com/glebbash/glebbash.dev/blob/main/static/lo...

Straight to wasm is a good choice. You could get something close to a native binary by packaging the result with wasm3 or similar.
Great to see some attention to WASM-4, if it plays nicely with that I'll definitely give it a go