FAQ

What is Moddable?

We are a software company based in Palo Alto, CA.

Our name, Moddable, is our goal for the digital devices in our lives. The root of Moddable is "mod", a shorthand for "modify" or "modification." Most IoT products on the market today are black boxes that allow for little to no customization and are often tied to a specific cloud service. We believe that IoT products should be open to give consumers the freedom to modify them.

To achieve this goal we created The Moddable SDK, a collection of tools for building open IoT products using standard JavaScript on low-cost microcontrollers, including:

All of these tools are available in our repository on GitHub. An easy way to get started with our platform is to run our many example apps on a Moddable Zero.

Why JavaScript?

We want to augment traditional embedded programming with a more flexible, nimble, and open approach. JavaScript is an excellent tool to build apps for IoT devices for many reasons:

What is XS?

XS is our JavaScript engine. Unlike the engines used in browsers, XS is designed to run on microcontrollers. Microcontrollers are highly constrained devices compared to modern computers and mobile devices, so XS focuses on minimizing size, rather than speed.

Despite its compact size, XS implements the 2018 JavaScript language standard with better than 99% conformance. This support is native to XS, using no transpilers or polyfills.

You can read more about the evolution, design, and implementation of the XS engine in this article. Note that some of the "to do's" in the Future section of that article have already been done.

How is XS different than other JavaScript engines for embedded?

XS is the only JavaScript engine for embedded that fully supports the ECMAScript 2018 standard—the same one used in web browsers today. It does so directly, without the use of polyfills or transpilation.

Espruino and JerryScript follow the ES5 standard, which was released way back in 2009. Duktape follows the ES5 standard with a few features from ES6 (2015) and ES7 (2016). mJS implements a tiny subset of ES6, but has many restrictions including no standard library, no exceptions, and no new.

In other words, XS is the only JavaScript engine for embedded that supports modern JavaScript language features like Asynchronous iteration, Object Rest/Spread properties, RegExp lookbehind assertions, and Promise.prototype.finally().

Moddable is also the only embedded engine provider participating in Ecma TC39, the JavaScript language committee. Moddable joined TC39 to help sure that JavaScript remains a great language for use in embedded. Moddable helped to form Ecma TC53, a new standards initiative to define standard JavaScript APIs for use in Wearables and IoT, where cost, energy use, hardware support, and security have different requirements from the web platform.

How is developing with XS on embedded different than JavaScript on the web?

The microcontrollers XS targets have much more limited memory and performance than the devices that power the web. That introduces several challenges developers should be aware of. To read more about some of the challenges and how we address them with the Moddable SDK, see the XS Differences document.

How does the Moddable SDK make JavaScript run well on constrained devices?

XS uses a many different techniques to minimize the use of RAM and ROM while delivering excellent performance of industry standard JavaScript.

Pre-compilation

One of the key techniques XS uses to operate efficiently in memory-constrained environments is to compile JavaScript to byte code on a computer. The resulting byte code is downloaded to the target device together with the rest of the firmware. There are many advantages to this approach, including faster start up and lower memory use.

XS in C

Embedded developers are often hesitant about using JavaScript instead of C or C++ for performance reasons, and it is true that JavaScript will never outperform good native code. When necessary, we write functions in C and call them from script code using the "XS in C" API. We use XS in C for performance critical code and binding to native platform features. Developers can also use XS in C to create custom bindings. That said, you might be surprised by how well scripts perform so we generally recommend that you try scripts first and switch to C only if the performance is inadequate.

What kinds of microcontrollers/devices does the Moddable SDK run on?

The Moddable SDK is written in portable C, allowing it to be ported to a wide variety of devices. Moddable currently provides supported ports for several microcontollers.

ESP8266 by Espressif

The ESP8266 is popular in the maker community as an inexpensive way to add Wi-Fi to projects. We've found it to be surprisingly powerful when combined with the Moddable SDK and use it as the base of Moddable Zero.

ESP32 by Espressif

The ESP2 is the successor to the ESP8266. It has integrated Wi-Fi and BLE and is used as the base for many dev boards such as M5Stack Fire, LilyGo TAudio, Simple Alexa, LilyGo T5S, and oddWires. We also make a prototype ESP32-based Moddable Zero.

Gecko devices from Silicon Labs

The Gecko series of processors from Silicon Labs are low-powered ARM-based devices. Four models of Gecko are supported in the Moddable SDK:

  1. Giant Gecko
  2. Mighty Gecko
  3. Thunderboard Sense 2
  4. Blue Gecko

You can read more about developing applications with the Moddable SDK on Gecko in this blog post.

What is Moddable Zero?

Moddable Zero is a prototype hardware module that consists of a touch screen paired with an ESP8266 microcontroller. Most of our example apps run on Moddable Zero, making it the easiest way for developers to experiment with the Moddable SDK on inexpensive hardware.

All the components in Moddable Zero have been selected to keep the cost low. The two main components are the NodeMCU board and the touch screen.

You can read more and order your own Moddable Zero here.

How can I get started with the Moddable SDK?

Check out our repository on GitHub. The Getting Started document describes how to configure the host build environments, install the required SDKs, drivers and development tools, build applications, and use xsbug, our JavaScript source code debugger.

There over 150 examples you can build for simulators on macOS, Windows, and Linux machines. To run the examples on a microcontroller, we recommend you start with a Moddable Zero.

What licensing options does Moddable offer?

The Moddable SDK is offered with two distinct licensing options:

  1. A Free and Open Source Software (FOSS) license
  2. A commercial software license

You can read more about our licensing options here.

What is the best way to contact Moddable?

If you're an independent developer, we recommend you open an issue on GitHub. We'll respond as quickly as practical, and other developers can benefit from the answers to your questions.

For companies interested in the benefits of using JavaScript and the Moddable SDK to power your products, Moddable provides consulting services to help you get started. We're available to help with design, implementation, training, and support.

You can also reach out to us on Twitter (@moddabletech). Following us on Twitter is the best way to keep up with what we’re doing—we post announcements about new blog posts there, along with other Moddable news.

You can contact us directly at info@moddable.com