logoalt Hacker News

MattGrommesyesterday at 6:29 PM4 repliesview on HN

I'm not an embedded systems guy (besides using esp32 boards) so this might be a dumb question but does something like this open up the possibility of programming an esp32/arduino board with Javascript, like Micro/Circuit Python?


Replies

halfmatthalfcatyesterday at 6:54 PM

There are already libraries/frameworks that have supported this:

* espruino (https://www.espruino.com/)

* elk (https://github.com/cesanta/elk)

* DeviceScript (Microsoft Research's now defunct effort, https://github.com/microsoft/devicescript)

cxryesterday at 8:33 PM

That's been possible with Moddable/Kinoma's XS engine, which is standards compliant with ES6 and beyond.

<https://www.moddable.com/faq#comparison>

If you take a look at the MicroQuickJS README, you can see that it's not a full implementation of even ES5, and it's incompatible in several ways.

Just being able to run JS also isn't going to automatically give you any bindings for the environment.

hebejebelusyesterday at 6:34 PM

Sort of related: About ten years ago there was a device called the Tessel by Technical Machine which you programmed with Javascript, npm, the whole nine yards. It was pretty clever - the javascript got transpiled to Lua VM bytecode and ran in the Lua VM on the device (a Cortex M3 I believe). I recently had Claude rewrite their old Node 0.8 CLI tools in Rust because I wasn't inclined to do the javascript archeology needed to get the old tools up and running. Of course then I put the Tessel back in its drawer, but fun nonetheless.

15155yesterday at 7:37 PM

Yes. The key enabling feature is a lack of malloc()