News for hackers. Stuff that matters.
Re:Lua: the world's most infuriating language? by RyanZAG on Friday October 18, 2013 @09:05AM (#6571118)
Lua is a far smaller language than Python. Python's complexity makes it extremely difficult to optimize because feature A conflicts with feature B, while Lua you can make much more specific optimization code.

Python's standard methods of creating new objects off common operations also leads to huge amounts of memory being used compared ('functional programming' to use the term of the moment) to Lua's more c-like mutate-in-place standard behavior.

Re:Lua: the world's most infuriating language? by Demiurge on Friday October 18, 2013 @09:08AM (#6571131)
Ok, these comments is exactly what I hear, but leaves me more curious. What exactly is this complexity? On the surface, Python doesn't seem much more complex. It's data-structures also seem more simple to me.
Re:Lua: the world's most infuriating language? by driax on Friday October 18, 2013 @12:25PM (#6572210)
Python is fairly simple in implementation while being as flexible as possible. Look up the concept of descriptors for something fairly difficult to optimize when you consider __getattr__ or __getattribute__. Consider also that you can directly access the __dict__ of both an instance and of the class of that instance. You can monkey-patch the class extensively or directly into it's __dict__. You can even replace the __class__ reference on instance to make it a subtype of different class (which is insanely flexible). Then there's the stuff about metaclasses, which is fairly advanced and collides with all of the other flexibility.

Basically pretty much anything not from __builtin__ or from a C extension is entirely mutable at any time. Consider one of the problems PyPy had with some packages. PyPy didn't support `locals()[42] = value`, which some packages actually depended upon. Nor does PyPy support `instance.__dict__[42] = value` which even more depended upon. Generally Python used a lot of simple concepts such as mutable dictionaries with heterogeneously-typed keys as the implementation of how classes, modules, etc works, which is flexible but very hard to optimize in any way (especially since they are mutable).

Re:Lua: the world's most infuriating language? by Demiurge on Friday October 18, 2013 @12:56PM (#6572414)
I think understand the complex reality that dynamic features arising from 'everything is a nested dictionary', and I used monkey patching once to save my life, but that seems a lot like Luas use of metatables. Is Lua less mutable?
Re:Lua: the world's most infuriating language? by kazagistar on Friday October 18, 2013 @11:30AM (#6571918)
Just use the dir() function on the repl and start digging.
Re:Lua: the world's most infuriating language? by Touche on Friday October 18, 2013 @09:43AM (#6571292)
if __name__ == "__main__"