4 ms·
This is a cool project, but sadly it's not a complete Lua. It's missing two of Lua's most powerful features: A lot of the metatable functionality just won't wo
by leafo 14y ago
This is a cool project, but sadly it's not a complete Lua. It's missing two of Lua's most powerful features:
A lot of the metatable functionality just won't work: http://www.lua.org/manual/5.1/manual.html#2.8 http://www.lua.org/manual/5.1/manual.html#2.8
Second, it's missing co-routines. Which is a way to suspend the execution of a piece of code.
These features aren't possible in a compiler that simply translates from Lua to JS because JS doesn't have the ability to reproduce these concepts in its own constructs. You would have to output significantly different code to simulate these features.
Without these you're just writing JavaScript in another dialect.
- bsg75 14y agoGiven this, what could be a legimate goal of this project? There are more than a few language X -> Y translators (not compilers), and I suspect they all miss some aspects of the source or target language.
- ufo 14y agoLooks like the only metatable stuff they don't dupport is weak references and garbage collection hooks (finalizers/destructors) Other then that t looks like the support most of the other stuff since table access and things like tha through intermediate functions such as lua_tableget and so on.