3 ms·
In which cases would anyone need: - to write code in JS rather than in Lua; - and run the result on a platform which supports Lua but not JS? Except in a Dil
by fab13n 15y ago
In which cases would anyone need:
- to write code in JS rather than in Lua;
- and run the result on a platform which supports Lua but not JS?
Except in a Dilbert-like situation, where a clueless middle manager decides that using a dirty hack is safer than letting JS programmers take the 2 days it would take them to become very proficient in Lua, I can't think of one.
- deleted 15y ago[deleted]
- zhemao 15y agoMany C applications use Lua as an embedded scripting language. This program would be very useful if the developers of the application wanted to extend scripting support to Javascript (and compile-to-JS languages) without having to modify their C code.
- finnw 15y agoBut if they are developers why would they not want to modify their own C code (to add an embeddable JS interpreter?)
- aaronblohowiak 15y agojs interpreters are not as friendly as lua for embedding.
- zhemao 15y agoExactly, I've worked with the Lua C API before, it was fairly easy to use. I've looked at the V8 API before. Compared to Lua, it is far more complicated.
- fab13n 15y agoBut a transcompiler will always be a kludge, at least when the target language hasn't been designed as a bytecode. Most importantly, I'd bet that the intersection of developers who: (1) can write good software; and (2) Can write decent JS code, but can't become proficient in Lua within a couple of days; is mostly empty.