What are the available interactive languages ​​that work in tiny memory?

I am looking for general-purpose programming languages ​​that

  • has an interactive (live coding) invitation
  • runs in 32 KB of RAM on its own or 8 KB when the compiler is located on a separate machine.
  • runs on the microcontroller in just 8-32 KB of RAM (without MMU).

Below is my list, what am I missing?

  • Python PyMite VM needs a 64x flash, 8K RAM. LPC, SAM7 and ATmegas targets with 8K or more. Hosting
  • Lua : eLua Frequently asked questions recommend 256K flash, 64K RAM.
  • FORTH : amforth requires 8K flash, 150-byte RAM, 30 bytes EEPROM on ATmega.
  • Schematic : Armpit Schematic The smallest target is the LPC2103 with 32K Flash, 4K SRAM.
  • C : Interactive C runs on 68HC11 without flash and 32K SRAM. Hosting
  • C : picoc open source, cross-compiling, C interactive system. Compiling for AVR requires 63K flash, 8K RAM. RAM could be reduced by trying to save tables in flash memory.
  • C ++ : An open-source angelScript based on bytecode, C / C ++, similar to a scripting language with simple native calls.
  • Tcl : TinyTCL runs on DOS, 60K binary. Easy to carry.
  • BASIC : TinyBasic : Initialization using a 64K heap can be customizable.
  • Lisp
  • PostScript : (I have not yet found the FOSS implementation for low memory)
  • Shell : bitlash : an interactive command shell for Arduino (ATmega). See Also AVRSH .
+67
programming-languages interactive embedded microcontroller
Jul 04 '09 at 18:29
source share
15 answers

There are many versions of Tcl for embedded programming:

http://wiki.tcl.tk/1363

+8
Jul 04 '09 at 21:07
source share

I heard that CHIP-8, XPL0, PicoC, and Objective Caml have been ported to graphing calculators. The Wikipedia article "Lego Mindstorms" contains a list of programming languages ​​that supposedly work on the Lego RCX or Lego NXT platform. Do any of them meet your criteria for live coding?

You might want to check out another Forths microcontroller in the Forth wiki. It lists at least 4 Forths for Atmel AVM: amforth (which you already mention), PFAVR, avrforth, and ByteForth.
(Links to these interpreters, as well as this StackOverflow question, are included in the " Embedded Systems " wikibook).

+7
Dec 24 '09 at 17:58
source share

Quick execution in the courtyard can be realized in very little memory. I know someone who made it at Cosmac in the 1970s. The core was only 30 bytes.

+6
Jul 04 '09 at 20:04
source share

I would recommend LUA (or eLUA http://www.eluaproject.net/ ). I “ported” LUA to the Cortex-M3 some time ago. From the top of my head, it had a flash size of 60 ~ 100KB and it took about 20KB of RAM to run. I did a disassembly to the necessary things, but depending on your application this might be enough. There is still room for optimization, especially regarding RAM requirements, but I doubt that you can run it in 8KB.

+5
Jul 06 '09 at 14:09
source share

Wren meets your criteria - by default, it is configured to use only 4 thousand RAM. AFAIK, he did not see real use, since the guy I wrote decided that he did not need a translator that worked fully in the target system.

The language, which is obviously influenced by ML and Forth.

+4
Jan 02 2018-12-12T00:
source share

Have you considered the port in C Tiny Basic ? Or perhaps rewrite the UCSD Pascal p-machine into your Z-80 architecture?

Seriously, however, JavaScript would create a good embedded scripting language, but I don’t know what the minimum memory requirements are for VM + GC, and how difficult it is to remove OS dependencies. I played with NJS a while ago, which may have suited your needs. This is interesting in that the compiler is written in JavaScript (self-hosting).

+2
Jul 08 '09 at 14:25
source share

You can take a look at the very powerful AvrCo Multitasking Pascal for AVR. You can try it at http://www.e-lab.de . MEGA8 / 88 version is free. There are tons of drivers and simulators with the JTAG debugger and nice live or simulated visualizations of all standard devices (LCDCHAR, LCDGRAPH, 7SEG, 14SEG, LEDDOT, KEYBOARD, RC5, SERVO, STEPPER ...).

+2
Oct 28 2018-10-28
source share

You are missing EmbedVM, the homepage is here , the svn repo is here . Do not forget to check how [ 1 , 2 ] the video is on the first page;)

On the home page:

EmbedVM is a small embedded virtual machine for microcontrollers with a C-like language interface. It has been tested with GCC and AVR microcontrollers. But since the virtual machine is quite simple, it should be easy to port it to other architectures.

The VM mimics a 16-bit processor that can access 64 KB of memory. This can only work on 16-bit values ​​and arrays of 16-bit and 8-bit values. There is no support for complex data structures (structure, objects, etc.). A function can have no more than 32 local variables and 32 arguments.

Besides the memory for the virtual machine, a small structure containing the state of the virtual machine and the reasonable amount of memory that the EmbedVM functions require on the stack there are no additional memory requirements for the virtual machine. In particular, the VM is independent of dymaic memory management.

EmbedVM is optimized for size and simplicity, and not for execution speed. The VM itself occupies about 3 KB of program memory on the AVR microcontroller. On an AVR ATmega168 running at 16 MHz, the VM can execute about 75 VM instructions per millisecond.

All memory accesses performed by the virtual machine are processed using the function callback. Thus, some or all of the VM memory may have external storage devices, flash memory, etc. or hardware "memory card" functions for the virtual machine.

The compiler is a UNIX / Linux command line tool that reads into a * .evm file and generates bytecode in various formats (binary file, intel hex, C array initializers and a special debug output format). It also generates a character file that can be used to access data in the memory virtual machine from the host application.

A C-like language is as follows: http://svn.clifford.at/embedvm/trunk/examples/numberquizz/vmcode.evm

+1
Feb 07 '13 at 2:19
source share

I would recommend MY-BASIC , runs with a minimum of 8K RAM and is easy to port.

+1
Apr 20 '15 at 4:40
source share

Have you been covered simply by using /bin/sh provided by busybox ? Or do they recommend in smaller scripting languages ?

0
Jul 04 '09 at 19:31
source share

I used busybox on BlackFin in my previous work.

we compiled perl + php for it, after changing s / fork / vfork / g it worked pretty well ... more or less. Not having an MMU is not a good idea. Memory fragmentation will be quite easy to kill the server. All I have done is:

 for i in `seq 1 100`; do wget http://black-fin-ip/test.php; done 

He died when I went to my boss and told him that the server would die in production :)

0
Jul 04 '09 at 19:48
source share

Prolog - http://www.gprolog.org/

According to google's search for “proog small”, the size of the executable file can be quite small, avoiding linking inline predicates.

0
Sep 17 '09 at 18:37
source share

There is also JavaScript, via Espruino .

It is specifically designed for microcontrollers, and there are assemblies for various different chips (mainly STM32), which correspond to a complete system with only 8 KB of RAM.

0
Aug 14 '15 at 10:09
source share
-one
Sep 17 '09 at 18:42
source share



All Articles