Re:JITs are un-ergonomic
by erik_seaberg on Sunday March 29, 2020 @01:01AM
(#22716559)
This. Javascript engines have to do stuff like https://mathiasbynens.be/notes/shapes-ics to assume many objects will have the same key names and types and create an optimized class layout, with some kind of expensive fallback if anyone ever randomly stores a key or value that violates the assumption. They can't even be sure you'll always be doing integer math (unless you resort to bit masking a la asm.js). Hinting (like __slots__ in Python) might have helped some.
[ Parent
| on HN ]
Re:JITs are un-ergonomic
by discreteevent on Sunday March 29, 2020 @10:53AM
(#22719468)
This was one of the main motivations for writing dart. The V8 implementers were tired of having to write these kinds of hacks. Even though dart was initially a dynamically typed language, the shape of the objects was stable.