4 ms·
> Wasm isn't a replacement for JavaScript I think a lot of people want it to be a replacement for JavaScript. And I think that makes sense, if for no other rea
by josephg 3y ago
> Wasm isn't a replacement for JavaScript
I think a lot of people want it to be a replacement for JavaScript. And I think that makes sense, if for no other reason than learning JavaScript is a hassle. Lots of folks think of themselves as a C# developer, or a Python developer or whatever. A lot of developers would rather make websites in their language of choice than learn JavaScript. (And who can blame them?). Webassembly (with GC bindings) should be able to make that possible.
- JoshTriplett 3y agoIndeed. node.js was popular in part because you can use the same language on the client and the server. All-WebAssembly no-JavaScript sites would allow the same thing with other languages.
- bmoxb 3y agoLearning new languages may be component of it, but I think more generally, different languages are suitable for different problems and different developers. Being free to use the most suitable or preferred tool for a task is undoubtedly desirable, rather than having JavaScript as the only option. And, while more of a personal opinion, JavaScript is not a well designed language - permanently shackling the web to it prevents progress forward.
- ern 3y agoAs much as many people want alternatives to JavaScript, there are also people who consider themselves JavaScript experts (or the various related languages like TypeScript). They’ve invested a ton of time and effort into getting to where they are. There’s a balance between disruptive change and keeping these folks on board. Get it wrong and you’ll end up with it strangled in its cradle. My own take is that low-code platforms will continue aggressively moving into this space, especially in the enterprise space. They come with their own problems and are often aggressively overhyped, but they will put pressure on “traditional” developers to move faster and look for better solutions.
- hutzlibu 3y ago"As much as many people want alternatives to JavaScript, there are also people who consider themselves JavaScript experts (or the various related languages like TypeScript). They’ve invested a ton of time and effort into getting to where they are." I do not see a problem here. The idea is not to replace js (not realistic anyway), but to have a full working alternative to not have to use js anymore, so in the end you can really choose how to build for the web. I also invested heavily into js ... but I am really looking forward to the day, I can use something sane again.
- mr_toad 3y ago> A lot of developers would rather make websites in their language of choice than learn JavaScript. (And who can blame them?). Personally I’m quite happy to blame them. If I want to do ML I use Python, if I do statistics I use R, for messing with Windows I use C#, for using databases I use SQL and for the web I use JavaScript. I think that refusing to learn other languages is a foolish consistency.
- satvikpendem 3y agoIf those all compiled to WASM, then you can mix and match freely.
- pjmlp 3y agoAlready possible in .NET for years, it is called Common Language Runtime for a reason. Also TIMI on IBM i, language environments on z/OS, among other examples.
- satvikpendem 3y agoTrue, but imagine being able to interop with all the languages ;)
- pjmlp 3y agoI don't need to imagine, > More than 20 programming tools vendors offer some 26 programming languages — including C++, Perl, Python, Java, COBOL, RPG and Haskell — on .NET. Taken from https://news.microsoft.com/2001/10/22/massive-industry-and-developer-support-for-microsoft-net-on-display-at-professional-developers-conference-2001/ https://news.microsoft.com/2001/10/22/massive-industry-and-d... In 2001.
- tredre3 3y agohttps://en.wikipedia.org/wiki/List_of_CLI_languages https://en.wikipedia.org/wiki/List_of_CLI_languages At first it seems like an impressive list of languages! But upon closer inspection, over half of them are either abandoned or are commercial products that have been coasting mostly unmaintained for a decade... By now even the JVM ecosystem is a lot healthier. With WebAssembly, all languages[1] supported by LLVM can be compiled with no custom compiler nonsense. AND we get all the languages[2] that depend on those languages for free as well! The entire burden is on LLVM (and soon GCC) with everything benefiting downstream, surely you can see how it's different from CLI/JVM? This time the compile-once-run-everywhere promise might actually be true. 1. C, C++, Zig, Rust, etc 2. Python, Perl, PHP, Lua, we can even do some inception with webassembly runtimes.
- dmazzoni 3y agoWhat you're describing already exists today, that's exactly what Blazor is: https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blazor https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blaz... Blazor lets you build web apps using C#. It achieves that by running C# inside WebAssembly.
- devjab 3y agoBlazor is silly. It’s more complicated to use than simply using React/Angular/Whatever you want and it’s less efficient, take up huge amounts of space and is much harder to debug. Coupled with how hard it is to actually build reusable components in any sane way… It may get there eventually, but as with most C# things these days, it’s mostly meant to sell other Microsoft products to the horde of developers who view themselves as single language developers. The real risk isn’t so much in the technology, however, it’s in whether or not Microsoft abandons it before it’s good like they have with their previous GUI frameworks going all the way back to ASP classic. I know that angular made a big leap from JS to TS, but aside from that, your major JS frameworks have been fairly stable in the same time frame that Microsoft has gone through web forms, mvc, razor, whatever the hell the web-api bundled with X period was and now Blazor, and what is the most telling of all is how virtually every Microsoft Office365 product is written in JS. Would you really bet on a semi-shitty technology that doesn’t even see adoption within the company that makes it? Well, I guess you do considering you’re using C#.
- josephg 3y agoYeah I know; but blazor is huge because it needs to ship its own garbage collector and object runtime. Google says 1.3mb for a hello world blazor app. With wasm-GC, blazor should get way faster and smaller. And the blazor-(JS & DOM) bridge can be massively simplified too. I don't see any good reason for blazor apps to be any larger than the equivalent react app. And that will make it a much more viable platform.
- DonHopkins 3y agoThere's also something that you might have actually already heard of called Unity3D. And it's actually widely used and supported and taught by more than a few people and companies and educational institutions.
- DonHopkins 3y ago[flagged]
- josephg 3y agoPersonally I agree with you. I've touched code in about 5 different languages in the last month alone. But the majority of programmers out there aren't like you and I. Most programmers see themselves as a "java developer", or a "python developer" or an "android developer". They aren't full terrain engineers who go wherever the song takes us. Lots of programmers want to write code in their preferred language, close tickets, get paid and go home at the end of the day happy. It will always be an uphill battle to convince a lot of these people to spend their weekend learning javascript. Its much easier to make wasm good. Let Go programmers use go to make websites. Why not? If its any consolation, they'll still need to learn HTML and CSS in the process. Javascript isn't going anywhere if they want to make the switch later.
- DonHopkins 3y agoYou're right. I don't consider those people serious programmers, just uneducable monolinguistic coders, who are going to find their dead-end jobs easily replaced by AI. ChatGPT is not just useful for banging out boilerplate code, it's much more useful for teaching programmers who are willing to learn new apis and how to code in new languages and better in the languages they already know. And that opportunity is missed on monolinguistic coders who refuse to learn or even read the fucking manual, and just see AI as a replacement for posting "just give me the codes" and copying and pasting from Stack Overflow. Real programmers aren't going to be replaced by AI. Programmers who refuse to use AI and refuse to learn are going to be replaced by AI and programmers who are capable and enthusiastic about learning.
- satvikpendem 3y agoJust use Flutter, that's what they're already doing, similar to Blazor. In fact, Chrome shipped WASM-GC and Flutter has an experimental build that uses it.
- konsoletyper 3y agoLooks like most people have misunderstanding: they think that WebAssembly is the only way to run their favourite language in the browser. However, there's another way that exists for decades: simply use compiler of their favourite language that produces JavaScript! As for Java, GWT exists almost 20 years. Another example I know of is Brython which runs Python on top of JavaScript. However, looks like Java developers don't like to write websites, even while GWT is there. And according to my experience, WebAssembly is not a game changer: it does not provide extra performance here, neither does it allow to get smaller binaries. I'm a developer of another Java-to-JavaScript compiler, TeaVM. I recently compared performance of JavaScript and WebAssembly targets, and in one particular case WebAssembly is slower: https://teavm.hashnode.dev/comparing-teavm-with-kotlinjs-peformance-with-software-3d-renderer https://teavm.hashnode.dev/comparing-teavm-with-kotlinjs-pef.... There's another example where WebAssembly is only slighly better: https://teavm.org/gallery/jbox2d/index.html https://teavm.org/gallery/jbox2d/index.html. In both cases WebAssembly binary is huge compared to JavaScript. On one hand this can be because of I don't target Wasm GC, so binaries get bloated because of need to maintain shadow stack. On another hand, there's Google Closure Compiler, which produces Wasm GC binaries, and from what I heard of it, WebAssembly binaries still don't win in their size.