SlideShare a Scribd company logo
1Samsung Open Source Group
JerryScript on RIOT
An ultra-lightweight JavaScript engine for the Internet of Things
Tilmann Scheller
Principal Compiler Engineer
t.scheller@samsung.com
Samsung Open Source Group
Samsung Research UK
RIOT Summit 2016
Berlin, Germany, July 15 – 16, 2016
2Samsung Open Source Group
Overview
● Introduction
● JerryScript
● Memory consumption/Performance
● JerryScript on RIOT
● Demo
● Future work
● Summary
3Samsung Open Source Group
Introduction
4Samsung Open Source Group
What is JerryScript?
● A really lightweight JavaScript engine
● Has a base footprint of ~3KB of RAM
● Optimized for microcontrollers
● Developed from scratch by Samsung
● Actively developed on GitHub
● JerryScript is an open source project released under the
Apache License 2.0
5Samsung Open Source Group
Why JavaScript on microcontrollers?
● There's a huge pool of JavaScript developers
● Opens up the possibility for web developers to easily write
software for embedded devices
● Performance overhead of JavaScript less of an issue for
control tasks
● Increased productivity, shorter time to market
● Ability to load code dynamically over the network
● Security: Executing JavaScript code is safer than executing
arbitrary native code
6Samsung Open Source Group
JerryScript
7Samsung Open Source Group
JerryScript History
● Development started in June 2014
● Released as open source in June 2015
● JerryScript passed 100% of the test262 conformance test
suite in August 2015
● Rewritten compact byte code implementation landed in
January 2016
● Current focus on performance optimization
8Samsung Open Source Group
JerryScript
● Heavily optimized for a low memory footprint
● Interpreter-only
● Compact object representation
● Compressed pointers
● No AST, directly creating byte code
● Compact byte code heavily optimized for low memory
consumption
9Samsung Open Source Group
JerryScript Portability
● Extremely portable
● Self-contained
● Small C library
● Can run bare-metal
● Supports the STM32F4, ESP8266, Arduino 101, FRDM-
K64F boards
● OS support: NuttX, Zephyr, mbed, RIOT
● Runs on Linux/macOS as well
10Samsung Open Source Group
Target hardware
● STM32F4 developer board
● Cortex-M4F clocked at 168 MHz
● 192KB of RAM
● 1MB of flash memory
11Samsung Open Source Group
JerryScript
● Written in C99
● About 82KLOC
● Code size 156KB when compiled with GCC in LTO mode
for ARM Thumb-2
● Implements the entire ECMAScript 5.1 standard, passes
100% of the test262 conformance test suite
● C API for embedding JerryScript
● Byte code snapshot feature
12Samsung Open Source Group
Memory consumption/
Performance
13Samsung Open Source Group
SunSpider 1.0.2 - Memory consumption
3d-cube
3d-raytrace
access-binary-treesl
access-fannkuch
access-nbody
bitops-3bit-bits-in-byte
bitops-bits-in-byte
bitops-bitwise-and
bitops-nsieve-bits
controlflow-recursive
crypto-aes
crypto-md5
crypto-sha1
date-format-tofte
date-format-xparb
math-cordic
math-partial-sums
math-spectral-norm
string-base64
string-fasta
0 50 100 150 200 250 300 350 400
36
186
38
12
11
5
5
4
139
80
57
142
92
21
21
6
5
12
139
28
138
339
160
101
106
98
97
97
207
135
180
210
169
352
147
102
101
102
267
107
JerryScript
Duktape 1.5
Max RSS in KB (lower is better) Measured on a Raspberry Pi 2
14Samsung Open Source Group
SunSpider 1.0.2 - Performance
3d-cube
3d-raytrace
access-binary-trees
access-fannkuch
access-nbody
bitops-3bit-bits-in-byte
bitops-bits-in-byte
bitops-bitwise-and
bitops-nsieve-bits
controlflow-recursive
crypto-aes
crypto-md5
crypto-sha1
date-format-tofte
date-format-xparb
math-cordic
math-partial-sums
math-spectral-norm
string-base64
string-fasta
0 1 2 3 4 5 6 7 8
0.95
1.11
0.58
2.56
1.07
0.57
0.84
1.19
1.82
0.4
1.14
0.75
0.7
0.88
0.48
1.35
0.74
0.59
2.08
1.85
0.96
1.5
1.17
2.12
1.55
1.48
1.69
7.56
2.78
1.05
1.66
1.34
1.25
2.98
1.54
2.42
2.54
0.79
3.93
4.35
JerryScript
Duktape 1.5
Execution time in seconds (lower is better) Measured on a Raspberry Pi 2 (-Os -flto)
15Samsung Open Source Group
JerryScript on RIOT
16Samsung Open Source Group
JerryScript on RIOT
● Ported JerryScript over to RIOT
● Without any prior knowledge of RIOT the port took only a
couple of days to complete
● Running RIOT on the STM32F4 board
● Ran into issue #4488 which causes crashes when writing
to the serial console
● RIOT now officially supported as a target OS in upstream
JerryScript
17Samsung Open Source Group
Demo
18Samsung Open Source Group
Tetris Demo
● Implementation of the
classic Tetris game
● An LED matrix is used as
a display
● Written in JavaScript STM32F4 board
(192KB RAM, 1MB Flash)
Tetris
JerryScript
RIOT
LED Matrix
I2C
Switches via GPIO
19Samsung Open Source Group
Tetris Demo
20Samsung Open Source Group
Future work
21Samsung Open Source Group
Future work
● Further performance and memory optimizations
● 1.0 release of JerryScript in the coming weeks
● Debugging support
● Memory profiling
● Support for more boards
22Samsung Open Source Group
Summary
23Samsung Open Source Group
Summary
● Significantly lowers barrier of entry for JavaScript
development targeting heavily constrained embedded
devices
● Speeds up development
● Active community
● More information on http://samsung.github.io/jerryscript
● Looking for bug reports and feedback
Thank you.
24Samsung Open Source Group
25Samsung Open Source Group
Contact Information:
Tilmann Scheller
t.scheller@samsung.com
Samsung Open Source Group
Samsung Research UK

