It seems like it doesn't answer it's own question, so I'll pose another.
The entire Lua core is 15kLoC. Is that more than or less than what's needed for python's "a + b", assuming a and b are defined.
I'm genuinely curious.
The entire Lua core is 15kLoC. Is that more than or less than what's needed for python's "a + b", assuming a and b are defined.
I'm genuinely curious.
To answer your question, 15kLoC is more than enough to implement dynamic dispatch and the PyObject base struct, along with the special method logic for __add__ on any python object type.. but still a lot less than what's needed for all the special method types and a lot of boilerplate for the C-compatible interface around those methods.