5 ms·
> I, for one, hope that WebAssembly will enable, say, Lua as a first class citizen on the web. I can think of several languages I'd like to use on the web, but
by hajile 10y ago
> I, for one, hope that WebAssembly will enable, say, Lua as a first class citizen on the web.
I can think of several languages I'd like to use on the web, but never really considered Lua.
I'm curious. Why Lua?
- rch 10y agoApart from general fitness for embedding and extending, I like the versatility of Lua tables: https://www.lua.org/pil/3.6.html https://www.lua.org/pil/3.6.html In particular, to initialize a table to be used as a record: a = {x=0, y=0} which is equivalent to: a = {}; a.x=0; a.y=0 and: a.x = nil -- removes field "x" But I think Guido's right about 0-based indexing: http://python-history.blogspot.com/2013/10/why-python-uses-0-based-indexing.html http://python-history.blogspot.com/2013/10/why-python-uses-0...
- strainer 10y agolocal a = {x=0,y=0} --lua table definition is very similar to var a ={x:0,y:0} //javascript object definition Lua is great but that 1-based indexing is very unfortunate - works fine in itself but clashes badly with the norm.
- Derbasti 10y agoMost popular dynamic programming languages are well-loved because they have huge standard libraries, which can largely not be ported to a browser sandbox. This is why I don't see how, say, Python or Ruby would be good sources of WebAssembly. Lua, on the other hand, is a tiny language. It is remarkably well-designed, with a very simple type system, a very simple syntax, but nevertheless, Lua is extremely flexible. I have spent a few years with Lue, and I have come to admire it, for it feels as flexible as Ruby, but at the same time more consistent than Python, and faster and simpler than either of those. And, needless to say, none of the inconsistencies of JavaScript. Lua's stated goal is embeddability. The whole language including the parser and the standard library fit in a few hundred Kb. The bytecode only has a handful of very simple instructions. The source code is exceedingly well-structured and easy to understand. I think Lua could be a very simple drop-in replacement for JavaScript, doing exactly the same thing that JS does today, but using a much nicer programming language. And it already comes with an object system, modules, and a string manipulation library. I like Lua.