News for hackers. Stuff that matters.
Re:Rust and WebAssembly in 2019 by jillesvangurp on Sunday December 16, 2018 @07:17AM (#18692783)
Rust and wasm is looking pretty interesting. I've recently started playing with kotlin-js. Kotlin also has a wasm compiler but their javascript transpiler has been around longer and garbage collection is short term an issue for their wasm compiler. Also there are a ton of kotlin-js libraries out there already which makes using this straightforward. This is exactly the kind of stuff the rust people are targeting as well. Basically, both ecosystems are creating all the tools and libraries they need to make pure rust or kotlin web applications. Rust is ahead but Kotlin and other languages are not far behind.

IMHO, the next two years there is going to be a massive adoption of wasm as the library ecosystem for different languages matures and as browsers gradually improve their wasm support. Contrary to the popular belief with javascript people, it will not be limited to just the performance critical parts: everything people do with javascript today is in scope. Absolutely no exceptions. I fully expect to see a lot of projects where the goal is to be 100% javascript free and I don't see any fundamental blocking issues to get there.

If you are doing a greenfield project today, that is already a feasible goal to set but you may have to reinvent a few wheels along the way or be dealing with not so mature frameworks and tools. However, once you start doing rust or kotlin, it will just feel wrong to have to revert to back to javascript or pull in an npm and wrap that with some facade. That's like admitting defeat. Basically, Rust people already concluded that they can do it all and are now in the process of doing it.

Re:Rust and WebAssembly in 2019 by jamil7 on Sunday December 16, 2018 @09:23AM (#18693137)
Personally I can't wait, javascript is miles ahead of where it was 5 years ago but it's still pretty painful to use on large, longer running projects with bigger teams. I once enjoyed it enough and now dread starting a project in it. Typescript is a massive improvement but maybe the ship has sailed. If we don't _have_ to use it anymore why bother?.
Re:Rust and WebAssembly in 2019 by jillesvangurp on Monday December 17, 2018 @11:29AM (#18699933)
With you there. I've spent some 'quality time' with javascript recently (as a backend developer). It doesn't suck as hard as it did a mere two years ago when I last did this and it is massively better than 20 years ago (netscape, shudder). But it's not quite awesome just yet.

Basically, I'm planning to ditch javascript pretty soon. I consider typescript to be a stop gap solution. I'd prefer to use something like Kotlin or indeed Rust. IMHO Kotlin is a great fit because it already is used for frontend work in Android. Also the transition from javascript to Kotlin is pretty smooth once you get over the stockholm syndrome that most javascript developers seem to suffer from (they don't seem to know better). I've seen a few people adapt to Kotlin and liking it. In my experience, these things tend to be driven by people voting with their feet. There's lots of early signals on Github that this is starting to happen.

I'd also prefer to opt out most of the npm ecosystem. IMHO, most of the stuff there is inherently javascript centric and not a great fit in a type safe environment that has things like generics, polymorphism, and other stuff that makes frameworks look and feel a bit differently. Even with type annotations like in typescript you get lots of leaky abstractions and you are still dealing with javascript when it inevitably blows up. Better to make a clean break with this and create a new ecosystem from scratch. And frankly, most npms are not that hard to replicate in another language.