Live data from Hacker News

Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

kylecordes.com

31–40 of 61 posts

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#31
I've sat down to learn Lua a number of times because on the I really like the idea of it (small, fast, safe, etc). It really has quite a beautiful minimalism to it.

But each time I try I get to the part where I learn that array indices start at 1 and I get annoyed. Have we not learned anything since BASIC? Sigh.

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#32

I've sat down to learn Lua a number of times because on the I really like the idea of it (small, fast, safe, etc). It really has quite a beautiful minimalism to it. But each time I try I get to the part where I learn that array indices start at 1 and I get annoyed. Have we not learned anything since BASIC? Sigh.

What do you object to in counting from 1? (Other than it's not traditional.)

In C, it's an offset into a typed block of memory, so 0 indexing makes sense. But lua does not deal directly with memory.

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#33

I've sat down to learn Lua a number of times because on the I really like the idea of it (small, fast, safe, etc). It really has quite a beautiful minimalism to it. But each time I try I get to the part where I learn that array indices start at 1 and I get annoyed. Have we not learned anything since BASIC? Sigh.

I found that adopting the native idioms meant never having to notice the 1- based indexing. Everything is a hash table, and if you find yourself using literal numeric keys, there's probably a nicer way to do it.

The lua users wiki is full of interesting ideas for tackling the basics in ways that leverage lua's simple flexibility.

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#34

I've sat down to learn Lua a number of times because on the I really like the idea of it (small, fast, safe, etc). It really has quite a beautiful minimalism to it. But each time I try I get to the part where I learn that array indices start at 1 and I get annoyed. Have we not learned anything since BASIC? Sigh.

What do you object to in counting from 1? (Other than it's not traditional.) In C, it's an offset into a typed block of memory, so 0 indexing makes sense. But lua does not deal directly with memory.

It has nothing to do with indexing memory--it has to do with 1 based arrays causing "+1" and "-1" to be sprinkled all oever the place. I find Dykstra's argument to be compelling: http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EW...

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#35
post #33

I've sat down to learn Lua a number of times because on the I really like the idea of it (small, fast, safe, etc). It really has quite a beautiful minimalism to it. But each time I try I get to the part where I learn that array indices start at 1 and I get annoyed. Have we not learned anything since BASIC? Sigh.

I found that adopting the native idioms meant never having to notice the 1- based indexing. Everything is a hash table, and if you find yourself using literal numeric keys, there's probably a nicer way to do it. The lua users wiki is full of interesting ideas for tackling the basics in ways that leverage lua's simple flexibility.

That is entirely possible. I can tell if someone doesn't know perl or python because they write for loops like a C coder instead of looping over containers. So I can believe that you don't come in contact with that detail very often.

It just bugs me that such an obvious wart exists in an otherwise very clean language.

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#36
post #7

Earlier quoted context omitted.

> Am I just missing some information in this regard? A major, and non-negotiable, design goal of Lua is that it targets the ANSI C environment to maximise portability. ANSI C does not define Unicode support. Incidentally, those two libraries might be unchanged because they're stable. The rate of change in the main lua implementation is quite measured.

The Lua philosophy is far different from the philosophy of other languages. That's why videos like these, that cover the advantages before the tradeoffs, are a good thing. Knowing the positive things about something really effects my perceptions of the tradeoffs. Also, Unicode is an odd thing to consider to be an essential part of a programming language. Usually when I hear it I think the person must think it's a par…

but ruby supported different encodings from the start, such as shift_jis, utf8 and euc_jp, it's just that the support was not "good enough". The reason why it took so long to have an improved one is also to be searched in the will of core ruby devs to support something better than only unicode.

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#37

Earlier quoted context omitted.

(I'm the guy in the video.) I haven't had a need for Unicode in Lua, but when I stumbled across some information about it, the essential story was that there is nothing stopping you from writing code to manipulate Unicode data (obviously), but there is also nothing built in to help you. All the built in string stuff is ANSI/ASCII/whatever. However, the language Io (which often gets mentioned in the same breath as Lua…

Are you affiliated with Lambda Lounge in STL?

Yes! I know the guy who started Lambda Lounge (Alex Miller http://tech.puredanger.com/about ) and heartily supported its founding; I spoke at it every once in a while; and my firm (Oasis Digital http://oasisdigital.com/ ) sponsors Lambda Lounge by paying for travel expenses for out-of-town speakers.

Lambda Lounge is the best software dev user group ever.

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#38

Great talk, Kyle. Also, the video turned out remarkably well given the camera it came from.

Thanks. Here is the exact camera I used:

http://www.usa.canon.com/cusa/support/consumer/digital_camer...

For the sake of any readers here who don't read the blog post: I do NOT recommend this camera for video. I happened to have it sitting around for family snapshots and chose to experiment with it here.

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#39
Very unscientific but hopefully interesting:

    $ time php -r 'echo "Hello, world!";' # smaller php binaries can be compiled
    real 0m0.555s
    $ time perl -e 'print "Hello, world!";'
    real 0m0.385s
    $ time ruby -e 'puts "Hello, world!"' # mri
    real 0m0.073s
    $ time python -c 'print("Hello, world!")'
    real 0m0.067s
    $ time lua -e 'print "Hello, world!"'
    real 0m0.013s
    $ time js -e 'print("Hello, world!")' # spidermonkey
    real 0m0.010s
    $ time awk 'BEGIN { print("Hello, world!") }'
    real 0m0.004s

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#40
For a time I was seriously considering using Lua for building web applications but after playing with it for a four days I decided the community just wasn't ready and I wasn't prepared to put in the work myself. A lot of the libraries were incomplete/being changed (lots of bitrot) and very few unit tests. As a language though Lua is pretty cool, a cleaner, smaller, faster, JavaScript.
Post reply on HN