News for hackers. Stuff that matters.
Re:Faster CPython (2021) [pdf] by funklute on Sunday January 23, 2022 @03:18PM (#30050045)
How many of these "levels" (not to confuse them with actual classes) exist in javascript? Only the first one?

(that said, I guess the fourth one (metaclasses) isn't a clear yes/no, since OO is very different in js)

Re:Faster CPython (2021) [pdf] by Jasper_ on Sunday January 23, 2022 @04:20PM (#30050539)
Hard to compare exactly with that classification, but JavaScript only has the first one, and arguably parts of the fourth one.

metaclasses isn't really a major optimization hazard, it effectively boils down to hijacking the "class" syntax to instead run some custom code. It's used by things like dataclasses and the Django ORM to use class syntax to make a little DSL.

Re:Faster CPython (2021) [pdf] by ericvsmith on Sunday January 23, 2022 @10:17PM (#30053329)
dataclasses do not use metaclasses (I’m the dataclasses author).
Re:Faster CPython (2021) [pdf] by Jasper_ on Sunday January 23, 2022 @10:36PM (#30053439)
Apologies, I must have been confusing it with some other Python syntax tricks I've seen. I don't write too much Python anymore..