Nikkei Electronics Asia -- January 2009
Cover Story - Vision
Google Goes Embedded with JavaScript [Part 1]

E-Mail Article
Tweet This
Digg This
Share this with friends on Facebook
Buzz Up!
Jan 5, 2009 19:10 Nikkei Electronics Asia

Continued from The Google Machine Unveiled!

Google is aggressively entering the embedded systems market through JavaScript. It is possible, though, that the firm has a blind spot when it comes to the differences between what the Internet wants and what the embedded systems industry needs.

It looks like the diversity of services publicly available on the Internet will become indispensable in the development of multi-function embedded systems at low cost. The software in these systems will be implemented as Web applications running through a Web browser. The advantage of Web applications is that they only need a Web browser and a network to operate; there is no need to incorporate the application into the equipment in advance. If a new function is added to the application, or a bug fixed, the application only has to be updated at the server. In the information technology (IT) field, systems are steadily being "Webified" into Web-based implementations, as evidenced by the major growth of Salesforce.com of the US, which provides Web-based customer management applications. The trend will come to embedded systems eventually, too. 

The language these Web application programs are written in is JavaScript. Alan Eustace, senior vice president, Engineering at Google, said, "Equipment in the cloud computing* era will have to be able to execute JavaScript."
The native applications used in traditional embedded systems use interpreters executing machine language (Fig 1).

* Cloud computing: A system configuration that distributes processing loads among the countless "cloud" of computers on the Internet. 

Machine language is the most fundamental language, and execution speed depends on the processor. Web applications, on the other hand, use JavaScript engines to execute JavaScript code. JavaScript is the fundamental language, equivalent to machine language. Web application execution speed is dependent on both the processor and the performance of the JavaScript engine (Note 1).

Note 1: Actual execution speed of Web applications depends on JavaScript execution speed, network speed, Web page display speed and other factors. 

JavaScript Applications

What sort of applications can be made with JavaScript? One example is a car navigation application running on a PC. Google now offers a public demonstration of its Driving Simulator (Fig 2, Note 2), written in JavaScript, on its Website.

Note 2: http://earth-api-samples.googlecode.com/svn/trunk/demos/drive-simulator/index.html

The Google Maps API was formerly only a JavaScript API, but recently support for universal resource locators (URL) through Google Static Maps API, and calls from Flash through Google Maps API for Flash, have been added.

When the user specifies two map locations, an animated car drives along roadways connecting them. This application used in conjunction with a global positioning satellite (GPS) position sensing system could be used to easily implement the sophisticated functions of car navigation systems. 

The sample shown in Fig 2 uses the Google Earth Application Programming Interface (API) for three-dimensional (3D) map display, and the Google Maps API for 2D maps. An API is simply a method of accessing the service, allowing the application to use it. APIs exposed on the Internet are called from JavaScript code, making it possible to add high-level functionality very easily. 

Google now makes at least 50 types of API available to software developers, including APIs defining data formats.

Many of the APIs usable by programming languages do not support JavaScript (Table 1), but a few such as the Google Maps API and the Google Earth API have been written almost entirely for use from JavaScript (Note 3). 

Note 3: The Google Maps API was formerly only a JavaScript API, but recently support for universal resource locators (URL) through Google Static Maps API, and calls from Flash through Google Maps API for Flash, have been added.

Another key part of the machine provided by Google is Gears (Note 4), a framework that makes it possible to cache Web applications in client systems so that they can be used even when offline (not connected to the Internet). If the JavaScript engine is the main engine for Web applications, then Gears is an auxiliary engine.

Note 4: Formerly called Google Gears, it was renamed a more generic Gears in May 2008 to signify that it was not for the exclusive use of Google alone.

To be continued