CPCWiki forum

General Category => Programming => Topic started by: duncan_bayne on 16:00, 22 July 13

Title: zlisp running (sort of)
Post by: duncan_bayne on 16:00, 22 July 13
zlisp running: non-evaluating REPL on Vimeo (https://vimeo.com/70784619)

I've got zlisp (my simple Lisp implementation for the Amstrad CPC series) running.  At the moment it's not even vaguely usable: it parses simple atoms (strings, integers, and symbols) and prints them.  The parser can't handle lists, and there's no eval, so there's a lot of work to do :)

But I'm making progress, albeit slowly.
Title: Re: zlisp running (sort of)
Post by: fano on 19:50, 22 July 13
Nice ! parsing is the first step  ;)
Title: Re: zlisp running (sort of)
Post by: TFM on 20:27, 22 July 13
Interesting project. You do write that lisp in C right?
Title: Re: zlisp running (sort of)
Post by: duncan_bayne on 00:11, 23 July 13
Quote from: fano on 19:50, 22 July 13
Nice ! parsing is the first step  ;)

Actually I did the cons cells & printing of same first, so I could hook up a rudimentary parser and see things running end to end.  E.g.:

https://github.com/duncan-bayne/zlisp/blob/master/tests/cons_cell_tests.c (https://github.com/duncan-bayne/zlisp/blob/master/tests/cons_cell_tests.c)
Title: Re: zlisp running (sort of)
Post by: duncan_bayne on 00:18, 23 July 13
Quote from: TFM/FS on 20:27, 22 July 13
Interesting project. You do write that lisp in C right?

Yes, except for a few bits of assembler to interface with the Amstrad firmware, e.g.:

https://github.com/duncan-bayne/zlisp/blob/master/src/amstext.s (https://github.com/duncan-bayne/zlisp/blob/master/src/amstext.s)

I'm still puzzling about how to give easy access to the complete firmware through Lisp.  I was thinking maybe inline machine code could be a first, hacky, approach:

(eval-z80 (#x3e #x65 #xcd #x5a #xbb #c9))

Which is somewhat horrible but could actually work pretty well for simple fragments.  Stuff like cassette or disc I/O would be better served with a proper Lisp library however.

Decisions, decisions ...
Powered by SMFPacks Menu Editor Mod