Web Development: JavaScript Comes of Age

Back in the day, JavaScript was a tacky interpreted language you used as “glue” when putting together Web pages.  When I benchmarked it against C for a scientific computation application in 2005, it came in between 27.7 and 46.9 times slower than code compiled with C.

Well, that was then….  I’ve just completed a series of benchmark tests of JavaScript on platforms which include node.js, Chrome, Chromium, Brave, Firefox, and Apple’s Safari (on both the MacOS X desktop and iOS iPad), and on some of the desktops it runs faster than C and on none of them more than 50% slower.

For Web developers, this is Big Thing.  It used to be you’d code your little hacks within Web pages in JavaScript, but then basically re-do them on the server side since you needed a language which wouldn’t reduce the server to a crawl at peak load periods.

Now, you can write everything in JavaScript, using node.js on the server side, and happily re-use code between the two platforms.  When I developed The Hacker’s Diet Online, using JavaScript on the client and Perl on the server, using a common language would have almost halved the development effort, but in 2007 JavaScript wasn’t up to the job.  Now it is.

If you’d like to read the complete benchmark report, here it is.  You can download the benchmark to run on your own machines from that page.  Since the document contains tables, it’s just too painful to re-post here, and all I’d get for doing so is a bunch of TL;DR comments.

At this point, I’ll put down the discovery that JavaScript is a programming language fully competitive with legacy languages on both client and server platforms as one of the top things I’ve learned this year, right up there with that the economics of an enormous yet fully-reusable space launcher beat those of a modest-sized rocket you throw away every time.  Well, even Elon Musk only figured that out in the last year.

Tagged , , . Bookmark the permalink.

5 Responses to Web Development: JavaScript Comes of Age

  1. AvatarXennady says:

    Sigh.

    I wish I had more time and more motivation to learn about all this. But I’m painfully aware that I’m not going to get good enough to make a living at it, nor is it enjoyable enough for me to learn for fun.

    But it’s still cool to read about.

  2. 10 Cents10 Cents says:

    Are you saying someone upgraded to something better? Doesn’t the cause a tear in the space time continuum?

    My project is to load Windows 10 from 5 inch floppies. Please go to my GoFlopMe page to donate to the cause. How many floppies do you reckon I need?

  3. AdministratorAdministrator says:

    I have not followed developments in JS since the release of JQuery. Most of what I remember is that it was going to take over the world, because it was platform-agnostic. It would run on anything that had a browser, and because it was a truly general-purpose programming language, it could run anything you wrote in it.
    I got the Python bug and adored it through 2.2 – 2.4, reading lots of books and admiring it from afar, but seldom actually did anything. It needed the Python interpreter everywhere. If you had to live in several places at once, and didn’t administer some of them, you were stuffed.
    I was forced to work in MS’ “dot net” programming products sometimes, and as it matured, I got to like the approach of a common intermediate representation, with several languages available to the programmer. But the real strength of “dot net” was its intimate access to all of the Windows *and Office* goodies. This was denied to JS both as a pragmatic measure (don’t let anything in your browser peek under the (spread)sheets), and as part of Micro-Soft’s monopoly strategy of make, take, or break. They had done this to JavaScript by making their browser, Internet Explorer, interpret the JS language differently, so that popular or necessary features did not work in IE. Instead, they had a shiny, improved, different version of JS which began to strangle the original. Oh, and MS’ was proprietary. IIRC, you could use it all you wanted, but there were strings attached.
    JS had also earned a continuing reputation as a fine language for introducing vulnerabilities to the system. And, as noted above, it was slow.
    Now that decades have passed since the early days of ECMAScript and its farcical re-naming to “JavaScript”, which has exactly nothing to do with the Java language, John’s results indeed show that the language has “matured”. Things in trouble get better or they die.
    I may have to look at JS again. Not that I expect to do anything important or even very interesting. I suspect that with its speed problem under control, concurrent improvements in security could well have been made. Not looking for perfect — just “acceptable”.
    Sounds like JavaScript has arriven!

Leave a Reply