3 ms·
MoonScript is extremely cool. What are your thoughts on MoonScript in the browser? I know you have an online "Try MoonScript", but what would be the best way to
by sidegrid 10y ago
MoonScript is extremely cool. What are your thoughts on MoonScript in the browser? I know you have an online "Try MoonScript", but what would be the best way to use it in a real (hobby) project with DOM manipulation capabilities?
Please don't give up on MoonScript :)
- leafo 10y agoMoonScript is designed to compile to Lua, and there are no good ways to run Lua in the browser right now. It's impossible to write a Lua -> JS transpiler while matching all the same functionality (coroutines), so the only option is to run the entire Lua vm in the browser (The MoonScript online version uses this approach with emscripten). In the future I'd like to be able to run MoonScript in the browser, maybe web assembly is the answer. Another option would be to have a JS target for the MoonScript compiler, but there are some issues with different language features that would make code sharing difficult (1 indexed arrays, metatables, etc.) I have no plans to give up moonscript. I haven't been actively developing it recently though, which I feel guilty about.