Earlier quoted context omitted.
I think GP was referring to running wasm directly rather than using (as your website does with WebAssembly.instantiateStreaming) JS APIs to bootstrap it and JS APIs every time it needs to do something with the browser's built-in functionality (like manipulate the DOM).
can you link me to example that does wasm in browser without calling instantiateStreaming?
We Should Stop Using JavaScript According to Douglas Crockford (2023)
21–30 of 77 posts
Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)
#22Earlier quoted context omitted.
I think what the original comment means is that WASM is heavily sandboxed in the browser environment, and cannot interact with the DOM APIs directly. You still need JS for that.
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.
Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)
#23I’d argue he’s one of the key people who made JS a respectable language through “the good parts”.
It’s not necessarily the specific suggestions that are relevant but he was responsible for making people recognize that yes, JS is highly flawed, and yet, you can use it as effectively as any of the other popular OOP languages at the time by focusing on “the good parts” and eliminating the “bad parts”. I believe (and don’t quote me on this) he also had a very popular linter that showed this distinction could be automated.
The less popular part he added to the discourse was the idea that not only could JS: The good Parts be as good as the popular OOP languages of the time, but in fact it could be better because of the strong functional capabilities that JS had and languages like Java, C# and C++ either lacked or made cumbersome to use 15 years ago (and being a believer in functional programming I was one of those who appreciated JS because of this).
So for him to say we should move away from JS, whether right or wrong, is a pretty big deal IMO.
Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)
#24I have disabled JavaScript on mobile Safari because I can’t install uBlock Origin and most websites are blackmailing me with either injecting surveillance stuff or credit my bank. Without JavaScript, all popups are gone
Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)
#25It'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 the greatest value a standard can provide.
You could say "all that is true, but let's drop JS tomorrow and replace it with something even better," and I guess that's true. It's also true of English, and money, and shoes. Even though I'm on HN wasting time instead of working, that kind of fantasizing seems like a pointless exercise.
Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)
#26I think I agree with everything he's saying. There have been arguments against javascript for a long time. If anything though, I think they've diminished over time as the language has improved. I still don't really like it. But there still isn't a technology that can do what js does. That is, distribute apps in a truly cross-platform, zero-install way. So people will keep using it at least as long as that's true. I'm…
Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)
#27Earlier quoted context omitted.
I think what the original comment means is that WASM is heavily sandboxed in the browser environment, and cannot interact with the DOM APIs directly. You still need JS for that.
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.
Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)
#28I'm still coding Javascript every day today. While I know a dozen other languages, I really don't understand the hate that Javascript gets. Other languages suck too, just in different ways. If you know the rules of a language, and you don't do obviously stupid stuff, then you can get a lot done in any language, even Javascript.
It seems like lots of programmers always want perfection in everything, and that's just counterproductive. Javascript isn't perfect, but I can get a lot done with it. I can say the same for a dozen other programming languages.
People need to stop complaining and just build stuff. Javascript is not the thing stopping anyone from building cool stuff, it's their own mental blocks and avoidance of tech they don't fully understand, or their refusal to fully understand it because they think it's somehow inferior.
I don't really need Javascript to change, I don't need it to be like every other bloated language. Keep bloating it and it will end up being something nobody wants to use, including die-hards like me.
Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)
#29In this context, describing Crockford as “the inventor of JSON” is doing him a disservice. I’d argue he’s one of the key people who made JS a respectable language through “the good parts”. It’s not necessarily the specific suggestions that are relevant but he was responsible for making people recognize that yes, JS is highly flawed, and yet, you can use it as effectively as any of the other popular OOP languages at t…
IMO the WASM story might end up expanding to swallow JS, but Doug Crockford won't be making that happen any faster or slower. Google also tried to introduce Dart to the browser but experienced political whiplash. I don't think Doug Crockford can help that either, especially now that Google is extra afraid of regulatory attention.
Re: We Should Stop Using JavaScript According to Douglas Crockford (2023)
#30Is it a bad language? Doesn't matter, nothing can beat that feature set. In the year 2424 people will be using machines a hundred thousand times more powerful than machines today and devs will still be fucking about dealing with javascript apps running like pigs.