Live data from Hacker News

We Should Stop Using JavaScript According to Douglas Crockford (2023)

old.reddit.com

31–40 of 77 posts

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#31
post #5

Sharing a reddit link for the purpose of sharing a youtube video seems weird. WHat's the point of that? Is it to game the HN algorithm somehow?

My "devil's advocate" take is that that the reddit post provides an additional source of discussion points.

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#32

By any measure except by comparison to a hypothetical counterfactual universe, I think javascript is one of the most successful programming languages of all time, and one that has added more to the world than almost any other. It's like standards: some have better performance characteristics than others, some are more elegant, and so on. But the the best standard is the one everybody actually uses, because that is th…

> I think javascript is one of the most successful programming languages of all time, and one that has added more to the world than almost any other.

It is just a scripting language. If it wasn't JavaScript, it would be something else. It hasn't added anything besides lots of crappy code, most of which shouldn't have been written in JavaScript anyway.

I can't understand how anyone could find its moronic semantics bearable.

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#33
post #20

Earlier quoted context omitted.

can you link me to example that does wasm in browser without calling instantiateStreaming?

His entire point is that it can't be done currently.

so what's the big problem with calling instantiateStreaming? Explain it to me like i'm 5

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#34
post #22

Earlier quoted context omitted.

not all all. I just have: document.addEventListener("DOMContentLoaded", function() { const go = new Go(); WebAssembly.instantiateStreaming(fetch("/assets/other/json.wasm.gz"), go.importObject).then((result) => { go.run(result.instance); WasmReady('welcome.html'); }); }); and and that's it! Then from go there's nothing I can't do in the DOM.

Does wasm provide synchronous access through the perimeter?

WebAssembly itself does not provide synchronous access directly; the interactions with WebAssembly modules in browsers are asynchronous. This is because WebAssembly operations, like module instantiation and function calls, are designed to fit into JavaScript's event-driven, non-blocking model.

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#35

Earlier quoted context omitted.

not all all. I just have: document.addEventListener("DOMContentLoaded", function() { const go = new Go(); WebAssembly.instantiateStreaming(fetch("/assets/other/json.wasm.gz"), go.importObject).then((result) => { go.run(result.instance); WasmReady('welcome.html'); }); }); and and that's it! Then from go there's nothing I can't do in the DOM.

The `new Go();` is doing all the JS that you claim to not be doing.

but all my logic that changes the DOM is in go. What am I missing?

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#36
The broader point Douglas makes is the same one Jonathan Blow and Alan Kay make. "Why are we stuck with 20, 30, 40 year old software?"

We've learned a lot and we can re-build new clean stuff based on the new, richer understanding of what actually matters. But as Alan Kay talks about frequently, anything new has to be immediately just as good and usually better than the mediocre, bloated software for people to switch.

"Worse is better" still continues ...

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#37
Reddit thread on “Why We Should Stop Using JavaScript According to Douglas Crockford (Inventor of JSON)” (2023, video 2’15”) https://youtu.be/lc5Np9OqDHU?si=u5a3feWZa946sk7D

He doesn’t really say much other than it could be better if we used “clean” operating systems and “clean” programming languages, whatever that means.

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#38
Actual video (2023): https://www.youtube.com/watch?v=lc5Np9OqDHU

Instead of the reddit convo, some more discussions here:

Last week: https://news.ycombinator.com/item?id=41064461

Last year:

https://news.ycombinator.com/item?id=36241965

https://news.ycombinator.com/item?id=36164909

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#39

Actual video (2023): https://www.youtube.com/watch?v=lc5Np9OqDHU Instead of the reddit convo, some more discussions here: Last week: https://news.ycombinator.com/item?id=41064461 Last year: https://news.ycombinator.com/item?id=36241965 https://news.ycombinator.com/item?id=36164909

wow, good finds!

Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)

#40
post #20

Earlier quoted context omitted.

His entire point is that it can't be done currently.

so what's the big problem with calling instantiateStreaming? Explain it to me like i'm 5

instantiateStreaming is not the problem; the problem is that JS code is necessary (via that function or another) to execute WASM, and JS is necessary to call back from WASM into browser APIs. Because of that, WASM in the browser is, at present, effectively a JavaScript extension language, and it cannot meet the goals discussed by Crockford in TFA.

This hybrid approach that requires JS both at bootstrap and browser-API-interaction time significantly undercuts the benefits of WASM as a javascript replacement for several reasons. Some of those reasons are: this likely means JS will remain supported/enabled/required-for-many-sites in browsers, warts and all, in perpetuity; the advantages of WASM's sandboxability will be mitigated by the presence of a much more permissive runtime that must be present in order to load and run WASM artifacts; more performant/parallel access to browser APIs will remain difficult or impossible; multi-language/multi-build system competence will be needed due to large parts of the ecosystem remaining in browser JS.

Post reply on HN