Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Do you have specific examples? I went over both lists, and most differences were either syntax, or "Lua has complicated feature X, JS doesn't."


Off 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


Take a look what happens if you write something simple, like "a[5]=1": http://es5.github.io/#x15.4.5.1

Or "a > b": 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




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: