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
> 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.
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.
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
> P-Lisp for the Apple II: http://nostoc.stanford.edu/jeff/llisp/index.html
ALso http://www.flownet.com/ron/plisp.html
rg