Caveats

The current state of the project

The compiler is being released now because it is at a stage where substantial, useful programs can be compiled. It is still, however, a work-in-progress: and that's why the current version is 0.6. The key deficiencies, that are stopping it from being version 1.0, are explained here.

  • Garbage Collection: is not currently implemented. Garbage collection is an important feature because several primitive procedures silently use memory without warning, which is never given back. For example, calling ‘(reverse …)’ on a list creates a new, reversed list in memory. If you call such procedures enough, the Arduino will eventually run out of RAM and start behaving unpredictably.

  • The numeric stack is fairly limited. There are no signed numbers, and no floating-point support. On the other hand, the long.ms and fixedpoint libraries have shown how richer numeric types can easily be built using pairs and numbers.

  • Arduino Input/Output functionalities are not complete. There is full support for digital I/O and sending of serial data. However, receiving of serial data is not complete. Input and output via the analog pins is not supported yet.

  • The compiled programs are large and slow. The number of instructions generated for a given microscheme program is ~10 times more than an equivalent C program. (This is not surprising because the GCC compiler has been around for a long time, and has had millions of man-hours spent on its optimisations.) However, the increased number of instructions is the price paid for the massively richer runtime semmantics of a dynamically typed, functional language like Scheme. Also, the arduino has plenty (~128K) of ROM, and I have not yet seen a microscheme program that even half fills it.

    Microscheme will probably never beat GCC on performance, but the main motivation for it is to give people the choice of using the functional style on the Arduino.