From: Philipp Klaus Krause
Subject: lisp compiler for the Z80
Date: 
Message-ID: <44953675$0$7870$6e1ede2f@read.cnntp.org>
Is there a free lisp compiler for the Z80?
Googling I only find this paper
http://portal.acm.org/citation.cfm?id=802158, which would require a
subscription to view.
Maybe using a lisp to C translator would make sense?

[I have no idea about lisp, but I might want to learn it (as a
programming language which is a bit different from thos I know) and try
and see how well it works on a 3.58 Mhz Z80 with 1 KB of RAM].

Philipp

From: vanekl
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <1150647015.993133.276810@h76g2000cwa.googlegroups.com>
Philipp Klaus Krause wrote:
> Is there a free lisp compiler for the Z80?
> Googling I only find this paper
> http://portal.acm.org/citation.cfm?id=802158, which would require a
> subscription to view.
> Maybe using a lisp to C translator would make sense?
>
> [I have no idea about lisp, but I might want to learn it (as a
> programming language which is a bit different from thos I know) and try
> and see how well it works on a 3.58 Mhz Z80 with 1 KB of RAM].
>
> Philipp

Ok, I'll bite.

Why would anybody want to learn lisp on a Z80 when they have access to
a PC? Stuffing a CL onto a Z80 would be equivalent to stuffing a 300 lb
woman into a size 2 girdle. It's just not going to happen on a 1K
machine.

That said, here's a description of tiny lisps available, many of which
should be portable (if you've got the 32K mem expansion):
http://www.mattknox.com/littlelisps.html

Lou Vanek
From: Philipp Klaus Krause
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <449583ba$0$7870$6e1ede2f@read.cnntp.org>
vanekl wrote:

> 
> Why would anybody want to learn lisp on a Z80 when they have access to
> a PC? Stuffing a CL onto a Z80 would be equivalent to stuffing a 300 lb
> woman into a size 2 girdle. It's just not going to happen on a 1K
> machine.

Sorry, English is not my native language; it seems my post did not state
clearly what I intend to do.

I sometimes write programs which will run on a Z80 with 1 KB of memory
(ColecoVision).
I have written a library to do some low-level stuff in assembler and C.
This library is used from programs written in C (and occassionally some
inner loops in assembler).
For development I use a x86 PC, with the sdcc cross-compiler.
Now I wonder if it's possible to write the programs in lisp instead.
I'm looking for something like a lisp cross-compiler targeting the Z80.
I've learned that there are some lisp-to-C translators, and wonder if I
can use them here.
ECL documentation says that it integrates very nicely with C.
I don't know if such a translator will output just some standard C code
which I can comile with sdcc.
I fear that it will produce output that needs linking with some
libraries to provide lisp features like garbage collection and that
these libraries would be too big both in RAM and ROM requirements to be
portable to the Z80.

Philipp
From: vanekl
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <1150652540.907331.293480@g10g2000cwb.googlegroups.com>
Philipp Klaus Krause wrote:
> vanekl wrote:
>
> >
> > Why would anybody want to learn lisp on a Z80 when they have access to
> > a PC? Stuffing a CL onto a Z80 would be equivalent to stuffing a 300 lb
> > woman into a size 2 girdle. It's just not going to happen on a 1K
> > machine.
>
> Sorry, English is not my native language; it seems my post did not state
> clearly what I intend to do.
>
> I sometimes write programs which will run on a Z80 with 1 KB of memory
> (ColecoVision).
> I have written a library to do some low-level stuff in assembler and C.
> This library is used from programs written in C (and occassionally some
> inner loops in assembler).
> For development I use a x86 PC, with the sdcc cross-compiler.
> Now I wonder if it's possible to write the programs in lisp instead.
> I'm looking for something like a lisp cross-compiler targeting the Z80.
> I've learned that there are some lisp-to-C translators, and wonder if I
> can use them here.
> ECL documentation says that it integrates very nicely with C.
> I don't know if such a translator will output just some standard C code
> which I can comile with sdcc.
> I fear that it will produce output that needs linking with some
> libraries to provide lisp features like garbage collection and that
> these libraries would be too big both in RAM and ROM requirements to be
> portable to the Z80.
>
> Philipp

You are correct in thinking that the support routines would be more
than a 1K machine can store. Not that there are a bunch of magic
libraries that lisp must link to, but that lisp itself does a lot
"under the hood," such as garbage collection (that you mention), that
are probably portable to the Z80 but not achievable due to memory
constraints.

On the other hand, if you constrained the project requirements to a
minimal lisp/scheme and were able to throw out such capabilities as
garbage collection and multi-precision math then you should be able to
hack up a suboptimal version. Not that it would be of much use except
for its instructional value.

And, IIRC, the 32K memory expansion pack is only about 100 bucks. That
would make life a lot easier.

-lv
From: Thomas Schilling
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <4flgnlF1j7ejjU1@news.dfncis.de>
Philipp Klaus Krause wrote:

> I sometimes write programs which will run on a Z80 with 1 KB of memory
> (ColecoVision).
> I have written a library to do some low-level stuff in assembler and C.
> This library is used from programs written in C (and occassionally some
> inner loops in assembler).
> For development I use a x86 PC, with the sdcc cross-compiler.
> Now I wonder if it's possible to write the programs in lisp instead.
> I'm looking for something like a lisp cross-compiler targeting the Z80.
> I've learned that there are some lisp-to-C translators, and wonder if I
> can use them here.
> ECL documentation says that it integrates very nicely with C.
> I don't know if such a translator will output just some standard C code
> which I can comile with sdcc.
> I fear that it will produce output that needs linking with some
> libraries to provide lisp features like garbage collection and that
> these libraries would be too big both in RAM and ROM requirements to be
> portable to the Z80.

Yep, that's the case.  AFAIK, ECL links with Boehm-Weiser GC.  I don't
think that this is available for Z80 or even small enough to meet your
ram-criteria.  You could still profit from Lisp when you implement your
assembler in, but it may not be a good start to learn Lisp and the
actual benefit wouldn't be great, either.

It looks like I would be entitled to give you a copy of the paper if I
don't take any money for that.[*]  It describes how various Lisp
features are implemented in Z80 assembly, so you could try to build your
own compiler.  Though, this might be too complicated for a start, as you
don't know the language (yet).

-ts


[*] I doesn't state whether this applies for printed out copies only.
We can figure this out though, if you're interested. Here's the quote:

"Permission to copy without fee all or part of this material is granted
provided that the copies are not made or distributed for direct
commercial advantage, the ACM copyright notice and the title of the
publication and its date appear, and notice is given that copying is by
permission of the Association for Computing Machinery. To copy
otherwise, or to republish, requires a fee and/or specific permission."
From: Thomas Schilling
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <4fktsiF1jqblcU1@news.dfncis.de>
Philipp Klaus Krause wrote:
> Is there a free lisp compiler for the Z80?
> Googling I only find this paper
> http://portal.acm.org/citation.cfm?id=802158, which would require a
> subscription to view.
> Maybe using a lisp to C translator would make sense?
> 
> [I have no idea about lisp, but I might want to learn it (as a
> programming language which is a bit different from thos I know) and try
> and see how well it works on a 3.58 Mhz Z80 with 1 KB of RAM].
> 
> Philipp

FWIW, the paper is about UOLISP a subset of Standard LISP (not Common
Lisp).  UO presumably stands for "University of Oregon".

It also looks unusable (>1K RAM) [1] and I think it might no longer be
available.  As you're saying, that you don't know Lisp, it's probably a
better start to use a modern Lisp, so e.g. Scheme or Common Lisp, on a
more recent machine.

-ts


[1] From the paper
"Conclusions

The UOLISP compiler runs on almost any Z80 based machine with a minimum
storage configuration of 32k bytes and a disk drive. The compiler and
optimizer have been tested under both CP/M and the TRS-80 ~del I and III
with success. Turning on all of the optimizations slows down compilation
by approximately 40 percent. The UOLISP compiler occupies 3750 bytes of
storage and the optimizer with statistics collection another 3000 bytes.
Standard Use has debugging done without the presence of the optimizer
and the final run with the optimizer enabled."
From: Philipp Klaus Krause
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <44954880$0$7871$6e1ede2f@read.cnntp.org>
Thomas Schilling wrote:

> 
> FWIW, the paper is about UOLISP a subset of Standard LISP (not Common
> Lisp).  UO presumably stands for "University of Oregon".

Thaks a lot.

> 
> It also looks unusable (>1K RAM) [1] and I think it might no longer be
> available.  As you're saying, that you don't know Lisp, it's probably a
> better start to use a modern Lisp, so e.g. Scheme or Common Lisp, on a
> more recent machine.

The Z80 is only the target platform. I want to do the development on my
x86 PC. I would indeed prefer a modern lisp.
Would it make sense to use a lisp to C translator and then use a C
crosscompiler?
I suppose that would make integration with C and assembler code easier, too.
What about the memory requirements of libraries these translators would
add to my code?

Philipp
From: Tin Gherdanarra
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <4fl0vqF1iufe4U1@individual.net>
Philipp Klaus Krause wrote:
> Thomas Schilling wrote:
> 
> 
>>FWIW, the paper is about UOLISP a subset of Standard LISP (not Common
>>Lisp).  UO presumably stands for "University of Oregon".
> 
> 
> Thaks a lot.
> 
> 
>>It also looks unusable (>1K RAM) [1] and I think it might no longer be
>>available.  As you're saying, that you don't know Lisp, it's probably a
>>better start to use a modern Lisp, so e.g. Scheme or Common Lisp, on a
>>more recent machine.
> 
> 
> The Z80 is only the target platform. I want to do the development on my
> x86 PC. I would indeed prefer a modern lisp.
> Would it make sense to use a lisp to C translator and then use a C
> crosscompiler?
> I suppose that would make integration with C and assembler code easier, too.
> What about the memory requirements of libraries these translators would
> add to my code?

I have another idea. You write a Z80-Assembler in Lisp that uses
S-Expressions. Being all S-Expressions, the assembler automatically
is a very sophisticated Macro-Assembler.

However, I strongly recommend buying a Lisp-book first.



> 
> Philipp


-- 
Lisp kann nicht kratzen, denn Lisp ist fluessig
From: Alexander Schreiber
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <slrne9b820.iin.als@mordor.angband.thangorodrim.de>
Philipp Klaus Krause <···@spth.de> wrote:
> Thomas Schilling wrote:
>
>> 
>> FWIW, the paper is about UOLISP a subset of Standard LISP (not Common
>> Lisp).  UO presumably stands for "University of Oregon".
>
> Thaks a lot.
>
>> 
>> It also looks unusable (>1K RAM) [1] and I think it might no longer be
>> available.  As you're saying, that you don't know Lisp, it's probably a
>> better start to use a modern Lisp, so e.g. Scheme or Common Lisp, on a
>> more recent machine.
>
> The Z80 is only the target platform. I want to do the development on my
> x86 PC. I would indeed prefer a modern lisp.
> Would it make sense to use a lisp to C translator and then use a C
> crosscompiler?

In that case, use a high-level assembler that eats S-Expressions
(allowing you to write lisp-like Code) and spits out machine code
for the Z80. Using C as an intermediate probably eats too much ressources.

Regards,
       Alex.
-- 
"Opportunity is missed by most people because it is dressed in overalls and
 looks like work."                                      -- Thomas A. Edison
From: =?UTF-8?B?SmVucyBBeGVsIFPDuGdhYXJk?=
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <4495ba4f$0$38708$edfadb0f@dread12.news.tele.dk>
Philipp Klaus Krause skrev:
> Is there a free lisp compiler for the Z80?
> Googling I only find this paper
> http://portal.acm.org/citation.cfm?id=802158, which would require a
> subscription to view.
> Maybe using a lisp to C translator would make sense?
> 
> [I have no idea about lisp, but I might want to learn it (as a
> programming language which is a bit different from thos I know) and try
> and see how well it works on a 3.58 Mhz Z80 with 1 KB of RAM].

If it weren't for the 1Kb limit I'd have suggested Bit by Danny
Dube, which is optimized for space. It doesn't fit in 1 Kb though.
The runtime library fits in 22Kb.

     <http://www.iro.umontreal.ca/~dube/bit.tar.gz>

     <http://www.iro.umontreal.ca/~dube/>

-- 
Jens Axel Søgaard
From: Philipp Klaus Krause
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <4495bd8d$0$7874$6e1ede2f@read.cnntp.org>
Jens Axel Søgaard wrote:

> 
> If it weren't for the 1Kb limit I'd have suggested Bit by Danny
> Dube, which is optimized for space. It doesn't fit in 1 Kb though.
> The runtime library fits in 22Kb.

1 KB is the RAM limit. I have 32 KB of ROM that I could use for the
library and the program.
I don't want to use an OS on the Z80, so the printf, fprintf and exit
functions called in his library don't make sense.

Philipp
From: =?UTF-8?B?SmVucyBBeGVsIFPDuGdhYXJk?=
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <4495c42b$0$38690$edfadb0f@dread12.news.tele.dk>
Philipp Klaus Krause skrev:
> Jens Axel Søgaard wrote:
> 
>> If it weren't for the 1Kb limit I'd have suggested Bit by Danny
>> Dube, which is optimized for space. It doesn't fit in 1 Kb though.
>> The runtime library fits in 22Kb.
> 
> 1 KB is the RAM limit. I have 32 KB of ROM that I could use for the
> library and the program.
> I don't want to use an OS on the Z80, so the printf, fprintf and exit
> functions called in his library don't make sense.

Then leave them out :-)

