JavaScript spread to the edges and became permanent in the process

Node.js expert James Duncan on JavaScript's rise and what lies ahead.

At some point, when nobody was looking, JavaScript evolved from humble
beginnings to become an important and full-fledged development
language.

James Duncan (@jamesaduncan), the chief architect at Joyent, is one of
the people who’s now putting JavaScript in unexpected places. In his
case, it’s using JavaScript as a web server development language
through the Node.js platform.

In the following interview, Duncan shares his thoughts on
JavaScript’s growth and how we came to depend so heavily on the
language.

For a lot of us who have been in the industry for a while,
JavaScript has always seemed like a toy language. When did that
change?

James Duncan: The big change started when Google
launched Maps
. All of a sudden, there was this highly-interactive,
highly-usable, fun-to-play with web interface. It just blew away
almost every other map provider’s offering, and it was all constructed
in JavaScript. Everyone sat up and took notice.

What’s happening now is that JavaScript is installed on
millions and millions of edges of our network. If you think of every
web-accessing device as an edge on the network, then JavaScript is in
all of them. Every web browser has it, every smartphone has it.

In the same way that C has become permanent at the systems level,
with JavaScript, what you’ve got is a situation where it’s on so many
edges of the network, it really can never be eliminated. For better or
worse, JavaScript be there in 15 years.

Save 50% – JavaScript Ebooks and Videos

JavaScript is everywhere: servers, rich web client libraries, HTML5, databases, even JavaScript-based languages. If you’ve avoided JavaScript, this is the year to learn it. And if you don’t, you risk being left behind. Whatever your level, we have you covered:

Introductory  /  Intermediate  /  Advanced

One week only—offer expires 14 June. Use discount code HALFD in the shopping cart. Buy now and SAVE.

There is still a lingering perception that JavaScript isn’t a
first-class programming language, though. Some vendors that use it for
scripting in their products pitch it as an easier language to
use.

James Duncan: I’ve long called the JavaScript
programming community the “dark development team in the sky” because
JavaScript requires a skill set that no one admits to having, but
everyone actually has. I can use this same positioning to explain why
it’s important: You walk into an enterprise and say, “Why are you
doing all of this high-ceremony .NET/Objective C-style development?
It’s just not necessary.” Because you can just do it in JavaScript,
you already have the skills. That makes it an easier sell.

I don’t think JavaScript is any less capable than any other language,
per se. It’s just that what goes into that JavaScript stack is very
much defined by what it’s embedded into. Because it originates in the
browser, we think of it as being easy and unsophisticated, but if you
dive down, it absolutely is sophisticated, capable and powerful. It’s
just that our mindset — and certainly the corporate mindset
— has been that JavaScript is only used for making pop-ups in web
pages.

In terms of the browser, some of us remember the nightmares of cross-browser JavaScript compatibility issues. Are they still around? And is HTML5 going to be
the next iteration of the same problems?

James Duncan: You’re right, the browser
environment is a nightmare. That’s becoming less true just because of
the nature of libraries like JQuery
and Prototype. Those
libraries have improved circumstances so that, for the most part, if
someone’s writing code in JQuery and really sticking to JQuery,
they’re probably not going to have many problems anymore. Or if they
do run into issues, they’re either impossible to fix because something
is fundamentally broken or the fix is trivial. There doesn’t seem to
be much in between.

HTML5 is fascinating. If you look at things like WebSocket and the
Web Worker specs, they seem to be implemented pretty uniformly from
browser to browser. So I think it’s getting better. The browser
vendors have learned their lesson: Trying to fight the standard isn’t
sensible. Even Microsoft with IE has gotten much better with this
— they’ve got a long way to go, but they’re much better than
they were.

We’re currently seeing somewhat of an arms race regarding
JavaScript execution speed. Is there an end in sight?

James Duncan: The cool thing is that we’re just at
the tip of the iceberg. There’s no doubt we’re going to see huge
performance improvements, which we’ve already seen in part over the
last year. It’s going to plateau eventually, but I think there is still
room for it to get faster and faster. We’ve had decades of compiler
research going into making the fastest or most optimizing C compiler possible.
That sort of research spend has not happened for dynamic languages in
non-academic environments before, with the possible
exception of Smalltalk, but it’s happening now around JavaScript. So you’re
still going to see performance improvements.

A hot topic in computing is parallel programming in languages such
as Erlang. Is JavaScript going to
join the party?

James Duncan: Node, in some ways, has a similar
view: it’s all asynchronous-based programming, all asynchronous IOs.
Where it steps away from what Erlang is doing is that it explicitly
says, “You shall run as one process.” You get one CPU to play with.
What we’re going to see inside the Node space is some capability to
have messaging between CPU cores and, therefore, Node processes
running on different CPU cores. I don’t know if anyone’s going to go
to the same extreme as Erlang, but some of the things Node is doing are
similar.

What would you like to see changed in JavaScript?

James Duncan: For me, the two points are: One,
don’t break the web, and two, it would be great to see some sort of
concrete class system. That’s not to say I dislike the prototype-based
object orientation within JavaScript, but I think a lot of people get
confused by its capabilities. Rather than understanding it as sort of
a liberating thing, they see it as a limiting thing. Putting some
syntactic sugar around classes would go a long way toward easing
people into the language from other sources.

This interview was edited and condensed.

Associated photo on home and category pages: Node Globe Pics by Dan Zen, on Flickr


Learn about Node.js this July at the O’Reilly Open Source Convention in Portland, Oregon. For a comprehensive orientation to Node, attend Monday’s Node tutorials and then join us all day Tuesday at Node Day for total immersion in the people and technologies making up the Node ecosystem. Save 20% on registration with the code OS11RAD

Related:

tags: , , ,
  • tete

    Who cares about this stuff, when JavaScript/ECMAScript hasn’t even a sane split function. And when will ECMAScript receive for each?

    Why hype new stuff when the foundation isn’t nice by now?

    The only real reason for JavaScript being so popular is that web developers have to learn it.

    However, I do admit JavaScript has a lot of potential. Just start on the bottom or you’ll at some point have to break everything or live with annoying stuff.

    I think OO is fine. If you want more there is Joose: http://code.google.com/p/joose-js/ … and other libraries. That way you don’t have to care about making everyone happy.

    Deliver a good foundation and the community will take care about the rest.

  • pooty

    While the comment from tete shows off the level of ignorance still pervasive in the IT world about the power and strength of JavaScript, it is a hurdle that many companies, and individuals, still have to overcome through education.

    Tools such as Node, Appcelerator, ExtJS and others are going to critical in showing that, possibly, 50% of what people are wasting their time and money on writing in PHP, ASP.NET, C#, and other clunky languages just aren’t necessary.

  • WayneB

    What a bunch of hogwash.

    Google also released a desktop version of Google Maps called Google Earth around the same time. Of course Google Earth was much, MUCH better than the Javascript version and still is.

    Javascript has been around for a while now, but great Javascript language tools are rare, there are no standards, no standard library and the language spec is an absolute mess obviously designed by committee and there is a questionable roadmap.

    For the time being, I would use node.JS as the full-duplex middle-man between my enterprise services and the browser and that’s about it. Just glue. Same for javascript. Use it when you have to, but don’t use too much glue or it will make a mess.

    In my opinion, browsers are holding back the entire software industry. We need browsers to make a distinction between “app” and “document” and we need them to provide a better application runtime environment including a bytecode standard instead of just javascript. That way we wouldn’t have a generation of Javascript programmers who want to use it everywhere because they have so much time invested in the language.