3 ms·
Okay, but how about other JavaScript engines? And shouldn't stuff like this be in the specs, so that the language becomes more consistent and predictable?
by amelius 9y ago
Okay, but how about other JavaScript engines?
And shouldn't stuff like this be in the specs, so that the language becomes more consistent and predictable?
- tptacek 9y agoNo, since you can obviously implement Javascript in ways that have other memory usage patterns.
- zeroxfe 9y agoThese are implementation details -- they don't belong in the specs. You can't access raw memory from JavaScript.
- pcwalton 9y ago> Okay, but how about other JavaScript engines? SpiderMonkey uses NaN-boxing, so pointers to objects will sometimes take up less space than in V8. As for hidden classes, I'm not sure about how shapes (SpiderMonkey's term for hidden classes) interact with constructors. > And shouldn't stuff like this be in the specs, so that the language becomes more consistent and predictable? That would stifle compiler innovation. Not even the "low-level", "predictable" C and C++ mandate particular implementations, beyond specifying the bare minimum necessary to ensure pointer arithmetic works portably.
- amelius 9y ago> Not even the "low-level", "predictable" C and C++ mandate particular implementations But at least with C and C++ a developer can test the performance before deployment.