Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

These days, yes, but this particular design point predates both LuaJIT and Lua popularity as a gaming scripting language specifically. I remember first seeing it sometime circa 2002 - I believe that was Lua 4.0? - and I was stricken by how much it reminded me of PHP and JS in this regard.

But yeah, my point is that one of the most common arguments against using associative arrays as the data structure is that perf overhead is unacceptably high if you use it as a list, but we've learned how to implement it in a way that can adapt to this use case at runtime just fine a loooong time ago. But regardless of perf, it just makes more sense to keep sequences and maps separate, not because of any specific technical reason, but because it's easier for humans to reason about things and model them that way.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: