JavaScript is the next C
I’ve been coding in JavaScript for almost a year now. I find it a decent language to write code in. The code written in JavaScript doesn’t look as pretty as python, but it doesn’t look as bloated as Java either. But that’s not why I chose the title of this post. It’s everything else that’s happening around JavaScript that makes me think that it’s going to play as significant a role in computing as C has played.
Before C, there was assembly. (I know there were many other languages before programming evolved from assembly to C, but I am talking about only the mainstream candidates.) The abstraction that C provided was perfect enough that programmers didn’t have to learn about the Assembly details. That made C the perfect candidate to build a solid layer on top of Assembly. Programmers could write accounting software, graphic programs, games without bothering about what CPU architecture and memory bus size they were running on. It all worked and C became an integral part of computing stack. Today we don’t use C to write new programs, but all operating systems, their device drivers, native libraries are written in C. C has become so ubiquitous that it’s now invisible.
We have spent a long time searching for a candidate language to build the next layer, on top of the one built by C. C made our code hardware-agnostic. But over time we developed a variety of operating system platforms that created their own stacks of libraries. With the advent of Internet we needed to transfer code over the wire and be sure that it can be run on all the machines irrespective of which platform they were running. We needed a write-once-run-everywhere solution. Java emerged as the solution to specifically fill that need. For a period of time, it seemed it would indeed be the one. But for several reasons it failed. Today when we are deciding a platform independent solution to write a GUI program, what number does Swing score in our preferred list? Java did a great job of freeing the programmers from worries of memory management. But the main reason for its failure is probably its awkward ownership by a single commercial entity Sun (and now Oracle). The lawsuit Google is facing over Android is enough to corroborate this. If someone can sue you for using their language, then how can such language be adopted by entire industry.
The latest candidate to build the next abstraction layer in the computing stack is JavaScript. It’s hardly a new language. It’s hardly a perfect language. But there are two technologies that will make JavaScript the next C - HTML5 and Node.js.
HTML5 (and whatever goes under that umbrella name) is a new web framework whose primary programming language is JavaScript. It is bound to succeed, in fact if you consider it as just a new fancy name for HTML then it has already succeeded. It’s not developed by a single company, but many big guns are simultaneously promoting it - Google, Mozilla, Apple, Microsoft (by accepting most of the standard for IE9), are writing virtual machines that keep improving the speed of JavaScript. The new age behemoths - Twitter and Facebook - have strengthened HTML5 merely by adopting it.
On the other hand, Node.js has become a great success. It has a teeming community around it. The success of a platform depends on the libraries its provides to do various tasks. Just look at this wiki page that lists different Node.js modules to accomplish various tasks. I spent last week writing a factory server for 3DTin using Node.js. Everything I needed - from binary encoding library to canvas rendering libraries - I got it from this page. And there are more than one option for each job. Most of the libraries are nascent and will mature over coming few months. But they are a strong sign of a solid platform taking shape.
Yet another sign of JavaScript’s growing might is, its choice as a target language for compilers of other languages. There are projects compiling Ruby, Python, Java right into JavaScript. The shortcomings of JavaScript as a language are being fixed by many frameworks successfully, think of jQuery. Libraries like Underscore.js or projects like CoffeeScript are making programming in JavaScript more fun.
Between HTML5 and Node.js you can now be sure that if you write your next application in JavaScript it will run on any server, desktop or mobile. JavaScript will build that next layer in computing stack that we are waiting for and that’s why it will be the next C - ubiquitous and then invisible.
Archive
2019
Dimensions of Idea communication
2018
Lessons for Game designers from "Structure of Scientific Revolutions"
Playing games, Doing Mathematics
Why gamers like pixelated games
2017
Collecting Vs Hoarding Netflix
Game Design tip for Programmers - Less Automation
Review Ghost In The Shell - The blinds scene
Why Electron is the best development platform?
2016
2015
Before fixing performance issues
2014
2013
Software Engineering Code of Ethics and Professional Practice
2012
Coffeescript: To switch or not to switch
The single most reason that keeps me using Vim
When your git branch diverges from your remote
Something like Olivia - John Mayer
Online courses - New technology, Old rules
Why Patriotism doesn't make sense
Why sea steading is important to pursue?
Rolling back latest git commit
iTunes Download stopped (err =9006)
Good essay on user centric software design
Why we need to explore Seasteading?
2011
How to write interactive CLI utility in node.js
The Gods Themselves by Isaac Asimov
How to print stack trace anywhere in Javascript
It's not fair to compare Android with Internet Explorer
How to debug WebWorker threads?
Why can't I criticize Government if I don't vote? I sure can.
Why the hi-tech minds are writing Social apps?
Ever growing todo list is a good sign for creative projects
Lesser women in tech... So what?
HTML5 offline cache - use swapCache carefully
How Wikipedia and Flattr can together change the World
2010
Functional programming in Javascipt using Underscore.js
Youtube ETA - Chrome extension
Why secure airports when it's planes that fly?
Mac book red light audio jack problem on Linux
How to save HTML5 canvas image to Google App Engine
Why don't they publish eBooks for free but with embedded ads?
Reality distortion field around
ReaderScope 2.0.6 - Find Comments
Why "Open" is not the first concern of user?
Mutt, Gmail, gdata, notify-send: A Perfect Email solution
Are you the Matt Damon of your game?
ReaderScope 1.8.{2,3} - new authentication and global share
Portable apps for iPhone, Android, Pre, n900 - Can Processing.js help?
ReaderScope 1.8.1 - rethinking features
Android fragmentation : How big a deal is it?
ReaderScope v1.7 - Widget, new Icons and .... Ads
on Git: tips for SVN users and Git in Dropbox cloud
How to do an online IDE for Android app development
Make Android speak your Twits with "TwitSpeak"
2009
ReaderScope 1.5 - quicker, better, prettier
Preview android.R.drawable.* images
Is definition of "Evil" changing?
ReaderScope 1.4 (with a Theme Pack)
The AND-OR problem of laptop and mobile phone
ReaderScope v1.3.3 - offline podcasts
ReaderScope v1.3.2 - Social Channels
ReaderScope v1.3 - Beyond Google Reader
Frets on Fire for Maemo - Update
ReaderScope 1.2.7 - Podcasts, Expanded View
Sprint HTC Hero problems with ReaderScope
ReaderScope 1.2.1 - Auto Login
ReaderScope 1.1.3 - SDCard storage
ReaderScope 1.1.1 quick-n-easy features
ReaderScope 1.1 - Social Beacons
ReaderScope 1.0.2 - making deep cache simple
ReaderScope beta4 - offline fun
ReaderScope beta3 - Tweet the news
Intercepting Up/Down keys from bash script
Makeshift XML beautifier in python
HTC Magic (Indian version) - expectations and facts
Android development with Vim + Eclim
FoF - PyOpenGL = miniFoF (possibly for n810)
Twitter client with inkface-pygame v0.2.2
Frets on Fire on Maemo 5 (Fremantle)
Static IP configuration on Fedora 10
Smooth scrolling with Inkface+pygame
Inkface v0.2 update and automated GUI testing
Testing Android (Koolu Beta 3) on Openmoko Freerunner
Clutter animation paths with Inkscape+Inkface (v0.1.3)
Debian repository on Google App Engine
Inkface v0.1.2, Twitter-inkface client
2008
Debugging python reference counts
(k)ubuntu 8.10 - not ready for my home yet
Migrating to Google App Engine
Android opened - first looks inside
Inkface - SVG based GUI design
Today's slashdot and open source
OpenMoko, Android and a great hacking post
2007
XML RPC server inside apache mod_python
Nice review article on virtualization technologies
Once again... a quote from 'Troy'
Sea surfing under the Golden Gate
2006
How do I backup to Amazon S3 storage service
Gas prices... seems like big scam
If Harry Potter were a computer hacker ...
2005
repeat (ps | grep) = filtered top
Halo fixed on ATI Mobility Radeon 9000
Warning: const is a keyword in ANSI C
2004