More Related Content

PDF
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
PDF
Introduction to Linux-wpan and Potential Collaboration
PDF
Introduction to IoT.JS
PDF
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
PDF
SOSCON 2016 JerryScript
PDF
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
PDF
Introduction to IoT.JS
PDF
Clang: More than just a C/C++ Compiler
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
Introduction to Linux-wpan and Potential Collaboration
Introduction to IoT.JS
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
SOSCON 2016 JerryScript
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
Introduction to IoT.JS
Clang: More than just a C/C++ Compiler

What's hot (20)

PDF
Development Boards for Tizen IoT
PDF
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
PDF
A Close Look at ARM Code Size
PDF
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
PDF
6LoWPAN: An Open IoT Networking Protocol
PDF
IoTivity for Automotive IoT Interoperability
PDF
Run Your Own 6LoWPAN Based IoT Network
PDF
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
PDF
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
PDF
Where is LLVM Being Used Today?
PDF
Framework for IoT Interoperability
PDF
webthing-floss-iot-20180607rzr
PDF
BKK16-105 HALs for LITE
PDF
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
PDF
Easy IoT with JavaScript
PDF
IoTivity: From Devices to the Cloud
PDF
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
PDF
George Grey Welcome Keynote - BUD17-100K1
PDF
BUD17-405: Building a reference IoT product with Zephyr
PDF
Media Resource Sharing Through the Media Controller API
Development Boards for Tizen IoT
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
A Close Look at ARM Code Size
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
6LoWPAN: An Open IoT Networking Protocol
IoTivity for Automotive IoT Interoperability
Run Your Own 6LoWPAN Based IoT Network
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Linux-wpan: IEEE 802.15.4 and 6LoWPAN in the Linux Kernel - BUD17-120
Where is LLVM Being Used Today?
Framework for IoT Interoperability
webthing-floss-iot-20180607rzr
BKK16-105 HALs for LITE
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
Easy IoT with JavaScript
IoTivity: From Devices to the Cloud
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
George Grey Welcome Keynote - BUD17-100K1
BUD17-405: Building a reference IoT product with Zephyr
Media Resource Sharing Through the Media Controller API
Ad

Similar to JerryScript on RIOT (20)

PDF
LMG Lightning Talks - SFO17-205
PDF
LAS16 100 K1 - Keynote George Grey
PDF
LAS16-100K1: Welcome Keynote
PDF
Linxu conj2016 96boards
PDF
NAB 2019 Latest Technical and Business Progress with AV1
PDF
BKK16-100K1 George Grey, Linaro CEO Opening Keynote
PDF
Js on-microcontrollers
PDF
IBM Runtimes Performance Observations with Apache Spark
PPTX
High Performance Scaling Techniques in Golang Using Go Assembly
PDF
Apache Spark Performance Observations
PDF
SFO15-100K1: Welcome Keynote: George Grey, Linaro CEO
PDF
LCU14 Keynote by George Grey
PPTX
[TGDF 2019] Mali GPU Architecture and Mobile Studio
PDF
LAS16-201: ART JIT in Android N
PPTX
Node.js Test
PDF
0xdroid osdc-2010-100426084937-phpapp02
ODP
Internet of Smaller Things
PDF
Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)
PDF
The move from a hardware centric design to a software centric design: GStream...
PDF
Multi-Processor computing with OpenMP
LMG Lightning Talks - SFO17-205
LAS16 100 K1 - Keynote George Grey
LAS16-100K1: Welcome Keynote
Linxu conj2016 96boards
NAB 2019 Latest Technical and Business Progress with AV1
BKK16-100K1 George Grey, Linaro CEO Opening Keynote
Js on-microcontrollers
IBM Runtimes Performance Observations with Apache Spark
High Performance Scaling Techniques in Golang Using Go Assembly
Apache Spark Performance Observations
SFO15-100K1: Welcome Keynote: George Grey, Linaro CEO
LCU14 Keynote by George Grey
[TGDF 2019] Mali GPU Architecture and Mobile Studio
LAS16-201: ART JIT in Android N
Node.js Test
0xdroid osdc-2010-100426084937-phpapp02
Internet of Smaller Things
Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)
The move from a hardware centric design to a software centric design: GStream...
Multi-Processor computing with OpenMP
Ad

