lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Adam,

On 13 July 2017 at 05:11, Coda Highland <chighland@gmail.com> wrote:
> On Wed, Jul 12, 2017 at 5:22 PM, Dibyendu Majumdar
> <mobile@majumdar.org.uk> wrote:
>> I am reading the Python language reference and am completely
>> overwhelmed by the complexity - not of the language per se which seems
>> slightly more complex than Lua - but the meta mechanisms which are too
>> numerous for me to try and remember them all. Makes me appreciate
>> Lua's comparative simplicity - there is only one meta mechanism to
>> understand in Lua - the metatable.
>>
> To be fair, Python doesn't just have meta-mechanisms, it has
> meta-meta-mechanisms. Most programmers will never need to worry about
> this, but the tools are there for the purpose of allowing sufficiently
> clever people to extend the class system itself rather than just
> extending a class. This is generally useful for things like
> automatically hooking up behaviors into subclasses -- a classic
> example is data persistence, where a metaclass has the ability to look
> at the structure of the subclass and create the necessary functions to
> dynamically create them from stored data, without requiring the user
> of the persistence library to screw around with decorating all of
> their stuff.
>

You are right but it is a lot to take in! And no wonder it has been so
hard to built JIT technology for Python - because any implementation
has to respect all the meta meta mechanisms.

Regards
Dibyendu