2 ms·
It's called Type Specialization http://dl.acm.org/citation.cfm?id=1542528 http://dl.acm.org/citation.cfm?id=1542528
by Offler 14y ago
It's called Type Specialization http://dl.acm.org/citation.cfm?id=1542528 http://dl.acm.org/citation.cfm?id=1542528
- asynchrony 14y agoClass declarations will be equivalent (can be desugared to) a function declaration and some manipulations of the function's prototype. JS VMs already optimize this pattern, so why should syntax sugar for classes be anything special for the compiler?
- Offler 14y agoBecause it takes time and CPU cycles for them to figure out what is a Type and what is not. They don't know how much memory to allocate to these objects for instance, but now with classes they will know types immediately.