More from Samsung Open Source Group (13)

PDF
The Complex IoT Equation (and FLOSS solutions)
PDF
Spawny: A New Approach to Logins
PDF
Rapid SPi Device Driver Development over USB
PDF
IoTivity: Smart Home to Automotive and Beyond
PDF
IoTivity for Automotive: meta-ocf-automotive tutorial
PDF
GENIVI + OCF Cooperation
PDF
Open Source Metrics to Inform Corporate Strategy
PDF
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
PDF
Toward "OCF Automotive" profile
PDF
OIC AGL Collaboration
PDF
Tizen Connected with IoTivity
PDF
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
PDF
IoTivity on Tizen: How to
The Complex IoT Equation (and FLOSS solutions)
Spawny: A New Approach to Logins
Rapid SPi Device Driver Development over USB
IoTivity: Smart Home to Automotive and Beyond
IoTivity for Automotive: meta-ocf-automotive tutorial
GENIVI + OCF Cooperation
Open Source Metrics to Inform Corporate Strategy
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
Toward "OCF Automotive" profile
OIC AGL Collaboration
Tizen Connected with IoTivity
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
IoTivity on Tizen: How to

Recently uploaded (20)

PPT
Introduction Database Management System for Course Database
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
history of c programming in notes for students .pptx
PPTX
Transform Your Business with a Software ERP System
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
top salesforce developer skills in 2025.pdf
PDF
System and Network Administration Chapter 2
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPT
JAVA ppt tutorial basics to learn java programming
DOCX
The Five Best AI Cover Tools in 2025.docx
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Materi-Enum-and-Record-Data-Type (1).pptx
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
AI in Product Development-omnex systems
Introduction Database Management System for Course Database
Odoo POS Development Services by CandidRoot Solutions
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
history of c programming in notes for students .pptx
Transform Your Business with a Software ERP System
Design an Analysis of Algorithms I-SECS-1021-03
top salesforce developer skills in 2025.pdf
System and Network Administration Chapter 2
Softaken Excel to vCard Converter Software.pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
JAVA ppt tutorial basics to learn java programming
The Five Best AI Cover Tools in 2025.docx
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Upgrade and Innovation Strategies for SAP ERP Customers
Materi-Enum-and-Record-Data-Type (1).pptx
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
AI in Product Development-omnex systems

