News for hackers. Stuff that matters.
Re:The Birth and Death of JavaScript (2014) [video] by tedk-42 on Sunday June 20, 2021 @01:30AM (#27567382)
Javascript will never die, unless there's something to come along and either replace browsers or replace the scripting language used by browsers.

WASM is not a replacement to JavaScript and never will be. It's not even a damn language.

Re:The Birth and Death of JavaScript (2014) [video] by brutal_chaos_ on Sunday June 20, 2021 @01:50AM (#27567489)
I beg to differ. WASM, if it doesn't go off the rails with future revisions, will supplant JavaScript because of WASM being a compilation target. This, in effect, opens up any language to run on the web. JavaScript may not fully disappear, but usage will most likely greatly diminish.
Re:The Birth and Death of JavaScript (2014) [video] by tedk-42 on Sunday June 20, 2021 @02:31AM (#27567686)
A small JavaScript text file which can currently run natively on any browser will always be far superior to a binary WASM blob that's compiled.

WASM fills in a use case where you need to run highly performant code on a browser. It just so happens that you can write it in whatever language you choose.

Re:The Birth and Death of JavaScript (2014) [video] by qbasic_forever on Sunday June 20, 2021 @03:45AM (#27568005)
There's no difference--that small JS text file gets compiled on the fly into platform-specific assembly language with today's JIT compilers in browsers. WASM is just skipping the text source step and giving browsers something they can compile directly.

I do agree it is a shame to lose direct insight to the text source code, but let's be honest the production JS shipped to browsers today is far, far from being human readable. It's minified and shrunk to the most small and incomprehensible degree to save bandwidth. View source and try to read and understand the JS on any big site like facebook.com, etc. and you won't get very far.

Re:The Birth and Death of JavaScript (2014) [video] by tedk-42 on Sunday June 20, 2021 @04:10AM (#27568109)
There's a big difference in how you develop, ship and share the code.

I would say a page loading a 1KB JS file better off than a WASM binary blob that's 2MB.

Edit: to be clear, I'm not focusing on performance

Re:The Birth and Death of JavaScript (2014) [video] by moron4hire on Sunday June 20, 2021 @09:00AM (#27569528)
> WASM fills in a use case where you need to run highly performant code on a browser.

That's not exactly correct. It's possible to write equally performant code in just Javascript, by being careful to avoid certain features of the language (e.g. garbage collection, expando objects, dynamic types for variables, etc). Writing code in a stricter language like rust or c++ might make hitting those targets a little easier, but also using TypeScript can make it easier, too.

With the exception of loading, parsing and some JIT profiling, as WASM can potentially be smaller, and it can skip the majority of parsing and early profiling.

So WASM shouldn't be thought of as a tool for achieving speed. It should more be thought of as a means for running cross-platform code, for languages other than Javascript.

Re:The Birth and Death of JavaScript (2014) [video] by dmitriid on Sunday June 20, 2021 @03:51AM (#27568028)
> will supplant JavaScript

Not until either of the two things happen:

- WASM gets GC and can work with DOM directly

- DOM is supplanted by canvas- and webgl-based libraries and frameworks

Re:The Birth and Death of JavaScript (2014) [video] by habibur on Sunday June 20, 2021 @04:06AM (#27568093)
Those things will be built over time. It's a large field out there waiting to be explored.
Re:The Birth and Death of JavaScript (2014) [video] by Fergusonb on Sunday June 20, 2021 @02:21AM (#27567631)
Javascript is still popular today even if you ignore the browser. Node is all over the place.
Re:The Birth and Death of JavaScript (2014) [video] by mysterydip on Sunday June 20, 2021 @07:32AM (#27569088)
Javascript is the C of the web. We had a chance to learn from hindsight, and instead we made a different behemoth without realizing it.
Re:The Birth and Death of JavaScript (2014) [video] by kortex on Sunday June 20, 2021 @10:20AM (#27570266)
Or is it? One thing JS and C have in common is a minimal core, kinda loosely defined, relatively easy to implement, that nonetheless lets you create powerful abstractions. I don't think it's a coincidence. I think anything more sophisticated and "well-built" ironically would have seen less initial traction, and lost first-mover advantage.

That JS wasn't a Lisp is kind of a pity, though. But again, Lisps have been around longer than almost any other language yet are still comparatively obscure, which tells me something inhibits their broader adoption.