Wrench 5.0.1 : interpreter that fits on an uno

Just released 5.0.1 with a bunch of updates and improvements.

An interpreter? on an arduino? why?! I hear you say. I'll get to that in a minute. First these are the highlights:

  • c-like simple syntax, switch? structs? built-in hash tables? familiar syntax? yes yes and yes.
  • seamless integration with native c/c++ code? that's the point, yes.
  • automatic memory management
  • very small interpreter, <30k ROM and <1k RAM to operate (I make sure it works on Uno Mini)
  • works on big and little endian architecture, PC/linux/win32 CLI included
  • very small byte-code, "hello world" is ~30 bytes total.
  • very fast, but it's an interpreter so that's relative
  • c++98, everything included, no libraries, easy to integrate (only two source files)

So... why? Pretty much to add user-friendly field-programmable functionality without needing a development stack or re-flashing. No 'bricking' danger. Originally I wrote this for a lightning controller so users could implement their own control algorithms on a SAMD21.

Also extends the executable space of a limited embedded chip into external storage, since the bytecode is not copied into RAM to execute (I'm looking at you.. every other embedded scripting language I tried..)

Kinda ran away from me and has been a chew-toy ever since, seeing how small and fast I can make it without losing functionality.

Simple MIT license, have fun! Let me know if it's useful to you I always appreciate feedback!

docs (I try): wrench embedded interpreter

project: GitHub - jingoro2112/wrench: practical embedded script interpreter

2 Likes

So does that include a CLI interface on the microcontroller side. so you can connect with SerialMonitor/etc and enter code interactively?

sorry no, this is a compiled language. The byte-code is interpreted, think Java or c# but fitting on a small system.