Home > Broadcom BCMxxxx, Intel Quark, Linux, STMicro STM32, Texas Instruments Sitara > Samsung JerryScript is a Lightweight Open Source JavaScript Engine for the Internet of Things

Samsung JerryScript is a Lightweight Open Source JavaScript Engine for the Internet of Things

In the old days, micro-controller programming was all done in assembly or C, but in recent years higher level languages, included interpreted ones such as Python and JavaScript, have made their ways into MCUs with projects such as MicroPython or Espruino (JS) often running on STMicro STM32 ARM Cortex M micro-controllers, but also other platforms such as ESP8266.

JerryScriptAs I browsed through the Embedded Linux Conference Europe 2016 schedule, I discovered that Samsung worked on it own implementation of a JavaScript engine for the Internet of Things: JerryScript. It is a full implementation of ECMAScript 5.1 standard written in C that can run on micro-controllers with less than 64KB RAM, and less than 200KB storage (160KB footprint with ARM Thumb-2 compilation).

JerryScript is comprised of two main components: Parser and Virtual Machine (VM), with the parser performing translation of input ECMAScript application into byte-code than is then executed by the Virtual Machine that performs interpretation.

 

JerryScript High Level Design

JerryScript High Level Design

Although JerryScript is designed for MCUs, and is said to be running on hundreds of thousands of smartwatches, you can easily build it and try in any machine running Linux:


You can also compile the code for full, compact or minimal implementation, use the C Api to integrate JavaScript support into your program, etc… Many more details can be found on JerryScript website and Github repository. JerryScript is also used in IoT.js framework for the Internet of Things that currently runs on Linux and NuttX RTOS platforms, as well as STM32F4-Discovery + “BB” (Beaglebone Black?) and Raspberry Pi 2, and will soon be ported to Samsung Artik 1 (MIPS), STM32F429-Discovery, STM32F411-Nucleo, and Intel Edison boards.

 

  1. TLS
    August 2nd, 2016 at 18:33 | #1

    64KB RAM… so it’ll still not run on most current low cost MCU’s then…

  2. August 2nd, 2016 at 20:50 | #2

    I made a package of Jerryscript for openwrt a while ago, but at the end I dropped javascript for shell 🙂

    Also, the paid Samsung team who is working on it makes it a pain to contribute patches.

  3. Deets
    August 3rd, 2016 at 05:04 | #3

    Mediatek has also adopted it for microlattice.js

  4. August 3rd, 2016 at 15:07 | #4

    Let me guess the lead dev is called Jerry?

  5. JotaMG
    August 3rd, 2016 at 16:37 | #5

    JM :
    Let me guess the lead dev is called Jerry?

    Hope it’s not Seinfeld… 😉

  6. AkosTheKiss
    August 9th, 2016 at 19:24 | #6

    @zoobab: Let’s be fair: https://github.com/Samsung/jerryscript/pulls?q=is%3Apr+author%3Azoobab+is%3Aclosed This was only one PR, which was answered the same day, but abandoned after issues were pointed out.

    @JM: Nope 🙂

  1. No trackbacks yet.