4 ms·
Can someone remind me again why there's never been movement to add a second modern language to web-browsers? JavaScript was created in a weekend and then stuff
by Someone1234 4y ago
Can someone remind me again why there's never been movement to add a second modern language to web-browsers? JavaScript was created in a weekend and then stuff tacked on for the last 28 years.
We know so much more about how to create programming languages today than we did then, and the whole "Year of the Linux Desktop" has become a WebAssembly meme now every year since its introduction six years ago, with it getting popular always next year, next version, with feature XYZ. Seemingly creating unmaintainable/debuggable mess from external languages with no true 1:1 into WebAssembly isn't as big of a hit as the originators expected.
Yet every time someone asks why there hasn't been movement here it is "Year of WebAssembly is next year!!!" WebAssembly has managed to slow actual progression towards something good. With the browser monoculture you'd think it would be easier now than ever to start a fully integrated second language with WebAssembly compilation for backwards compatibility.
- capableweb 4y agoWebAssembly is just what you want, a second "modern" language that works in browsers. It hasn't reached 100% of its potential just yet, as there are some things missing for that (like DOM access) but once the language is feature complete, I'm sure most languages will have some sort of "Lang to WASM" tooling that'll allow you to write React apps in Ruby or whatever, if you so wish. Stuff like that takes time though, so if you're antsy, you have two options: get involved, or wait patiently.
- tracker1 4y agoThere's a few options out there if you don't mind being an early adopter. Most interactions via DOM bridging are slower than actual React... but it's kind of cool. Yew (Rust) is one that I've been following with interest, the hello world examples are interesting enough. I know people that have been liking the direction of Blazor (C#) more, but it has a larger initial payload, that I don't care for, it's also closer to SSR approach in the browser. The problem with both, IMO, is that they don't have a good UI library/toolkit. I find mui.com (with React) pretty much the best browser ui framework I've experienced (since 1996). To me, the first language + component library that targets WASM and that level of components will likely win. Flutter is probably the closest example I'm aware of, though afaik it's JS as the browser target, not WASM, but wouldn't be surprised if this changes assuming DOM interop for WASM becomes better performing.
- lordgroff 4y agoBecause there's not that much wrong with modern JS, with the "created in a weekend" mantra being wholly irrelevant.. Back when JS was trash there was was Coffeescript and other lesser used alternatives, and Google tried to push Dart but nobody cared. Today is pretty much only JS and its superset TS and that's not an accident. They're perfectly productive. My annoyance with JS is almost entirely to do with Node, otherwise I prefer JS to Python, for example.
- tracker1 4y agoI know a few people don't like it... but I've really enjoyed the Deno take on things for JS/TS runtime. While I'd prefer more native deno, the npm/node compatibility integration has made it really useable. As for GP, you're right... there have actually been MANY attempts at other languages for in-browser. In the end, the JS runtime has been hardened and all other roads have led to WASM being the second target. I still remember a lot of people using VBScript in IE. I was an outlier in that I used JScript for classic ASP.
- judge2020 4y agoWASM is effectively "a second language" to browsers. Yes, you call it from Javascript, but it enables browsers to work with "any" language instead of standardizing on a second new language and doubling their workload by needing to integrate it with the rest of the browser just as tightly as they have with JS.
- cjpearson 4y agoThere have been efforts, but none have been totally successful. In the past you had Java applets, Silverlight and Flash. Compile-to-JS languages depend on rather than replace JavaScript, but it's about as close as you can get without being a browser developer. Chrome did originally intend Dart to be supported natively in the browser but eventually gave up that effort. Perhaps now Chrome is dominant to push it through without getting buy-in from Apple and Mozilla, but I doubt they have any interest now that there's WebAssembly. Like it or not, WebAssembly is seen as the answer for additional languages in the browser. And for most developers JavaScript functions well enough as either a development language or compilation target.
- pavlov 4y agoInternet Explorer supported multiple script languages. The DOM in IE was essentially a COM API and callable from any supported scripting language. This included JScript (their JavaScript clone) but also VBScript and PerlScript.
- tracker1 4y agoI don't recall seeing anyone actually using PerlScript, or other scripting languages beyond VBScript in the browser for apps. I did work in a few locations where there was heavy push for VBScript for browser. I used JScript in classic ASP in much the same way.
- vips7L 4y agoDart could have been our savior.
- tracker1 4y agoYou can still use Flutter/Dart if you want.
- marcosdumay 4y agoIf you want to use wasm, just go and use it. You don't need every other site to do the same before you jump in. Personally, I do think JS is a better fit than Rust or C for almost everything people do on the web. And the support in other languages is still too bad to use. But you can use it whenever you want, differently from a second language you may invent.