Live data from Hacker News

Learn Lua in 15 Minutes

tylerneylon.com

81–90 of 99 posts

Re: Learn Lua in 15 Minutes

#81
post #78

This is great! I wish every language had an intro like that :) It was interesting to find resemblance of Lua's classes to Perl's blessing. Always meant to look into the language and this tutorial made me do it. I also learned about the LÖVE game engine, which I'm going to play with this week. Thank you! http://love2d.org/

If you're playing with love2d you might as well want to check out Zoetrope, I found it very awesome. http://libzoetrope.org/

Re: Learn Lua in 15 Minutes

#84
post #78

This is great! I wish every language had an intro like that :) It was interesting to find resemblance of Lua's classes to Perl's blessing. Always meant to look into the language and this tutorial made me do it. I also learned about the LÖVE game engine, which I'm going to play with this week. Thank you! http://love2d.org/

If you're playing with love2d you might as well want to check out Zoetrope, I found it very awesome. http://libzoetrope.org/

This looks interesting, can you explain the difference between Zoetrope and LÖVE?

The former seems to be built on top of the latter, yes? Are there particular things lacking in LÖVE that Zoetrope fills in? I couldn't find this info quickly on their sites.

Re: Learn Lua in 15 Minutes

#85
post #70

This is a good start, but there's also some deeper ideas in Lua. It has a good implementation of coroutines, for example; if you're familiar with continuations from Scheme, they fit most of the same uses. (They're like generators from Python or fibers from Ruby, but with less edge cases.) The C interop is also a Big Deal. Lua seems like a cute little language, like a cleaner Javascript, but it's a LOT more useful if…

Coroutines are tricky, and you need to explain them, not just present a bit of code. I think it is the right decision to omit them from a 15-minute intro. The C API is way out of scope. I would cover assert() statements and the common (exit_status, result) var return, since that is so idiomatic. Maybe also loading chunks.

I agree, they're tricky. I'm currently working on a blog post about them. :)

Re: Learn Lua in 15 Minutes

#87

A logical next step might be to do do the Lua Missions (read: koans): https://github.com/kikito/lua_missions . (Disclaimer: The missions look good, but I haven't personally tried them.)

Actually, the Lua Missions are excellent! I highly recommend taking the time to work through them. More than just a series of exercises (like most of the foo-koans), there's actually a narrative and a larger lesson you can learn if you work through the full problem set.

Hi, Lua Missions author here!

Thanks for the kind words. One word of warning though: I never got around to make one mission about coroutines.

But I accept pull requests :)

Re: Learn Lua in 15 Minutes

#89
post #67

Earlier quoted context omitted.

You have a keen eye for subtle references! I didn't expect many people to get that one :) There's another math anecdote reference hidden in there as well - probably even more obscure than Karl's sum.

Upon reading this comment had to skim the whole thing looking for more (hadn't yet finished reading). No more maths references than tau found yet. :/

Ramanujan and Hardy are two well-known mathematicians who collaborated in Britain between 1914 and 1920. One day Hardy took taxi number 1729 to visit Ramanujan, and remarked to him that he (Hardy) could think of nothing special about the number (1729). Ramanujan replied that it was in fact the first number expressible as the sum of two cubes in two different ways (1^3 + 12^3 = 9^3 + 10^3). The story has since become an anecdotal symbol of Ramanujan's brilliant mind.

http://en.wikipedia.org/wiki/1729_(number)

That's a very obscure reference, though, so I apologize for sending anyone looking based on my previous comment.

Post reply on HN