-- 
Jens Axel Søgaard
From: Philipp Klaus Krause
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <4495c9c4$0$7870$6e1ede2f@read.cnntp.org>
Jens Axel Søgaard wrote:

> If it weren't for the 1Kb limit I'd have suggested Bit by Danny
> Dube, which is optimized for space. It doesn't fit in 1 Kb though.
> The runtime library fits in 22Kb.

This one should work with some modifications.
I'd prefer a real compiler that generates Z80 machine code though. The
one fron Danny Dube is a byte code generator combined with an interpreter.
I don't know much about lisp, so forgive me if a real compiler for lisp
is something that wouldn't make sense.
Philipp
From: Philipp Klaus Krause
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <4495cd62$0$7874$6e1ede2f@read.cnntp.org>
Jens Axel Søgaard wrote:

> If it weren't for the 1Kb limit I'd have suggested Bit by Danny
> Dube, which is optimized for space. It doesn't fit in 1 Kb though.
> The runtime library fits in 22Kb.

I managed to compile it for the Z80 (didn't test if it works yet). The
runtime library fits into 17.5 KB of ROM.
The C library I want to use would take some more ROm space, probably
leaving 8 KB or less fore the program.

I see another problem with this one: The "absolutely no error checking"
part. For the runtime part that's ok, since it reduced size, but I'm a
bit worried about the bytecode generator.

Philipp
From: =?UTF-8?B?SmVucyBBeGVsIFPDuGdhYXJk?=
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <449658a6$0$38688$edfadb0f@dread12.news.tele.dk>
Philipp Klaus Krause skrev:

> I see another problem with this one: The "absolutely no error checking"
> part. For the runtime part that's ok, since it reduced size, but I'm a
> bit worried about the bytecode generator.

I have no practical knowledge of Bit, but it is the only
optimized-for-space implementation I know.

-- 
Jens Axel Søgaard
From: Roberto Waltman
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <h77d92hhc8nquhejhe42am7njnsva1dint@4ax.com>
Philipp Klaus Krause <···@spth.de> wrote:

>Is there a free lisp compiler for the Z80?
>Googling I only find this paper
>http://portal.acm.org/citation.cfm?id=802158, which would require a
>subscription to view.
>Maybe using a lisp to C translator would make sense?
>
>[I have no idea about lisp, but I might want to learn it (as a
>programming language which is a bit different from thos I know) and try
>and see how well it works on a 3.58 Mhz Z80 with 1 KB of RAM].

In days of lore, when 8 bit computers running CP/M ruled the universe,
there were a few Lisp interpreters and even symbolic algebra systems
for such beasts.

You can download LISP/80 from the commercial CP/M software archive
site: http://www.retroarchive.org/cpm/lang/lang.htm


Roberto Waltman

PS: If you want to learn Lisp, I would suggest stepping up to
something running on a more capable processor, let's say, a 68008...
;)
From: Christian Jullien
Subject: Re: lisp compiler for the Z80
Date: 
Message-ID: <4496d7b9$0$920$ba4acef3@news.orange.fr>
I remember muLisp from Microsoft (not a joke) that worked rather well on the 
old of CP/M days.

But the faster and more complete Lisp system (interprete only) used to be 
Le-Lisp 80 made at INRIA by Jer�me Chailloux.
It gave you about 8000 cons cells and was impressively fast.
It also came with a tiny emacs like editor entirely written in Le-Lisp.

Christian

Check "mulisp microsoft" on google

"Philipp Klaus Krause" <···@spth.de> wrote in message 
·····························@read.cnntp.org...
> Is there a free lisp compiler for the Z80?
> Googling I only find this paper
> http://portal.acm.org/citation.cfm?id=802158, which would require a
> subscription to view.
> Maybe using a lisp to C translator would make sense?
>
> [I have no idea about lisp, but I might want to learn it (as a
> programming language which is a bit different from thos I know) and try
> and see how well it works on a 3.58 Mhz Z80 with 1 KB of RAM].
>
> Philipp