vx-scheme

A Scheme interpreter for VxWorks.

[ Home ]

News

The second public release, 0.4, has been made available on May 9, 2003. Improvements from the previous 0.3 release include:
  • Two garbage collection and a couple of semantic bugs fixed. They are detailed in the ChangeLog. These improvements are mainly due to the...
  • addition of over 5000 lines of code to the test suite.
  • Chris Gaskett at the Robotics Project in Japan has contributed an SLIB initialization file, and the test suite now checks for continuting SLIB compatibility. Doing this occasioned the addition of some new functions:
    • vector-fill!, eval, string-copy, string-fill!

Download

The easy-to-build source distribution is available here: The 0.3 version is also available in tgz and zip format, but I don't recommend downloading either of these as the 0.4 verison passes a much stronger test regime.

You can contact me at scheme@colin-smith.net with any questions or observations. For all I know, I'm the only person out there who's interested in Scheme and VxWorks simultaneously. If you are too, drop me a note!

Documentation

See the main page.

A word about the coding convention

This code uses the VxWorks coding convention, used extensively at Wind River. The brace indenting is a bit unorthodox. At Wind, the party line was always "they're nobody's favorite indenting rules, but we all use them, and therein lies the value." True enough. Now that I've left WR, I've been tempted to reformat the code in a more mainstream style, though. Maybe next version.

Installation Notes

For VxWorks:

Just unpack the archive anywhere you like. A Tornado workspace containing two projects is provided in tornado/vx-scheme.wsp. The first project, "target-shell", will build a VxSim executable that has enough C++ features selected to host the Scheme interpreter. The second is the interpreter itself. Build them both.

Note: For the present, vx-scheme only runs on the target shell: starting it from windsh will only confuse things.

Start the simulator you just built. Once it's launched you can use a script in ../startup that will load the Scheme image. (The startup script is in the parent directory of the directory where the sim starts in case you define new builds on your own.)

-> <../startup
cd "../../vx-scheme/SIMNTgnu"
value = 0 = 0x0
ld < vx-scheme.out
value = 30727944 = 0x1d4df08 = _dtors + 0x14
cd "../../../testcases"
value = 0 = 0x0
->

For UNIX:

For UNIX-like systems (FreeBSD, Cygwin, etc.) there's an ordinary Makefile in the unix directory of the distribution. Just say make or gmake (whatever it takes to launch GNU make on your system) in that directory. This will build a "vx-scheme" executable configured for use on your host system. I've tested the build on GCC versions 2.95.x and 3.2 (for both Cygwin and FreeBSD).

Test Suite

For VxWorks:

To run the test suite on VxWorks, follow the installation steps above and then, in your simulator window, do

-> scheme
=> 

The prompt changes to => when reading Scheme expressions. The startup script set the working directory to the place where the test suite lies so now we need only say:

=> (load "vx-test.scm")
PASS: pi
PASS: sort
PASS: factor
PASS: object->string
PASS: r4rstest
PASS: pi
PASS: sieve
PASS: cf
PASS: series
PASS: ack
PASS: scheme
PASS: dynamic
PASS: earley
PASS: maze

Note: Running the test suite defines a lot of symbols. In particular, "i" is defined, which masks the VxWorks definition. It's probably best to ^X the simulator and start over after running the suite.

For UNIX:

To run the test suite for UNIX: after building with make (or gmake) in the unix directory, just do a "make test".

Note: The "good" files are slightly different for VxWorks: in that case, expected to fail the "mult-float-print-test" on VxWorks and the "good" file contains these failures, so the suite will "pass". But as explained elsewhere we just take what the native I/O system gives us.

Roadmap

My next step is to add efficient, C implementations of put and get. This will allow me to add more code to the test suite.

After that, the next big hurdle is adding a compiler, along the lines of that described in SICP ch. 5.

Copyright © 2002 Colin Smith.