low.js vs. Alternatives
With these comparisons we would like to explain which advantages low.js offers and in which situations you should best use low.js.
low.js vs. Arduino
Programs written for the Arduino microcontroller board platform are called Sketches and are written in simplified C/C++ language with the Arduino API.
Arduino is widely used, so for almost any purpose somebody has already written a library and an example which can be used as a template for a new project.
Where it becomes difficult to use Arduino is:
- It is hard to let the program do multiple things in parallel, especially as not all APIs calls are non-blocking.
- While Arduino on ESP32 does have networking/Wifi support, building fully featured servers still need lots of manual work. HTTP, HTTPs or WebSockets are protocols which can be used with third-party libraries, but they often are not standard-compliant or fully featured.
These two flaws are strengths of low.js.
low.js vs. ESP-IDF
ESP-IDF is the low-level development framework for programming the ESP32 chips, provided by the chip maker Espressif itself.
Programming with ESP-IDF requires knowledge of C/C++ and of microcontrollers internals (interrupts, FreeRTOS). For a programmer with this knowledge, it is a very flexible framework to program with, allowing the user to get the most out of the ESP32 chips.
In fact, low.js itself is developed on top of a modified version of ESP-IDF.
low.js is far easier and less time consuming to program with than with ESP-IDF, often producing the same results with far less lines of code.
low.js vs. Espruino
Espruino is another JavaScript runtime for microcontrollers. It runs on far less powerful microcontrollers than low.js does. This comes at the cost of not taking advantage of the possibilities of the more powerful microcontrollers such as the ESP32:
- The API of Espruino is far less powerful than the API of low.js is, as Espruino does not provide the Node.js API, which would not fit into
the smaller microcontrollers. Espruino
provides some API calls which mimic Node.js API calls, such as
fs.writeFile
, however they do not work the same way.fs.writeFile
for example is blocking (there does not seem to be any way to write a file asyncronly with Espruino). - The JavaScript engine of Espruino does not compile to byte code, but rather runs of the source code, thus is usually slower than low.js.
low.js vs. MicroPython
MicroPython is a port of Python for microcontrollers, just as low.js is a port of Node.js for microcontrollers. With both microcontrollers can be programmed easily.
The arguments for low.js vs. MicroPython are the same as for Node.js vs. Python:
- low.js allows the programmer to use one programming language - JavaScript - for the whole project consisting of microcontroller software, website and server in the cloud.
- The API of low.js is asynchronous first, making it easy to scale projects.
But, MicroPython is the better choice if your Python skills are better than your JavaScript skills already.