A Scheme Interpreter for ARM Microcontrollers:
ChangeLog for Snapshot 00.0186
Changes from snapshot 00.0171:
Rationals and complex numbers are implemented, along with related functions.
This required modifications of some object tags, leading to update of related
code examples (eg. ARMSchembler).
A practical consequence is that 'exact? and 'integer? are no longer synonymous
and 3/4 (for example) is exact (no longer automatically converted to float).
Additionally, because strings have new tags, files from previous versions of
Armpit Scheme (the user files stored in FLASH) cannot be read by this version and
should be erased (using (erase) for example) before loading this new version
and then re-writing the user files to on-board FLASH.
To find the new tags, search for _tag from the top of the source file armpit_00.0186.s.
Round, floor, ceiling and truncate now return inexact values for inexact inputs.
Inexact->exact should be used to convert those to exact values where needed
(eg. when lighting up pixels on an attached LCD or OLED display).
Numeric prefixes #e and #i are implemented.
Case-insensitive character and string functions are implemented.
Dynamic-wind has been added and call-with-current-continuation is now available (in addition to call/cc).
Call/cc was modified to account for potential dynamic unwindings.
A user-accessible variable named _winders is used to store the winders (it can be set to null in a
thread environment, when thread-execution starts, so that the thread has its own winders, separate
from those of the top-level).
The r5rs functions new to this version are (see also the conformance web page for this version):
complex?, rational?, numerator, denominator, rationalize, make-rectangular,
make-polar, real-part, imag-part, magnitude, angle,
char-ci=?, char-ci<?, char-ci>?, char-ci<=?, char-ci>=?,
char-alphabetic?, char-numeric?, char-whitespace?, char-upper-case?, char-lower-case?,
string-ci=?, string<?, string>?, string<=?, string>=?, string-<i, string-ci>?,
call-with-current-continuation, dynamic-wind, scheme-report-environment, null-environment,
The addendum functions pack and unpack have been updated to work with rationals and complex numbers.
A bug in the i2c subsystem had been corrected making LCD operation on the LCDDemo2158
The subsystem's multiprocessing functionality does not appear to be fully restored by this correction
and by the update of pack/unpack performed in this release.
Macros are now expanded in the reader (rather than dynamically at run-time).
The new function (expand ...) can be used to expand a macro manually.
The new user-accessible function (gc) performs a garbage collection and returns the number
of free memory bytes.
The new user-accessible function (version) returns the currently running version of Armpit Scheme.
The new user-accessible function (prompt) defines the Armpit Scheme prompt.
The REP loop is now a Scheme program stored in a variable named _prg.
Error management is now performed with a user-accessible catch-throw mechanism.
The function (throw 'source 'error) can be used to throw an error.
The user-modifiable function stored in the _catch variable in the environment where
throw is called then responds to the error.
This modification is meant to make it possible to handle thread errors with more grace
than in previous versions.
The ctrl-c throws an error by default but can now also be captured as interrupt -3
(the latter case is meant to be useful with threads where ctrl-c has to be directed to the
REP loop. Threads likely need individual IDs for this to work though).
The variable _BRK of prior versions has been removed.
An option to assemble only the Scheme core has been added at the top of the main assembly source file.
It retains addendum functions, the optional function 'load and library functions 'begin, 'equal?,
'read, 'write and 'display but removes remaining library functions of r5rs (cond, case, and, or, let, ...).
The resulting Armpit Scheme code is 10KB smaller than with library functions (a size reduction
of the order of 20%).
The SMALL_MEMORY version (LPC-H2103, TINY-2131) supports rationals, but not complex numbers,
and does not include the following functions: 'version, 'defined?, 'unlock, 'packed?, 'pack, 'unpack,
'complex?, 'rational?, 'exp, 'log, 'sin, 'cos, 'tan, 'asin, 'acos, 'atan, 'sqrt, 'expt,
'make-rectangular, 'make-polar, 'real-part, 'imaginary-part, 'magnitude, 'angle
'call-with-current-continuation (call/cc is available), 'dynamic-wind,
'scheme-report-environment, 'null-environment, library functions removed when only the Scheme core
is assembled (see item above).
The mark-and-sweep gc option has been removed.
Null i/o ports have been removed (they were not used).
The code organization has been modified such that eval and apply are closer together and closer to the
built-in environment (label scmenv:).
This re-organization is meant to form a localized core of fundamental functionality that also includes
memory allocation and gc.
Several numeric functions now use jump tables for type-based dispatch.
On the LPC-H2214, FLASH and RAM timings are updated for 25ns R/W and bank-switching delay (IDCY) which
makes the board perform as fast as other ARMv4T boards in the benchmarks
(if this proves to be stable, then IDCY was the performance limiting issue for this board, rather than
lack of cache, in prior versions).
On the LPC-H2888, FLASH and RAM timings have been updated for the 48MHz clock needed for USB operation
(this makes the board stable at 48MHz).
The files LPC_H2888.h and LPC_2800_startup.s have been modified so that assembling without USB gives a
60MHz clock (comment out native_usb at top of LPC_H2888.h).
It is also notable that performance with USB enabled is lower than one might infer from the clock
reduction from 60 to 48MHz alone.
On the TI-Beagle, the MMU (L1 and L2 caches) is now enabled which improves performance by a factor of 10
over the previous snapshot (t1/60 for tak and ctak are similar to LM3S1968, atak is between Tiny-2106
and TCT-Hammer, Make-maze is the fastest t1/60 at 5s).
On the TCT-Hammer and TI-Beagle, device initialization has been separated into a startup file and an
init-io file, similar to other devices with MMU and external memory.
Where appropriate, program examples are under development to
illustrate the application of the new features described above.
Last updated August 7, 2009