9 ms·
Win a signed copy of Programming in Lua 3rd Edition
- speeder 14y agoI tend to get invited to talk about Lua ( including why I am using it ) at universities and conferences ( like, CONISLI, FLISOL, LATINOWARE ) does that counts?
- aDevilInMe 14y agoSure, although if there is an output which can be enjoyed by other people such as a paper, video/audio of the talk etc. then more people I would imagine would vote for it.
- speeder 14y agoGood idea! I will see if any of the archives has a copy... But they are in portuguese :p
- nightski 14y agoYou know what might really get people talking about Lua? Making the primary resource for learning it available for free following the lead of countless other languages.
- tedunangst 14y agoYou mean like this? http://www.lua.org/manual/5.2/ http://www.lua.org/manual/5.2/
- dottrap 14y agoAnd this one too: http://www.lua.org/pil/ http://www.lua.org/pil/ (prior Lua versions are free online)
- daenz 14y agoI use Lua for the scripting front end of my interactive dance software https://www.facebook.com/FormConstantDance https://www.facebook.com/FormConstantDance I considered using Python, since I'm very familiar with the language, but in the end, the ease of embedding Lua in c/c++ sold it for me.
- chubot 14y agoThis is one of the best plain programming books out there. Even if you don't have a particular interest in Lua, you'll learn something. I've heard it compared it to "The Unix Programming Environment" in terms of being a classic, and I agree. I find myself coming back to this book again and again, even though I haven't been able to justify Lua on any projects really. Just now the treatment of coroutines really helped with using Python coroutines (not generators).
- ufo 14y agoWhat coroutines are you talking about? I was under the impression that Python coroutines were when you use the `yield from` and `.send` features nest generators and to communicate values between them...
- chubot 14y agoYeah exactly... it escaped me for an embarassingly long time that this is exactly the same scheme used in Lua. In Python you can create a coroutine, then use yield and send(). In Lua you have coroutine.create/yield/resume. They work in exactly the same way. It was my understanding that implementing "trampolining" as explained by http://dabeaz.com/coroutines/ http://dabeaz.com/coroutines/ in Python 2.5 is basically what "yield from" does in Python 3.3. Maybe "yield from" is more efficient. If anyone has any comments on that I'd be interested. The PIL book has a few interesting examples of things that you can do with coroutines that are not possible with generators (plain yield). Also there is a paper by the Lua authors called "revisiting coroutines" -- although that was published in 2009, they don't acknowledge that Python has coroutines! They talk about Python's "limited" generators. EDIT: Sorry, "yield from" is for generators. So coroutines are yield/send(). Generators are yield/yield from. "yield from" is indeed the equivalent of coroutine trampolines, but for generators. The right way to think about it is that coroutines are a push-based model while generators are a pull-based model. They don't mix, despite using the same keyword! If you want to mix them you would have to introduce a buffer between them or something. This is somewhat explained in Beazley's material. And coroutines are more powerful than generators, as explained by the "revisiting coroutines" paper (and which should be obvious if you try to transcribe some coroutine patterns into generators.) Even after adding "yield from", which removed one restriction of generators, coroutines are still more powerful.
- tomjen3 14y agoIs there a good reason to use Lua? Javascript is pretty much the same and Guile is not only lisp, it is also designed to be used as a scripted language.
- tarabukka 14y agoLua's runtime is small and easy to embed compared to something like V8. It's also written in ANSI C. I don't know about Guile.
- justincormack 14y agoMuch easier to embed in something else or to embed something else in it. JavaScript is possible in principle but much harder. More friendly to use than a Lisp for most people.
- ConstantineXVI 14y agoBesides the easier embedability (it's plain C with no dependencies and MIT licensed), it's (subjectively) a nicer language than JS and more accessible to the general public than Scheme/Guile, while being just as powerful as both. And for some reason I can't pin down, it's just fun to hack with.