What are the available interactive languages that run in tiny memory?

dwhall picture dwhall · Jul 4, 2009 · Viewed 17.9k times · Source

I am looking for general purpose programming languages that

  • have an interactive (live coding) prompt
  • work in 32 KB of RAM by itself or 8 KB when the compiler is hosted on a separate machine
  • run on a microcontroller with as little as 8-32 KB RAM total (without an MMU).

Below is my list so far, what am I missing?

  • Python: The PyMite VM needs 64K flash, 8K RAM. Targets LPC, SAM7 and ATmegas with 8K or more. Hosted.
  • Lua: The eLua FAQ recommends 256K flash, 64K RAM.
  • FORTH: amforth needs 8K flash, 150 bytes RAM, 30 bytes EEPROM on an ATmega.
  • Scheme: armpit Scheme The smallest target is the LPC2103 with 32K Flash, 4K SRAM.
  • C: Interactive C runs on 68HC11 with no flash and 32K SRAM. Hosted.
  • C: picoc an open source, cross-compiling, interactive C system. When compiled for AVR, it takes 63K flash, 8K RAM. The RAM could be reduced with effort to keep tables in flash.
  • C++: AngelScript an open source, byte-code based, C/C++ like scripting language with easy native calls.
  • Tcl: TinyTCL runs on DOS, 60K binary. Looks easy to port.
  • BASIC: TinyBasic: Initializes with a 64K heap, might be adjustable.
  • Lisp
  • PostScript: (I haven't found a FOSS implementation for low memory yet)
  • Shell: bitlash: An interactive command shell for Arduino (ATmega). See also AVRSH.

Answer

ConcernedOfTunbridgeWells picture ConcernedOfTunbridgeWells · Jul 4, 2009

A homebrew Forth runtime can be implemented in very little memory indeed. I know someone who made one on a Cosmac in the 1970s. The core runtime was just 30 bytes.