News for hackers. Stuff that matters.
Re:Lua VM running in a WASM environment by sillysaurus3 on Saturday March 18, 2017 @04:32AM (#13900453)
So, here's a fun example: a self-hosted Lisp.

Copy this: https://gist.github.com/anonymous/af755d7cf0f71a574f39f547d3...

And paste it into the VM: https://cdn.rawgit.com/vvanders/wasm_lua/d68f46a8/main.html

It's a modified version of Lumen (https://github.com/sctb/lumen) made to run on this VM. It defines a runtime, a reader, a compiler, then compiles the runtime from Lisp to Lua and prints out its own source code.

Lumen is also capable of compiling to JS, and I wanted to show it printing out its own source code as JavaScript instead of Lua. But unfortunately I was getting some strange WASM-related memory errors when compiling as JS, so I decided to settle for a neat demo that everybody can run.

(The demo could be a little less cryptic, and I could do a better job of explaining it, but it's late.)

Re:Lua VM running in a WASM environment by vvanders on Saturday March 18, 2017 @10:43AM (#13901451)
That's really cool(and kinda meta!).

I love how multi-paradigm Lua is, we used to do component based composition with metatables but I've seen OO inheritance and a slew of other approaches as well.