Hacker News new | ask | show | jobs
by sitkack 970 days ago
Not crazy. Sounds like a good idea given your used case.

Is there a transpired from Luau to Lua? Otherwise you could never go back, you would eventually be forced to use their run time. Do they have an interpreter only mode? Can you run on web assembly?

2 comments

Good point, I don't know how hard transitioning back would be, we would need to review the language diff. Is it simple stuff like removing type annotations and reverting "i += 1" (Luau) by "i = i + 1" (Lua) ?

I don't know if they have an interpreter only mode.

Yes, our projet runs on WebAssembly. (https://app.cu.bzh)

Luau also adds a continue keyword. It's probably the most troublesome thing you might encounter if you wanted to go from Luau back to Lua.
Darklua can compile Luau to Lua 5.1: https://github.com/seaofvoices/darklua
Darklua is brilliant and works well for converting existing Lua projects to Luau for improved type safety as well as the reverse to convert existing Luau projects to Lua, allowing better compatibility. Unfortunately last I checked continue statements, if-then-else expressions, and interpolated strings weren't yet supported for conversion to Lua and still had open issues, which was a problem for a number of Luau libraries, though it's still resulted in an improvement in development experience for us.