Sun Nov 14 09:43:42 EST 2010
Lambda the Ultimate
Staapl got mentioned on LtU. Here's a comment:
Staapl consists of two parts that complement each other: a module
compiler and an interactive toplevel. The compiler marries the Racket
macro system with a Forth-like low level 2-stack language that acts as
a machine abstraction. The interactive toplevel is an ad-hoc command
interface bolted on top of the compiler and a target machine monitor.
The Racket macro system makes language towers easier to understand by
pinning down the meaning of identifiers at compile time, eliminating
some "moving parts" and so making code easier to reason about and
easier to modularize. The "functional nature" of a 2-stack machine as
opposed to a register machine adds simple low-level code composition
and so further facilitates modularization.
The complementary interactive toplevel emulates a standalone Forth
interpreter, allowing the execution of existing on-target code and the
definition of new on-target code by invoking the compiler and
uploading machine code while the target is running.
The interactive toplevel is there to "break the rules" when you need
more direct control over the target hardware. While the "static" and
"purely functional" approach are nice for building well-structured
programs, the reality of embedded programming is still that hardware
issues are related to state and ill-defined behaviour and require
interactive trial and error to resolve.