ESP32 scripting language

Hi, what would be your go-to language in terms of interpreting small chunks of code in an existing C++ firmware on ESP32?

Imagine it as re-usable modules, that will get interpreted on the go. I already tried AssemblyScript with WASM, but scrapped it because of the WASM RAM page size of 64kB.

We need as optimized runtime interpreter (optimally under 40kBs) as possible because of the limited space.

I have looked into:

  • AssemblyScript (WASM) → 64kB RAM page issues, as mentioned above
  • Berry Language (compilation problems, however looks like a good fit)
  • Lua (size issues)

Any other ideas? Thanks a lot!

I’ve once experimented with a rather tiny (but also limited) Python interpreter:

It was small enough to fit in the 20kB of RAM for an STM32F103CB (Bluepill, Cortex-M3), so an ESP32 should stem it with ease: (2 year old version of the core though!)

There’s also JavaScript: