8 ms·
I can't help but feel like Lua is one of those languages that is fantastic, but gets basically ignored for most things outside of a particular niche (game scrip
by programminggeek 13y ago
I can't help but feel like Lua is one of those languages that is fantastic, but gets basically ignored for most things outside of a particular niche (game scripting). Perhaps that is why it is still such a fantastic language...
- nilved 13y agoI hope that Luvit[0] is what will bring Lua to the forefront of web development. It has such remarkable potential. It could completely (and should completely) replace node. [0] http://luvit.io http://luvit.io
- cmwelsh 13y agoIt seems like a step backward. Dealing with callbacks manually is an unnecessary hassle compared to being able to use "green threads". See python gevent and ngx_lua for examples of people doing things this way.
- someone13 13y agoCheck out Luv - an attempt to use Lua's coroutines to do green threads/fibers, integrated with libuv. https://github.com/richardhundt/luv https://github.com/richardhundt/luv
- kodablah 13y agoluv does a fantastic job of sticking with Lua coroutines. The master branch still has zeromq in it, but the latest work is done in the ray branch. Sadly, it doesn't seem the project is moving, so most of the libuv features are not yet implemented the "ray" way. Edit: Seems ray does have most of libuv features, sorry.
- anonymoushn 13y agoand node-fibers :o
- chubot 13y agoYeah I never really understood luvit. Callbacks make sense in JavaScript because it doesn't have coroutines. But Lua has coroutines! So why does luvit use callbacks? It does seem like a step backward.
- ufo 13y agoHistorical reasons. The guy who wrote luvit knew NodeJS but didnt know Lua when he started working on it.
- Jare 13y agoIt's the other way around, it gets ignored because it is consciously designed and maintained to serve a very particular niche: high performance extension language. I wouldn't consider Lua a fantastic language anywhere else.
- john_fushi 13y agoI`ve had the opportunity to use lua to program the state machine of a protocol and I must admit I was really blown away by the performance.
- nilved 13y agoIt's designed as a simple and performant language. Embedding within games, for example, is one area where those traits are very valuable. That doesn't mean Lua is only good for embedded programs or games: Lapis and Luvit are testaments to how Lua is great for building web applications. On top of that, LuaJIT means it blows conventional languages like Ruby and Python straight out of the water. Not only is it a good language for web development, it's a remarkable one.
- tzs 13y agoCould Python or Ruby be compiled to Lua? Such languages are hard to compile to static typed languages like C, but Lua is dynamic like they are, which should remove a lot of problems.
- stevelaz 13y agoSure they could, someone just needs to write the compiler for it. There may already be a project that does this anyway. IMHO, the most challenging part of this would be that Lua doesn't have as many libs as Ruby and Python. So the compiler would have to do a lot more work rather than be just a syntax converter.
- nilved 13y agoTechnically yes, but it would likely only be possible with a restricted subset of the language. Python and Ruby have a large standard library and set of built-in functions, because they're "batteries included" languages. Lua is quite the opposite: it doesn't even have access to the file system unless you implement that or use a module. So you'd either end up using a limited Python without features absent in Lua, or you'd need to bridge the gap in functionality with a very large runtime library. If you're looking for a more expressive syntax, check out MoonScript. It's an awesome language that you could consider Lua's CoffeeScript analogue.
- stevekemp 13y agoI'm using it for scripting/configuration of my mail-client. Which is pretty cool.