Live data from Hacker News

Learn Lua in 15 Minutes

tylerneylon.com

31–40 of 99 posts

Re: Learn Lua in 15 Minutes

#31
post #29

First, that was very useful; bookmarked. That took me 30 minutes to read. I think I might feel like I've learned the language after spending 8 hours working the examples a la "Learn Python the Hard Way". Luckily, I'm not competing with the folks here that learned it within 15 minutes ;-).

The title is a bit optimistic :) That's how long it takes me to read as if I were reading a novel, which isn't quite fair.

I wanted to express something like "hey, this guide is for programmers and is surprisingly short and easy to consume considering it covers the large majority of the language." The current title seemed a bit snazzier.

Re: Learn Lua in 15 Minutes

#32
post #26

Nice work! One nitpick: local function declarations, like local function g(x) return g(x) end are actually the same as writing local g; g = function (x) return g(x) end . Without that first local g; statement, local functions wouldn't be able to call themselves recursively.

yep; fixed

Re: Learn Lua in 15 Minutes

#33
post #12

This is awesome. On that note, I don't understand all the javascript craze. Lua has been around for quite some time, and it's small, with well-defined semantics, a nice set of features, the interpreter is small and very fast, you can get even faster with LuaJIT, etc. Browsers should have adopted that ages ago.

Yeah, I see Lua in many ways as "JavaScript done right". I also found it considerably easier to integrate than something like V8, and it appears to be easier to use for non-programmers. It definitely deserves to be more popular.

Javascript being used by non programmers is 95% of the problems with javascript.. care to explain your problems with js and maybe expand on how lua is done right?

Re: Learn Lua in 15 Minutes

#35
Lua can be great. I've worked with it extensively on a personal project, where I've embedded it in a C++ app. However, there are some things that you will hate:

  * Trying to correctly do "inheritance"
  * Having to write all of your batteries for common ops
  * Array indices begin at 1!
  * Poor debugging support
Aside from those thing, Lua is great. It's crazy fast and easy to embed.

Re: Learn Lua in 15 Minutes

#36
post #25

Earlier quoted context omitted.

Maybe when it supports unicode

What do you want to do that you cannot do because of the lack of Unicode support?

I'd imagine internationalized gamed would be a big one, although I'm not a games programmer or a lua user myself.

Re: Learn Lua in 15 Minutes

#37
post #6

This is awesome. I will take [a single huge list of self-explanatory example snippets (with a few short comments here and there) for 95% of use cases] over [detailed walls-of-text docs pages spread across a hierarchy of topics] any day.

Thanks. My goal was to write the tutorial I wish I had when I started. Your description also matches my own preferred learning style.

Re: Learn Lua in 15 Minutes

#38

I love this. I'd like/pay to have a consistent library of exactly this for other languages.

A scripting language rosetta stone. Here's one http://www.lurklurk.org/rosetta.html

Yes, this - but with more languages and in the format of this topic. Just a really easy read.

Re: Learn Lua in 15 Minutes

#39

Earlier quoted context omitted.

What do you want to do that you cannot do because of the lack of Unicode support?

I'd imagine internationalized gamed would be a big one, although I'm not a games programmer or a lua user myself.

World of Warcraft seems to struggle on (its UI is built of Lua)

Re: Learn Lua in 15 Minutes

#40
post #7

I would like to say that the easiest way for me to learn lua really fast was to build games with Corona using lua. Having a great tool that gives great feedback right away makes learning a language more fun IMO.

Almost the same experience but with Love2D[1] instead of Corona. After learning Lua I also suggest to take a look at MoonScript[2] a dynamic scripting language that compiles into Lua, you can think about it as the CoffeeScript of Lua. [1] http://love2d.org/ [2] http://moonscript.org/

Codea (ios) is also nice. My first forays into Lua were hacking WoW UI components.
Post reply on HN