unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-user@gnu.org
Subject: Re: on bootstrapping: introducing Mes
Date: Tue, 21 Jun 2016 16:32:04 +0200	[thread overview]
Message-ID: <877fdi8vff.fsf@gnu.org> (raw)
In-Reply-To: 87twgp8mi5.fsf@gnu.org

Hi!

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> I have a minimal LISP-1.5-resembling interpreter in C that now can
> also interpret itself
>
>     https://gitlab.com/janneke/mes
>
> It was inspired by the seemingly often ignored bootstrapping question
> made so painfully visible by GuixSD and by OriansJ with their self
> hosting hex assembler project.

Sounds fun!

> As a next step after a hex assembler I was thinking of getting Scheme up
> and running and use that to create a tiny C compiler, probably using
> PEG.  For that I think we need define-syntax, which I had a peek at and
> still scares the all-sorts-of-things out of me :-)
>
> I searched for minimal Lisp/Scheme to get that going and found an
> article called the Maxwell Equations of Software 1) with a pointer to
> the 1962 LISP 1.5 paper by John McCarthy 2).
>
> First I `implemented' Mes/LISP-1.5: the bottom half of page 13 and the
> necessary helper procedures defined on pages 8-12 using Guile, removing
> all but the primitives needed to run LISP-1.5/Mes (I think): car, cdr,
> cond, cons, define, eq?, '()/nil, null?, pair? and quote.  I cheated
> with read, and with display and newline for debugging.
>
> Then I translated the program into C and got rid of read by using
> getchar/ungetchar.
>
> It's been great fun and now I'm kind of stuck a bit at the point of
> implementing macros.  I have a simplistic version in C but want to
> remove that again --I like the idea of having the absolute minimal LISP
> interpreter in C-- and only introduce macros after having bootstrapped
> into the LISP/Mes domain.

From a bootstrapping viewpoint, since Mes is in C, we’re back to the
same problem we have with Guile.  :-) Guile has an interpreter written
in C, for bootstrapping purposes, and it’s capable of running any kind
of Scheme code, I think, including the full macro expander.

To make the bootstrap Guile smaller, maybe we could remove .go files
from it and build them as the initial step.  That would be comparable to
the strategy you suggest, I think.

Cheers,
Ludo’.




  parent reply	other threads:[~2016-06-21 14:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-19 11:08 on bootstrapping: introducing Mes Jan Nieuwenhuizen
2016-06-20 17:47 ` Mike Bushroe
2016-06-21 17:07   ` Jan Nieuwenhuizen
2016-06-21 18:44     ` Mike Bushroe
2016-06-21 14:32 ` Ludovic Courtès [this message]
2016-06-21 16:36   ` Jan Nieuwenhuizen
2016-06-21 20:38     ` Ludovic Courtès
2016-06-26 21:17 ` Amirouche Boubekki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877fdi8vff.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).