Dear all,
As a hobby project, I am designing a 32-bit processor which I am
simulating using Common Lisp (mostly based upon SIMH ideas). Currently
I have a working simulation of a simple load/store instruction set, an
assembler and some simple test programs.
However, I want to go further. Last fall I implemented a simple Lisp
interpreter in Perl and now I want to implement a simple Lisp
interpreter on my simulated machine. However, I would like to
start with a Lisp description of all my necessary code and in order to
do that I would like to know if there are somewhere examples and
implementations of (Common) Lisp/Scheme code which
deal with structures in the C sense of the word (contiguous blocks of
memory with fields which are just offsets in the block) ?
Regards,
Jurgen
On Jun 4, 2:38 pm, jurgen_defurne <··············@pandora.be> wrote:
> Dear all,
>
> As a hobby project, I am designing a 32-bit processor which I am
> simulating using Common Lisp (mostly based upon SIMH ideas). Currently
> I have a working simulation of a simple load/store instruction set, an
> assembler and some simple test programs.
>
> However, I want to go further. Last fall I implemented a simple Lisp
> interpreter in Perl and now I want to implement a simple Lisp
> interpreter on my simulated machine. However, I would like to
> start with a Lisp description of all my necessary code and in order to
> do that I would like to know if there are somewhere examples and
> implementations of (Common) Lisp/Scheme code which
> deal with structures in the C sense of the word (contiguous blocks of
> memory with fields which are just offsets in the block) ?
>
> Regards,
>
> Jurgen
You can take a look at Movitz: http://common-lisp.net/project/movitz/
It is a Common Lisp implementation targeting bare x86 processors.
hth,
Alessio
On Jun 4, 2:53 pm, Alessio Stalla <·············@gmail.com> wrote:
> On Jun 4, 2:38 pm, jurgen_defurne <··············@pandora.be> wrote:
>
>
>
> > Dear all,
>
> > As a hobby project, I am designing a 32-bit processor which I am
> > simulating using Common Lisp (mostly based upon SIMH ideas). Currently
> > I have a working simulation of a simple load/store instruction set, an
> > assembler and some simple test programs.
>
> > However, I want to go further. Last fall I implemented a simple Lisp
> > interpreter in Perl and now I want to implement a simple Lisp
> > interpreter on my simulated machine. However, I would like to
> > start with a Lisp description of all my necessary code and in order to
> > do that I would like to know if there are somewhere examples and
> > implementations of (Common) Lisp/Scheme code which
> > deal with structures in the C sense of the word (contiguous blocks of
> > memory with fields which are just offsets in the block) ?
>
> > Regards,
>
> > Jurgen
>
> You can take a look at Movitz:http://common-lisp.net/project/movitz/
> It is a Common Lisp implementation targeting bare x86 processors.
>
> hth,
> Alessio
Silly me, I knew about Movitz, but forgot about it.
Thanks.
jurgen_defurne <··············@pandora.be> wrote:
+---------------
| As a hobby project, I am designing a 32-bit processor which I am
| simulating using Common Lisp (mostly based upon SIMH ideas). Currently
| I have a working simulation of a simple load/store instruction set, an
| assembler and some simple test programs.
+---------------
Neat!
+---------------
| However, I want to go further. Last fall I implemented a simple Lisp
| interpreter in Perl and now I want to implement a simple Lisp
| interpreter on my simulated machine. However, I would like to
| start with a Lisp description of all my necessary code and in order to
| do that I would like to know if there are somewhere examples and
| implementations of (Common) Lisp/Scheme code which
| deal with structures in the C sense of the word (contiguous blocks of
| memory with fields which are just offsets in the block) ?
+---------------
Please say a little more about exactly what you mean by "deal with
structures". Almost all Lisp/Scheme compilers/interpreters have some
sort of simple "deref+offset" operators down at the bottom of their
implementations. E.g., DEFSTRUCT accessors might be defined as closures
over a more primitive operator such as (an internal version of) ELT,
perhaps.
Also, in terms of generating code for a "raw" machine, make sure you've
read the chapters on compilation in both SICP <http://mitpress.mit.edu/sicp/>
and L.i.S.P. <http://www-spi.lip6.fr/~queinnec/WWW/LiSP.html> [and maybe
even the bits on compiling in PAIP <http://www.norvig.com/paip.html>].
-Rob
-----
Rob Warnock <····@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607
On Jun 5, 4:13 am, ····@rpw3.org (Rob Warnock) wrote:
> Please say a little more about exactly what you mean by "deal with
> structures". Almost all Lisp/Scheme compilers/interpreters have some
> sort of simple "deref+offset" operators down at the bottom of their
> implementations. E.g., DEFSTRUCT accessors might be defined as closures
> over a more primitive operator such as (an internal version of) ELT,
> perhaps.
Basically, this is it what you say, 'deref+offset', since every
programming language needs to be able to access its most basic
datastructure. Writing a primitive version of ELT is maybe enough to
start, plus something to access bit fields. You know, I am currently
just trying to get an orientation on things to do.
> Also, in terms of generating code for a "raw" machine, make sure you've
> read the chapters on compilation in both SICP <http://mitpress.mit.edu/sicp/>
> and L.i.S.P. <http://www-spi.lip6.fr/~queinnec/WWW/LiSP.html> [and maybe
> even the bits on compiling in PAIP <http://www.norvig.com/paip.html>].
These parts are in the future on my reading list. I have both SICP and
PiSL (the latest French version of LiSP) at home.
Regards,
Jurgen
On 5 Jun., 08:50, chthon <··············@pandora.be> wrote:
> On Jun 5, 4:13 am, ····@rpw3.org (Rob Warnock) wrote:
>
> > Please say a little more about exactly what you mean by "deal with
> > structures". Almost all Lisp/Scheme compilers/interpreters have some
> > sort of simple "deref+offset" operators down at the bottom of their
> > implementations. E.g., DEFSTRUCT accessors might be defined as closures
> > over a more primitive operator such as (an internal version of) ELT,
> > perhaps.
>
> Basically, this is it what you say, 'deref+offset', since every
> programming language needs to be able to access its most basic
> datastructure. Writing a primitive version of ELT is maybe enough to
> start, plus something to access bit fields. You know, I am currently
> just trying to get an orientation on things to do.
>
> > Also, in terms of generating code for a "raw" machine, make sure you've
> > read the chapters on compilation in both SICP <http://mitpress.mit.edu/sicp/>
> > and L.i.S.P. <http://www-spi.lip6.fr/~queinnec/WWW/LiSP.html> [and maybe
> > even the bits on compiling in PAIP <http://www.norvig.com/paip.html>].
>
> These parts are in the future on my reading list. I have both SICP and
> PiSL (the latest French version of LiSP) at home.
>
> Regards,
>
> Jurgen
For example:
http://ccl.clozure.com/ccl-documentation.html#Referencing-and-Using-Foreign-Memory-Addresses
http://ccl.clozure.com/ccl-documentation.html#id415320