Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Scheme for embedded systems?

127 views
Skip to first unread message

Philipp Klaus Krause

unread,
Jan 18, 2010, 8:30:42 AM1/18/10
to
Is it possible to use Scheme to program for embedded systems?

I'd like to write programs for a Z80-based system, which has 1K RAM, 32
K ROM.
With sdcc a C compiler, which supports most of the C standard, is
available; there is no support for double or 64-bit integers and struct
support is limited though.

Is there a Scheme-to-C compiler you would recommend? The output should
be small and efficient, if some library is needed it should be small as
well, RAM usage of the output should be minimal. It should be possible
to call C functions from Scheme and vice versa.

Philipp

Aaron W. Hsu

unread,
Jan 18, 2010, 1:42:00 PM1/18/10
to
On Mon, 18 Jan 2010 08:30:42 -0500, Philipp Klaus Krause <p...@spth.de>
wrote:

> Is there a Scheme-to-C compiler you would recommend? The output should
> be small and efficient, if some library is needed it should be small as
> well, RAM usage of the output should be minimal. It should be possible
> to call C functions from Scheme and vice versa.

I haven't seen a Scheme system that runs with that small of a space, but I
could be very wrong. :-) In fact, I think that you could probably do it,
and maybe even write your own fairly easily if the system is really
limited. I'd be interested to hear from others what sorts of compilers
might work for this system. There are some small interpreters as well, but
I haven't heard of any that have that small a footprint. From my
understanding, Chibi Scheme was the smallest I have seen, but it seems
larger than that.

Aaron W. Hsu

--
A professor is one who talks in someone else's sleep.

Jeffrey Mark Siskind

unread,
Jan 18, 2010, 2:57:59 PM1/18/10
to
See the work on BIT and PICOBIT by Marc Feeley, Danny Dube, and
Vincent St-Amour.

http://www.iro.umontreal.ca/~feeley/papers/ll3.pdf
http://www.iro.umontreal.ca/~feeley/papers/StAmourFeeleyIFL09.pdf

Also see the work on Hot Dog Scheme by Ian Horswill and his students.

Thomas Munro

unread,
Jan 19, 2010, 7:58:14 AM1/19/10
to
On Jan 18, 6:42 pm, "Aaron W. Hsu" <arcf...@sacrideo.us> wrote:
> ...

> I haven't seen a Scheme system that runs with that small of a space, but I  
> could be very wrong. :-) In fact, I think that you could probably do it,  
> and maybe even write your own fairly easily if the system is really  
> limited. I'd be interested to hear from others what sorts of compilers  
> might work for this system. There are some small interpreters as well, but  

There have been a number of interpreters and at least one compiler for
Lisps of various dialects on Z80/8080 and 6502 systems. In my
googling I have found the following:

VLisp by Jerome Chailloux (1979): http://www.softwarepreservation.org/projects/LISP/index.html#VLISP_

Le Lisp 80 by Jerome Chailloux (1983):
http://www.softwarepreservation.org/projects/LISP/index.html#Le_Lisp_

Toolworks Lisp80 by Walt Bilofsky: http://www.retroarchive.org/cpm/lang/lang.htm

InterLisp/65 for the Atari machines: http://atariwiki.strotmann.de/xwiki/bin/view/APG/InterLisp65

Acornsoft Lisp: http://www.bbcmicro.net/old-8bs/elecgame/list_cassette.htm

SpecLisp for the ZX-Spectrum: http://www.worldofspectrum.org/infoseekid.cgi?id=0008718

P-Lisp for the Apple II: http://nostoc.stanford.edu/jeff/llisp/index.html

Lisp-64 for the Commodore 64: http://www.c64-online.com/phpbb/downloads.php?view=detail&df_id=163

Microlisp for the Commodore 64: http://cbm.csbruce.com/~csbruce/cbm/transactor/disks/disk-23.html

Z80 Scheme, an interpreter and a compiler by Kent Dybvig, mentioned in
http://www.cs.indiana.edu/~dyb/pubs/hocs.pdf

I'm sure there are plenty more. I have found a couple of modern 8 bit
Scheme/Lisp projects in unknown state of completion:

TI-Calculator Scheme (Z80): http://svn.revsoft.org/scheme/

6502 Lisp: http://www.hugbox.org/lisp8/lisp-6502.asm

I have my own toy Z80 Scheme interpreter which runs on the ZX
Spectrum, but it's a long way from being useful... perhaps by
mentioning it on here I will embarrass myself into completing it (look
out for it in Summer 2042). Designing memory representations, type
tagging and garbage collection etc on such tiny systems is a lot of
fun.

Interestingly, the Dybvig paper above says that they couldn't make
their compiler produce code that ran faster than their interpreter so
they abandoned it.

Thomas

Ron Garret

unread,
Jan 19, 2010, 5:43:32 PM1/19/10
to
0 new messages