Earlier quoted context omitted.
Isn't it LuaJIT that's really fast? Last I remember reading about it, there was some version fragmentation going on with Lua advancing and LuaJIT stuck on an older version? (That was a long time ago, and I don't know what been happening since.)
And LuaJIT has historically been extremely fast (initially much faster than JavaScript's early JITs) because it didn't have nearly as many optimizer-busting design flaws to work around as JavaScript JITs did, because Lua's language design is so much simpler and cleaner than JavaScript's, which wasn't originally designed to be compiled ( cough cough "with" cough "this"). But because JavaScript was the "Chosen Language…
Fengari – Lua for the Browser
91–100 of 145 posts
Re: Fengari – Lua for the Browser
#92Re: Fengari – Lua for the Browser
#93Earlier quoted context omitted.
iirc, one other confusing element is that tables (hash tables? I don't remember what they're called) return null when a lookup is done for a nonexistent key. This is not necessarily a bad choice. Exceptions and such can be a real pain. However, accidentally getting a null value because you didn't check and then have it propagate much further in your program is extremely difficult to debug. Instead of blowing up at th…
Storing a null value is a legitimate operation. How do you distinguish "never stored a value under key K", and "stored null under key K"?
> t = {}
> t['a'] = nil
> t['a']
nil
> t['b']
nilRe: Fengari – Lua for the Browser
#94Re: Fengari – Lua for the Browser
#95I was pleasantly surprised it loaded so fast. So I wanted to check the size of it. I opened the firefox debugger, and it went blank O_o Chrome was ok with it: it's about 220kb, which is not bad at all for a whole runtime + stdlib. Python pyiodide ( https://pyodide.org/en/stable/ ) is several Mb. 220kb is still too much to pay upfront, since I usually want my webpages to be under 1Mb, and I can't justify burning 1/4 o…
Re: Fengari – Lua for the Browser
#96Lua did a language fork at version 5.3. I think this supports the 5.3 fork but it would be good to make this explicit.
I'm not entirely sure what you mean by "language fork", but all versions of Lua have incompatibilities. 5.1, 5.2, 5.3, and 5.4 are all major versions, with features that aren't completely compatible with any of the others. For example, 5.2 brought in major changes for how environments were handled, and 5.3 brought in integers, and 5.4 brought in changes to how number overflow is handled.
Re: Fengari – Lua for the Browser
#97Re: Fengari – Lua for the Browser
#98Earlier quoted context omitted.
> basically no confusing elements. the one confusing element - one-based indexing of arrays! that is something i found hard to adjust, as it makes off-by-one errors more prominent... but otherwise it's a nice language.
Same here. It's not a big deal once you get used to it but after years of always having indexes start at 0 it just seems... off.
Re: Fengari – Lua for the Browser
#99Re: Fengari – Lua for the Browser
#100I knew "selene" meant "moon" in Greek! Maybe I missed some updates...