Hacker News new | ask | show | jobs
by fab13n 5347 days 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.

1 comments

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