re: Will WebAssembly replace JavaScript? Or Will WASM Make JavaScript More Valuable in Future? VIEW POST

re: Interesting, but to be clear. How much JavaScript do you really write? You do not have it on your CV? And can you list some sites you have made wi...

@chad A lot more lately than I care to advertise on my CV because I'm not planning to be a full time front end developer. I wrote a couple of tens of thousands of lines of JS and typescript in the last six months for inbot.io. The front page is react and not done by me but the application linked from there was rewritten completely by me. It's a mix of typescript and javascript and uses a small framework called redom. I'm at this point pretty familiar with both languages and have migrated a lot from one to the other.

To give you the context; we used to have a front end developer and I took over his tasks end of last year. As we had some significant new requirements, I ended up touching and modifying large parts of it; converting most of it to typescript; and developing some pretty significant new features from scratch. The typescript conversion is still ongoing and has been totally essential for me to get a grasp on this code base. Refactoring other people's Javascript is just not a thing and when tests are also not a thing, you basically are forced to slowly reverse engineer what everything does. This is extremely painful in JS. Lets just say that I learned a lot of interesting javascript hacks that I would argue are seriously misguided by picking them apart and trying to figure out WTF was the intention before rewriting in typescript.

And you are right, I'm not particularly liking either language but you'd be wrong to assume I can't work with them. Typescript particularly, is actually fine and I wrote many thousands of lines of Javascript before switching to that.

But if you know other languages like Kotlin it kind of feels a bit messy and limited. It sort of gets you part of the way to a better language but not all the way. Part of that is just because they want all JS to be valid TS, which just means you are stuck with a lot of legacy.

Typescript adoption in the industry is unprecedented. I've never seen anything getting adopted this quickly. I've seen numbers suggesting that well over half the new projects are typescript now. It's for a good reason because Typescript indeed gets you types and better tools.

IMHO, if you are doing Javascript instead of Typescript at this point, you are simply doing it wrong. I've been fixing a lot of very obvious type errors as part of converting code to typescript. IMHO that's a category of bugs that is simply inexcusable in modern development. JS apologists seem to be increasingly on the defensive when it comes to this. You see the same in other dynamic languages that are also moving to stronger typing (e.g. Ruby and Python).

On the WASM front there are a few blocking issues like e.g. garbage collection still being in the process of implemented in browsers. ETA for this seems to be 1-2 years max. Despite this, you can run e.g. C# with Blazor (brings its own GC), Rust with several rust specific frameworks (no need for GC in rust) and a few other things. Google just released Google Earth as a WASM application.

Right now the limiting factors seem to be that it is mostly quite early. Despite this you see some efforts to completely bypass the js/npm ecosystem in several language communities targeting WASM. This is kind of the point. WASM is a runtime for people who'd rather not use Javascript. It's not going to be limited to just the stuff that JS is too slow to do.

E.g. the Rust people are pretty serious about doing everything in Rust. If you are doing Rust, you'll not have a lot of patience for languages like Javascript.

Similarly, C# people won't have a lot of appetite for javascript either when they are doing stuff with Blazor. The trend is pretty clear: these are very young projects but there seem to be lots of people interested in driving them.

I have good hopes for Kotlin and Swift in this space. They are already quite popular with frontend developers and both have llvm based compiler tool chains capable of producing WASM. This won't happen overnight but it is already starting to happen.

@jilles - that is a thoughtful and educational reply. And in turn, I can see that you have carefully thought about why JavaScript is not doing the best job you could hope for. 20 years writing javascript, I cannot say my code did anything special beyond doing the expected job. I can see the complexity and need growing for ever more modern approaches to building apps for the web. Many years ago, I saw middle and backend tier developers whom looked down on javascript and frontend web developers come over to writing javascript.

As the stack (in many cases) began to shift further toward "the client" and to stay relevant, and have work, many of these long time software programmers began to move into JavaScript and essentially the front-end, and javascript moved to the middle and backe-end. And now here we are, folks still seem to fall into camps.

Front-end development is just more difficult than backend development in some ways, and targeting multiple browsers as platforms with the same code base is just plain hard to do, or at a minimum requires real dedication to the work at hand.

Making multi-modal applications requires mastery and dedication to make a great web application and I get the inclination that the industry will always be chasing a carrot, even when it had something great that almost matured to be what was best for the expected outcome for our web.

Let us see how this new future for WASM evolves. To give some more context, I started my career 25 years ago building print layouts with tools that laid things out perfectly on the screen, and as the web evolved, so did my web coding. To share more, I have long been challenged with long hours making things pixel perfect with modern approaches, but I always succeed at the task.

I have trusted people, who swore the new ways would solve what seemed taken for granted in the digital print industry to no avail. Hence why I am seeking out mentors and masters in WASM. I like c# and what I have seen from Blazor so far. I make desktop apps and browsers with c# for automation often. I also make desktop hybrid apps with electron.js. I am open to the better future you describe and finally will close this reply with thanks for being so detailed and clear in your reply, and I look forward to more opinions from you and the community in the future. Sincere regards Jilles!

Code of Conduct Report abuse