4 ms·
For reference, here's why JavaScript to Lua converters are really hard to make feature complete. http://phrogz.net/lua/LearningLua_FromJS.html http://phrogz.ne
by simple10 12y ago
For reference, here's why JavaScript to Lua converters are really hard to make feature complete.
http://phrogz.net/lua/LearningLua_FromJS.html http://phrogz.net/lua/LearningLua_FromJS.html
http://stackoverflow.com/questions/1022560/subtle-differences-between-javascript-and-lua http://stackoverflow.com/questions/1022560/subtle-difference...
- nothrabannosir 12y agoDo you have specific examples? I went over both lists, and most differences were either syntax, or "Lua has complicated feature X, JS doesn't."
- alloyed 12y agoOff of the top of my head, with varying difficulty * js has UTF-16 strings with the same semantics(compare-by-value, immutable, interned) as lua strings. you could store UTF-16 in normal lua strings, but then you'd need some way of marshalling them for C code that expects const char* values * JS has a lot of type coercions when doing binary operations, etc. replicating that seems like a source of indirection * Lua tables have no explicit length, or any way to preallocate, so it's not entirely obvious what Array(len) or a.length = newlen would do
- wizzard0 12y agoTake a look what happens if you write something simple, like "a[5]=1": http://es5.github.io/#x15.4.5.1 http://es5.github.io/#x15.4.5.1 Or "a > b": http://es5.github.io/#x11.8.5 http://es5.github.io/#x11.8.5 This, in turn, causes all sorts of weird behavior nicely described at https://www.destroyallsoftware.com/talks/wat https://www.destroyallsoftware.com/talks/wat