What will be required to transpile OCaml to Lua?

Doesn’t necessarily help much, but a while ago I wrote a proof-of-concept ML-style language (using OCaml, of course) that transpiled to Lua - GitHub - merle-lang/luml: Luml is a type-inferred ML-style language that cross-compiles to Lua (I was mostly thinking about targeting game engines… I did enough to implement Tetris and then gave up on it).

The module that emits Lua source code was pretty simple: luml/compile.ml at master · merle-lang/luml · GitHub - I did think about trying to target bytecode but it seemed tricky due to different Lua versions, I think.

2 Likes