Like it or not, Javascript is going to be around for a while.
This article is not, in and of itself, particularly relevant to language documentation, as it deals with (a cool) programming language called Haskell. Haskell has the reputation of being a very cutting-edge, even difficult language.
I’ll be perfectly honest, I have no idea what most of the article is about! Apparently the creators of the Glasgow Haskell Compiler are working on making their tool output Javascript. If I understand correctly, the idea is your write some Haskell, and the compiler outputs Javascript, which can then run, I presume, in web browsers.
There’s just one paragraph I’d like to draw your attention to (emphasis added):
To put it simply, the number of users on the internet is as low as it will ever be right now, and it is almost guaranteed that those users use JavaScript. At time of writing, JavaScript holds 97.3% of client-side programming market share (not to mention market share of front-end technologies). Furthermore, JavaScript is not going to disappear anytime soon. As more and more interactivity is pushed onto the internet, JavaScript will become more entrenched because of backwards compatibility, network effects and the amount of capital already devoted to it. JavaScript, like C and COBOL will be with us for the foreseeable future. This makes JavaScript an attractive target; it provides portability, allows us to capitalize on the massive investments in the language and platform, and essentially eliminates the risk that the we build our technology atop a disappearing or deprecating foundation.
In my opinion we should be making the same bet in language documentation. This is not to say that other programming languages — especially, for our community, R
and python
— should be ignored, far from it. But Javascript has a uniquely ubiquitous status in the programming landscape.
When the authors talk about “the massive investments in the language and platform,” the thing that stands out to me is the Document Object Model or DOM
. This is the thing that makes HTML
documents programmable. Because Javascript creates a DOM
from HTML
, you can write programs that make the page interactive. This is not necessarily obvious to users, who may not have any reason to stop and think about “where” programs are running. What’s revolutionary about Javascript is that it is used in an ecosystem where programs stored just like documents on a server, and then run in the client’s web browser.
This is a super weird idea, when you stop to think about it: web pages have URL
s, after all, and look like the they are “on” the server. But the code that makes a document interactive — that is, that turns it into something more like an application than a document — can run on your computer.
There are limits to this approach: a laptop is not a heavy-duty server with massive memory and disk space. So you wouldn’t want to try to distribute a massive database plus a program for accessing it directly to users’ browsers. But what I find interesting is that the definition of massive has been changing. It’s absolutely feasible to run medium-sized databases and accompanying code in this way. And in the early stages of language documentation of an undocumented or underdocumented language, every database is (by definition!) not massive. I believe we should keep exploring this programming environment in language documentation, it’s getting more powerful every day, not less powerful.