JerryScript on RIOT

  • 1. 1Samsung Open Source Group JerryScript on RIOT An ultra-lightweight JavaScript engine for the Internet of Things Tilmann Scheller Principal Compiler Engineer t.scheller@samsung.com Samsung Open Source Group Samsung Research UK RIOT Summit 2016 Berlin, Germany, July 15 – 16, 2016
  • 2. 2Samsung Open Source Group Overview ● Introduction ● JerryScript ● Memory consumption/Performance ● JerryScript on RIOT ● Demo ● Future work ● Summary
  • 3. 3Samsung Open Source Group Introduction
  • 4. 4Samsung Open Source Group What is JerryScript? ● A really lightweight JavaScript engine ● Has a base footprint of ~3KB of RAM ● Optimized for microcontrollers ● Developed from scratch by Samsung ● Actively developed on GitHub ● JerryScript is an open source project released under the Apache License 2.0
  • 5. 5Samsung Open Source Group Why JavaScript on microcontrollers? ● There's a huge pool of JavaScript developers ● Opens up the possibility for web developers to easily write software for embedded devices ● Performance overhead of JavaScript less of an issue for control tasks ● Increased productivity, shorter time to market ● Ability to load code dynamically over the network ● Security: Executing JavaScript code is safer than executing arbitrary native code
  • 6. 6Samsung Open Source Group JerryScript
  • 7. 7Samsung Open Source Group JerryScript History ● Development started in June 2014 ● Released as open source in June 2015 ● JerryScript passed 100% of the test262 conformance test suite in August 2015 ● Rewritten compact byte code implementation landed in January 2016 ● Current focus on performance optimization
  • 8. 8Samsung Open Source Group JerryScript ● Heavily optimized for a low memory footprint ● Interpreter-only ● Compact object representation ● Compressed pointers ● No AST, directly creating byte code ● Compact byte code heavily optimized for low memory consumption
  • 9. 9Samsung Open Source Group JerryScript Portability ● Extremely portable ● Self-contained ● Small C library ● Can run bare-metal ● Supports the STM32F4, ESP8266, Arduino 101, FRDM- K64F boards ● OS support: NuttX, Zephyr, mbed, RIOT ● Runs on Linux/macOS as well
  • 10. 10Samsung Open Source Group Target hardware ● STM32F4 developer board ● Cortex-M4F clocked at 168 MHz ● 192KB of RAM ● 1MB of flash memory
  • 11. 11Samsung Open Source Group JerryScript ● Written in C99 ● About 82KLOC ● Code size 156KB when compiled with GCC in LTO mode for ARM Thumb-2 ● Implements the entire ECMAScript 5.1 standard, passes 100% of the test262 conformance test suite ● C API for embedding JerryScript ● Byte code snapshot feature
  • 12. 12Samsung Open Source Group Memory consumption/ Performance
  • 13. 13Samsung Open Source Group SunSpider 1.0.2 - Memory consumption 3d-cube 3d-raytrace access-binary-treesl access-fannkuch access-nbody bitops-3bit-bits-in-byte bitops-bits-in-byte bitops-bitwise-and bitops-nsieve-bits controlflow-recursive crypto-aes crypto-md5 crypto-sha1 date-format-tofte date-format-xparb math-cordic math-partial-sums math-spectral-norm string-base64 string-fasta 0 50 100 150 200 250 300 350 400 36 186 38 12 11 5 5 4 139 80 57 142 92 21 21 6 5 12 139 28 138 339 160 101 106 98 97 97 207 135 180 210 169 352 147 102 101 102 267 107 JerryScript Duktape 1.5 Max RSS in KB (lower is better) Measured on a Raspberry Pi 2
  • 14. 14Samsung Open Source Group SunSpider 1.0.2 - Performance 3d-cube 3d-raytrace access-binary-trees access-fannkuch access-nbody bitops-3bit-bits-in-byte bitops-bits-in-byte bitops-bitwise-and bitops-nsieve-bits controlflow-recursive crypto-aes crypto-md5 crypto-sha1 date-format-tofte date-format-xparb math-cordic math-partial-sums math-spectral-norm string-base64 string-fasta 0 1 2 3 4 5 6 7 8 0.95 1.11 0.58 2.56 1.07 0.57 0.84 1.19 1.82 0.4 1.14 0.75 0.7 0.88 0.48 1.35 0.74 0.59 2.08 1.85 0.96 1.5 1.17 2.12 1.55 1.48 1.69 7.56 2.78 1.05 1.66 1.34 1.25 2.98 1.54 2.42 2.54 0.79 3.93 4.35 JerryScript Duktape 1.5 Execution time in seconds (lower is better) Measured on a Raspberry Pi 2 (-Os -flto)
  • 15. 15Samsung Open Source Group JerryScript on RIOT
  • 16. 16Samsung Open Source Group JerryScript on RIOT ● Ported JerryScript over to RIOT ● Without any prior knowledge of RIOT the port took only a couple of days to complete ● Running RIOT on the STM32F4 board ● Ran into issue #4488 which causes crashes when writing to the serial console ● RIOT now officially supported as a target OS in upstream JerryScript
  • 17. 17Samsung Open Source Group Demo
  • 18. 18Samsung Open Source Group Tetris Demo ● Implementation of the classic Tetris game ● An LED matrix is used as a display ● Written in JavaScript STM32F4 board (192KB RAM, 1MB Flash) Tetris JerryScript RIOT LED Matrix I2C Switches via GPIO
  • 19. 19Samsung Open Source Group Tetris Demo
  • 20. 20Samsung Open Source Group Future work
  • 21. 21Samsung Open Source Group Future work ● Further performance and memory optimizations ● 1.0 release of JerryScript in the coming weeks ● Debugging support ● Memory profiling ● Support for more boards
  • 22. 22Samsung Open Source Group Summary
  • 23. 23Samsung Open Source Group Summary ● Significantly lowers barrier of entry for JavaScript development targeting heavily constrained embedded devices ● Speeds up development ● Active community ● More information on http://samsung.github.io/jerryscript ● Looking for bug reports and feedback
  • 25. 25Samsung Open Source Group Contact Information: Tilmann Scheller t.scheller@samsung.com Samsung Open Source Group Samsung Research UK