© Peter Hoddie and Lizzie Prader 2020
P. Hoddie, L. PraderIoT Development for ESP32 and ESP8266 with JavaScripthttps://doi.org/10.1007/978-1-4842-5070-9_11

11. Adding Native Code

Peter Hoddie1  and Lizzie Prader1
Menlo Park, CA, USA

There are times when JavaScript isn’t the best language to use to implement parts of your IoT product. Fortunately, you don’t need to choose either JavaScript or C (or C++) to build your product: you can choose both. XS in C is a low-level C API provided by the XS JavaScript engine so that you can integrate C code into your JavaScript projects (or JavaScript code into your C projects!).

Here are three common reasons for using use native code in your project:
  • Performance – High-level languages, including JavaScript, can’t ...

Get IoT Development for ESP32 and ESP8266 with JavaScript: A Practical Guide to XS and the Moddable SDK now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.