13 comments

[ 1.8 ms ] story [ 36.0 ms ] thread
Link is down. I assume it's about https://github.com/paulcuth/starlight

I'm not sure what the current progress is like. Other projects to get lua in the browser:

* moonshine.js - same author as the OP

* lua.vm.js - emscripten based (I maintain this one; I'd like to think of it's API as the "gold standard" for lua on the web. however it has issues around leaking references to the JS VM (to be solved when javascript gets WeakRef))

* brozula - abandoned

Moonshine is amaze. It really is.
I think the emscripten/WebAssembly approach will win out. One of the the main reasons why Lua is so good is because it's written in strict ANSI C. Porting it to another language doesn't make sense.
I still hope for a day where Lua is implemented into browsers themselves, though this would set off the whole "but VBScript" arguments again, but at least Lua is pretty much standardized and it can be compiled almost everywhere. Not sure how much it would or wouldn't compliment the browsers DOM and such though. If it were added just on experimental browsers just to test it out and see it's upsides and downsides that would be great too, maybe in Electron or Nw.js somehow?

I'm sure I'll get critical comments on this but it beats compiling Lua to JS to make it convert itself back to JS. Maybe WebASM will be a solution for this, but it's too soon to tell for me how reliable that is for now.

I have always wanted this!

Every now and then I get the thought that maybe I'll try to hack Lua into a browser just for fun, then I start trying to read the source and it is just 0_o to me.

Lua is cool because it's extremely simple and small. But JS is the way it is because we built the web around it. Nothing less than JS will do anymore.
> Nothing less than JS will do anymore.

I feel like this concept is about to be turned on it's head. Pretty soon, with WebAssembly (DOM access specifically), JS is going to potentially not matter at all for modern browsers.

Hell, there's even a chance that other languages end up "doing it better", being safer, or more robust, or more concurrent (when threads are added to WASM).

I have a hard time believing JS will still reign king of the hill when it has so many publicly agreed upon issues. If other languages do not have a disadvantage due to WASM (ie, slower DOM access), it seems inevitable that JS is just going to be one in many web languages, just like the rest of software.

It's more elegant and technically sound than Javascript.

But I don't think it'll ever happen. There's just too much behind Javascript and it's slowly catching up anyways.

Actually it will be possible once Web Assembly is out! I heard they have already tested the Lua interpreter on it! (I need some confirmation of this though! )

I'm reaaaaally excited for that!