Kaluma squeezes JavaScript onto the Raspberry Pi Pico

Bringing the language of multi-gigabyte web browsers to a $4 computer

Although JavaScript is responsible for some bloated Electron apps, apparently you can still usefully run it in 264kB of RAM.

The Kaluma project has managed to embed a working JavaScript interpreter into the Raspberry Pi Pico, and other devices using the same CPU. The Pi Pico ships with 264kB of RAM and just 2MB of flash storage, but into that, Kaluma has managed to squeeze the ECMAscript 5.1-compliant JerryScript runtime, complete with support for Node.js and the npm package manager.

The new Raspberry Pi 5 – which, we can exclusively reveal today, does not cope well with having cola spilled over it so readers may not see a long-term test of the device – has hogged the headlines recently. In some small part, this is because of its in-house designed southbridge chip, confusingly named the RP1. The Pi 5 wasn't the first Pi model with an in-house chip on board, though. The $4 Raspberry Pi Pico uses the company's home-made RP2040 processor, available for 70¢ in volume.

Despite its tiny specs, the Pi Pico has done rather well, partly because it didn't suffer too badly from the silicon chip shortages that caused problems for many other devices, including the bigger Pis, since the pandemic began. The Pico is a very limited device, which doesn't even have a built-in display output. The hacker community has taken this as a challenge, and come up with some impressive tech from the tiny device. The Reg FOSS Desk's personal favorite is turning Picos into plug-compatible Transputer replacements.

It's easy to assume that to work with such a constrained device, you must use a low-level or constrained language. Out of the box, the Pi Pico supports C (arguably not a low-level language any more), and MicroPython, as also used in the BBC Micro:Bit – which is about four times the price.

Kaluma's offering, though, seems remarkably capable. The company has a showcase of projects built with it, a library of code packages, documentation, and a forum on GitHub. It uses JerryScript, which is also open source and well documented – for an example, see its API reference.

Although some terrible things have been done with it, we can't help but recall how Smalltalk and Croquet boffin David A Smith told us:

JavaScript is an extraordinarily good, […] powerful language. Most people don't understand that: they think it's a toy language, but in fact, it's probably one of the best languages out there. The other thing is, it's had billions of dollars of investment to make it very, very, very fast and very efficient, and it runs everywhere.

Kaluma is the proof that this extends even further than you might think. And of course JavaScript also enjoys a wealth of support, documentation, and a large and active community. A Javascript-enabled $4 computer sounds excellent and highly encouraging for beginners at hardware development. ®

 

More about

TIP US OFF

Send us news


Other stories you might like