Culture / Programming Languages

The Year Ahead: Node.js and all the Internet Things

30 Dec 2015 2:55am, by

This week at The New Stack, in a series called “The Year Ahead,” we will examine a few technologies and technology issues that we predict will be important for our readers in 2016. Stateless computing is one area we plan to cover closely in 2016.

The year 2015 was an extremely good one for the Node.js server-side JavaScript run-time. The open source technology has gotten some formal governance, reunited with a forked version of itself, and continued to work its way into both the enterprise and  Web-scale companies, even as the supportive tooling is still being built and released.

Node.js originally got its foothold for web applications and is quickly becoming an alternative for at least some enterprise jobs that would have previous been executed on .Net or Enterprise Java. But at the Node Interactive conference in Portland earlier this month, we discovered developers putting Node to work on another job: Building applications for the emerging Internet of Things (IoT).

You’re probably familiar with IoT, and perhaps are even tired of the phrase. But, with the falling costs of processors and ubiquitous Internet, IoT will be all but inevitable.  Analyst firm IDC has predicted that the world will spend $1.7 trillion on all the Internet things by 2020.

At Node Interactive, Andrew Chalkley, a teacher at the Treehouse online education site, talked about how Node could already be used on many low-powered hobbyist devices. These home projects will be the prototypes of IoT devices that will be industrialized and commercialized in the years to come:

Node and the programming language Node uses, JavaScript, could interactive with IoT devices in a number of ways, Chalkley explained. Some highly-responsive  but tiny microcontrollers, such as an Espruino or a Tessel, are able to run JavaScript directly, usually through stripped-down JavaScript engines.

Then there are the embedded devices, which are pretty much like full Linux servers, and can offer complete support for running Node. Here, we are talking about the Tessel 2, the Raspberry Pi. “You can install anything on them, including full Node,” Chalkley said. They are, in essence, actual “Internet things.”

For those who have been around for awhile, IoT sounds suspiciously like what used to be called embedded computing, with, perhaps, some additional the additional back-end data crunching for operational inefficiencies and customer insights. Due to the initial processing and memory constraints of these microcontrollers, embedded developers tended to favor low-level, close-to-the-metal languages such as C.

JavaScript and Node, however, may offer a number of advantages for the IoT hacker, not the least of which being popularity among the cool kids. “Node has a tremendous amount of momentum in the ecosystem,” said Melissa Evers-Hood, who is Intel’s director of Chrome OS Engineering.

It’s all about people. In its research, Intel had found  that over half of all Android apps, for instance, use JavaScript in some form. So there are a lot of JavaScript developers, along with a lot of reusable code. “You can easily expand this into new areas,” Evers-Hood said.

And many more junior JavaScript coders coming online, thanks to Codecademy, Hour of Code and countless other efforts in promoting computer programming literacy. Over the next decade, we will experience a “tidal wave of people who will literally grow up on JavaScript,” Evers-Hood said.

Node and Javascript top a survey of Stack Overflow developers' planned languages toi adopt (Research: TNS/Lawrence Hecht).

Node and Javascript top a survey of Stack Overflow developers’ planned languages to adopt (Research: TNS/Lawrence Hecht).

“These young adults are coming into the market, they will innovate and create new use models, and new applications. They be will coming in right an interesting point in regards to IoT,” Evers-Hood said.

Ryan Dahl created Node.js, itself written in C, to solve the issue of I/O blocking in Web applications, releasing the software in 2009. I/O blocking happens when a web page requests something from a database or disk, causing all subsequent operations to halt, at least momentarily, until a response arrives. Node.js uses a single event-loop thread to handle multiple chores. Instead of waiting for a response, Node can assign a callback to each function, so the event loop can continue on to the next task and loop back around to the function response when it does arrive. As a result, it is fast, and can scale.

Walmart's Jason Pincin, celebrating 500 million page views, served up by Node.js, on Black Friday 2014

The moment Node.JS became a serious contender in the enterprise: Walmart’s Jason Pincin, celebrating 500 million page views, all served up by Node.js, on Black Friday 2014

As a Web technology,  Node also offers a consistent set of APIs, which will be helpful in addressing the wide range of platforms IoT will run on.

“You get a consistency in the ability to deploy,” Evers-Hood said. “Core development assets can be readily transferable across platforms, to development platforms, because those APIs are consistent across the OS, you have a lot more flexible in regards to the code you develop.”

But what about JavaScript itself? Created in 10 days by Brendan Eich for Netscape Communications, JavaScript has been seen, especially by the graybeards, as somewhat of a kludge. Despite these humble origins, JavaScript, or, at least, parts of it, are “brilliant,” programmer Douglas Crockford has said in one of a number of talks he gives about the expressive power of the language.

“The features that were selected and the how they were put together are astonishingly good,” Crockford said. “It’s a language of amazing expressive power.”

Who would have guessed that JavaScript, of all languages, would be running in your refrigerator by 2016?

Intel is a sponsor of The New Stack.

Feature Image: “Archbishop Gauthier Cornut of Sens Displaying the Crown of Thorns,” 13th century stained glass art at the Cloisters museum in New York City.


A digest of the week’s most important stories & analyses.

View / Add Comments

Please stay on topic and be respectful of others. Review our Terms of Use.