Hacker News new | ask | show | jobs
by zhemao 5349 days ago
Many 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.
2 comments

But 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.

But if they are developers why would they not want to modify their own C code (to add an embeddable JS interpreter?)
js interpreters are not as friendly as lua for embedding.
Exactly, 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.