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.
Lua Doesn't Suck – Strange Loop 2010 20-minute talk video
31–40 of 61 posts
Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video
#32I'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.
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
#33I'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.
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
#34I'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
#35I'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.
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
#36Earlier 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…
Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video
#37Earlier 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?
Lambda Lounge is the best software dev user group ever.
Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video
#38Great talk, Kyle. Also, the video turned out remarkably well given the camera it came from.
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 $ 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