- Jan 25, 2020
X-periment: A React, Elm, and WebAssembly Story
X-Team recently held a round table discussion on the future of front-end web technologies, and one specific topic really stood out. With React.js being one of the current juggernauts of front-end development, can an up-and-coming technology like Elm hope to dethrone it? And what does WebAssembly have to do with all of this?
While readers are likely familiar with React at least on the surface, let us kick this off by giving you a short overview of what this "Elm" thing even is.
Elm is a purely functional programming language for declarative creation of web user interfaces. It first appeared in 2012 and is currently at version 0.18 (November 2016). It is a statically, strongly typed language with type inference.
Thanks to its functional origin, it places high value on value immutability, i.e. once created, a value cannot be changed. It uses a module system, which enables for cleaner composition with several files and thus also allows for only importing values, thereby hiding implementation details irrelevant for programmers just using a module.
Future of React with Elm on the horizon
As a React discussion grows longer, the probability of a comparison involving jQuery approaches 1
Fortunately, nobody mentioned jQuery in our discussion, despite this nice Godwin's Law fork by Pawel, but X-Teamers nonetheless came to a consensus in the end. Despite several of them being highly interested in Elm, some of them having even done first pet projects in it, none believed that Elm could usurp the top spot in front-end web development in the near or medium future.
There is a game-changer incoming, however, and that is WebAssembly.
Currently, WebAssembly is supported by Firefox >52, Chrome >57, Chrome for Android >57, Safari Technical Preview, Opera >44, and MS Edge as a preview release. You can check the levels of support at CanIUse.
Front-end takeover by Wasm?
While it is unlikely that React would lose a major part of its market share, it is to be expected that with the advent of WebAssembly, many new patterns for developing for the front-end will emerge, as several languages, which have hitherto been confined to servers, will suddenly find their way on the web. However, even with some parts of React staying the same, it is likely that these new developments would influence how it continues to develop, incorporating some of the best novelties itself.
X-Teamers are optimistic about the future of front-end development, with many interesting technological opportunities being just around the corner. Regardless of how Elm and WebAssembly turn out by the end of the year, there can be no doubt that we are all in for an interesting ride.
And, remember, whatever happens, we will be there, surfing on the cutting edge of tech!