Sitemap

JavaScript vs JSSugar vs WebAssembly

2 min readOct 17, 2024

It has been an eventful week. Anyone Else wondering, what is the future of the internet?

JavaScript vs JSSugar vs WebAssembly

We all know and love JavaScript for its versatility, vast ecosystem, and its role in making the web interactive. However, it can sometimes be slow and prone to bugs due to dynamic typing or pseudo-static typing (like TypeScript). It also typically involves two phases: transpilation (especially when using tools like Babel or TypeScript) and interpretation/execution by the browser before it interacts with the DOM.

Now, there’s JSSugar (JSO), a new proposal that simplifies JavaScript by offering cleaner syntax, reducing the complexity for developers. However, JSSugar still needs transpilation into standard JavaScript, meaning the code goes through one transpilation phase, followed by the regular JavaScript execution phase Theo has a good video on this . In short it reduces it down to one phase. But threatens the existence of vanilla javascript.

https://www.youtube.com/watch?v=m1Sa1Sbyejg

Then there’s WebAssembly (Wasm), a true game-changer for speed and performance, especially in tasks that involve heavy computation. It runs at near-native speeds since it’s precompiled into a binary format and executed directly by the browser’s WebAssembly runtime. However, WebAssembly doesn’t interact directly with the DOM or browser APIs, requiring JavaScript for that. It has yet to see widespread adoption due to its development complexity. This approach essentially skips the multi-phase execution JavaScript requires, but is it overkill when many of our performance bottlenecks, when optimized, lie on the backend?

If we make a strong case for Rust, shouldn’t we be making an even stronger case for WebAssembly? Or can we agree that, much like Go being ‘fast enough,’ JavaScript as we know it today is ‘good enough,’ and we don’t need a new JavaScript?

--

--

No responses yet