Hacker News new | past | comments | ask | show | jobs | submit login

I really wish browsers had continued to develop a "use strong" mode for JS. It sounded like there were significant challenges, but curbing some dynamism in order for more predictable optimisation sounds like a great tradeoffs for production-quality apps.



Take that to the extreme and you get WASM, or it's predecessor asm.js

It's also what JITers like V8 internally do, you'll get major performance hits if you do weird dynamic things.


If you want complete type erasure, then a system that ensures monomorphism is critical to good JS performance.

If you can leave the type system in place, then you could move toward an ML-style type system and see massive improvements within strictly-typed parts of the code as you'd only need type guards and inline caches at the boundaries of the strictly-typed code.


> Take that to the extreme and you get WASM, or it's predecessor asm.js

Only if your code was pure number crunching.

Normal code can't just go through some belt tightening to become WASM/asm.js code. Compiling it down that way is very different from making the control flow more understandable to the optimizer.


I think taken to the extreme "use strong" is more like putting Dart in the browser. But yes, you can sort of get the benefits of use strong with the right discipline.


Yeah, I wonder where that performance increase actually comes from. This[1] lists their optimizations.

My guess is mainly the integer optimizations. And I guess making sure that functions are always called with the same argument types. The other optimizations is already done by the JITs.

[1] https://evanw.github.io/skew-lang.org/





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: