onion: Stack language compiled to lua

17 points by veqq


schuelermine

Why compile to Lua instead of a bytecode interpreter written in Lua?

yumaikas

Hi, I made this last year while I was unemployed. Happy to answer any questions!

AndyKluger

That’s pretty cool, with a neat solution for calling lua functions while succinctly specifying their stack effects.

  • Currently: Onion compiler in lua
  • TODO: Onion compiler in Onion

Intuitively I don’t like the idea of self hosted languages, even though languages (and language creators) I admire choose to do it. It seems kind of risky, like abandoning a real reliable implementation, and putting oneself in a precarious spot going forward.

I readily admit I’m a fool and the folks who do this are very smart. But if anyone wants to explain to me why it’s a good idea, please set me straight here.