Archive for October, 2009

Javascript is the new C

Friday, October 16th, 2009

I’ve become increasingly convinced that Javascript is following the path that C did a generation before.

C was the ubiquitous language of its time. It ran on every platform, although each platform had its own interpretation of things like integer size. It was a higher-level, more portable language than was commonly in use at the time. It was syntactically fairly simple, with a few key ideas that it used heavily, like macros and pointers. More than thirty years later, it’s still the interop language between different technical domains. Younger, higher-level languages offer the ability to write speedier code in C or to hook into other code written in C.

Javascript is the ubiquitous language of the Web. After a rocky start, it now runs on every Web browser, although some browsers interpret things differently and many users have configured their browsers differently.[1] It allows more interactivity than preceding technologies (server-side manipulation and DHTML). It’s syntactically quite simple, with a few key ideas that it uses heavily, like prototypes and first-class functions. It’s used extremely heavily. There are a large number of libraries built on it. Other technologies (like Silverlight) are starting to build out from it.

I think that C and Javascript are both going to be with us forever. I think that, just as C is increasingly the province of device drivers, compiler back-ends and heavily-optimized inner loops, Javascript is going to move into the background of Web programming, replaced by technologies we probably haven’t even met yet. However, despite their spiffiness, the new VirtualSmellX and 4DSpline Web languages will have Javascript modules at their core and will exchange data in JSON.

(Confidential to social historians of the 22nd century: you guys are going to have So Much Fun. “Rapid evolutionary change” doesn’t begin to cover it.)

[1] I once had to pay for a conference by hand-delivered check. My idiosyncratic NoScript settings had convinced the registration software that I didn’t have to pay, and no amount of twiddling on my part would convince it to allow me to pay.

Misuse of Arithmetic

Thursday, October 1st, 2009

Many people know about crazy fraction reduction: 16/64 is 1/4 by normal arithmetic, but if you cancel the 6s, you get 1/4 as well. Right answer, wrong method.

I was just introduced to the inverse of crazy fraction reduction. 32/24 = 4/3, but if you cancel the 2s, 32/24 = 3/4. For some reason, this is more alarming to me than standard crazy fraction reduction.