4 ms·
Each table (dict, hash, whatchamacallit) has a hash portion and an array portion, and contiguous integer keys are stored internally in the array. So, tables aut
by silentbicycle 16y ago
Each table (dict, hash, whatchamacallit) has a hash portion and an array portion, and contiguous integer keys are stored internally in the array. So, tables automatically adapt their internal implementation for use as an array, a dict, or both, at runtime. They're unique to Lua, AFAIK.
It also has an interesting hash table optimization (that I don't quite grok). I've been reading through the Lua code bit by bit, but haven't made it there yet. Lots of other interesting stuff, though.
LuaJIT's not too shabby, either!
Lua's my favorite language for quick hacks, period. I wrote a library to add fairly idiomatic pattern matching (http://github.com/silentbicycle/tamale/ http://github.com/silentbicycle/tamale/). Every language needs pattern matching. :) I'm still working on explaining PM to people who aren't already into Erlang or ML, but it's documented now.
- mahmud 16y agoYou win this round, again.