unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Mes 0.5 released
@ 2017-04-27 12:17 Jan Nieuwenhuizen
  2017-04-28  7:59 ` Arne Babenhauserheide
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Nieuwenhuizen @ 2017-04-27 12:17 UTC (permalink / raw)
  To: guile-user; +Cc: guix-devel, epsilon-devel


I am pleased to announce the release of Mes 0.5, representing 249
commits over 4 months.  Mes is now self-hosting, or rather it features
a mutual self-hosting Scheme interpreter and C compiler: mes.c and
mescc; a Nyacc-based C compiler backend that also works separately
with Guile.

* About

    Mes aims to create full source bootstrapping for GuixSD: an
    entirely source-based bootstrap path.  The target is to [have
    GuixSD] boostrap from a minimal, easily inspectable binary --that
    should be readable as source-- into something close to R6RS
    Scheme.

    It currently consists of a mutual self-hosting [close to Guile-]
    Scheme interpreter prototype in C and a Nyacc-based C compiler in
    [Guile] Scheme.

    The Scheme interpreter prototype (mes.c) has a Garbage Collector,
    a library of loadable Scheme modules-- notably Dominique Boucher's
    LALR[1], Pre-R6RS portable syntax-case[2] with R7RS ellipsis, Matt
    Wette's Nyacc[3] Guile's PEG[4] --and test suite just barely
    enough to support a simple REPL (repl.mes) and simple C-compiler
    (mescc.mes) that can produce the second initial ELF binary from
    binary from mes.c, in only about 2h30'.

    Mes was inspired by The Maxwell Equations of Software: LISP-1.5[5]
    -- John McCarthy page 13, GNU Guix's[6] source/binary packaging
    transparency and Jeremiah Orians's stage0[7] bootstrap project.

* Download

    git clone https://gitlab.com/janneke/mes

    wget https://gitlab.com/janneke/mes/repository/archive.tar.gz?ref=v0.5 -O mes-0.5.tar.gz

Mes runs from the source tree and can also be built, packaged and
installed in Guix[SD] by the usual

    guix package -f guix.scm

* Changes in 0.5 since 0.4
 ** Core
 *** Support compilation with Mescc.
 *** Support compilation with -nostdinc, -nostdlib using mlibc.
 *** Support call-with-current-continuation.
 *** Support exception handling, catch/throw.
 *** Give sensible error message when a macro is missing.
 ** Language
 *** Map now supports 4 lists.
 *** The reader supports negative hex numbers.
 *** 24 new functions
 access?, assoc-set! c????r, compose, list->char-set,
 open-input-string, read-string, string-delete, with-throw-handler.
 ** Mescc
 *** Mescc can be used separately as a Nyacc-based C compiler backend for Guile.
 *** Switch to Nyacc frontend, update Nyacc to 0.76.5.
 *** Mescc now has a test suite, scaffold/t.c.
 *** Mescc now includes a minimal C library: libc/mlib.c libc/mstart.c.
 *** Mescc can now compile mes.c.
 ** Noteworthy bug fixes
 *** The build system (configure, make) has been refactored.
 *** Support map-4.
 *** Evaluate arguments of OR only once.
 *** Fix assq-set!
 *** Fix ,expand in the REPL.

Greetings,
janneke

[1] https://github.com/schemeway/lalr-scm
[2] https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html
[3] https://www.nongnu.org/nyacc/
[4] https://www.gnu.org/software/guile/docs/master/guile.html/PEG-Parsing.html
[5] http://www.softwarepreservation.org/projects/LISP/book/LISP%25201.5%2520Programmers%2520Manual.pdf
[6] https://www.gnu.org/software/guix/
[7] https://github.com/oriansj/stage0

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mes 0.5 released
  2017-04-27 12:17 Mes 0.5 released Jan Nieuwenhuizen
@ 2017-04-28  7:59 ` Arne Babenhauserheide
  2017-04-28  8:16   ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 7+ messages in thread
From: Arne Babenhauserheide @ 2017-04-28  7:59 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: guix-devel, guile-user, epsilon-devel


Jan Nieuwenhuizen writes:

> I am pleased to announce the release of Mes 0.5, representing 249
> commits over 4 months.  Mes is now self-hosting, or rather it features
> a mutual self-hosting Scheme interpreter and C compiler: mes.c and
> mescc; a Nyacc-based C compiler backend that also works separately
> with Guile.

Wow! Congratulation on full bootstrapping of mes!

So we can now build mes.c with mescc driven by Guile and then use mes to
run mescc again to build mes.c?

Best wishes,
Arne



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mes 0.5 released
  2017-04-28  7:59 ` Arne Babenhauserheide
@ 2017-04-28  8:16   ` Jan Nieuwenhuizen
  2017-04-30 20:03     ` Christopher Allan Webber
  2017-04-30 22:18     ` Matt Wette
  0 siblings, 2 replies; 7+ messages in thread
From: Jan Nieuwenhuizen @ 2017-04-28  8:16 UTC (permalink / raw)
  To: Arne Babenhauserheide; +Cc: guix-devel, guile-user, epsilon-devel

Arne Babenhauserheide writes:

> Wow! Congratulation on full bootstrapping of mes!

Thanks, Arne!

> So we can now build mes.c with mescc driven by Guile and then use mes to
> run mescc again to build mes.c?

Yes, that's correcct.  mes.c can be compiled with either gcc

    make out/mes

or with [32 bit] gcc -nostdinc -nostdlib

    make out/i686-unknown-linux-gnu-mes

or with guile

    guile/mescc.scm src/mes.c > out/mes.guile

or with mes

    scripts/mescc.mes src/mes.c > out/mes.mes

Now the route can go up (my first aim)

  - compile tcc, guile or gcc

or it can go down

  - add separate assembly step, assembly output
  - use stage0+ project, esp rewrite mes.c in stage2-LISP
  - use/work with epsilon?

or it can stay level

  - cleanup mescc
  - fix bugs
  - look into Nyacc
  - decide on psyntax

Greetings,
janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mes 0.5 released
  2017-04-28  8:16   ` Jan Nieuwenhuizen
@ 2017-04-30 20:03     ` Christopher Allan Webber
  2017-05-02  5:54       ` Jan Nieuwenhuizen
  2017-04-30 22:18     ` Matt Wette
  1 sibling, 1 reply; 7+ messages in thread
From: Christopher Allan Webber @ 2017-04-30 20:03 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: guix-devel, epsilon-devel, guile-user

Jan Nieuwenhuizen writes:

> Arne Babenhauserheide writes:
>
>> Wow! Congratulation on full bootstrapping of mes!
>
> Thanks, Arne!
>
>> So we can now build mes.c with mescc driven by Guile and then use mes to
>> run mescc again to build mes.c?
>
> Yes, that's correcct.  mes.c can be compiled with either gcc
>
>     make out/mes
>
> or with [32 bit] gcc -nostdinc -nostdlib
>
>     make out/i686-unknown-linux-gnu-mes
>
> or with guile
>
>     guile/mescc.scm src/mes.c > out/mes.guile
>
> or with mes
>
>     scripts/mescc.mes src/mes.c > out/mes.mes
>
> Now the route can go up (my first aim)
>
>   - compile tcc, guile or gcc
>
> or it can go down
>
>   - add separate assembly step, assembly output
>   - use stage0+ project, esp rewrite mes.c in stage2-LISP
>   - use/work with epsilon?
>
> or it can stay level
>
>   - cleanup mescc
>   - fix bugs
>   - look into Nyacc
>   - decide on psyntax
>
> Greetings,
> janneke

Wow... what a list...

This is really incredible work!  Fully bootstrappable Guix is looking
more and more feasible!



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mes 0.5 released
  2017-04-28  8:16   ` Jan Nieuwenhuizen
  2017-04-30 20:03     ` Christopher Allan Webber
@ 2017-04-30 22:18     ` Matt Wette
  2017-05-02  5:48       ` syntax-case in bootstrap path? -- " Jan Nieuwenhuizen
  1 sibling, 1 reply; 7+ messages in thread
From: Matt Wette @ 2017-04-30 22:18 UTC (permalink / raw)
  To: guile-user


> On Apr 28, 2017, at 1:16 AM, Jan Nieuwenhuizen <janneke@gnu.org> wrote:
>  - cleanup mescc
>  - fix bugs
>  - look into Nyacc
>  - decide on psyntax
> 

I looked at your setup.  You could look at stripping down nyacc, if you trust the lang/c99/mach.scm grammar, then you don’t need lair.scm (and hence no psyntax (define-syntax) for lalr.scm.  

Once you use lalr.scm to convert mach.scm to xxxtab.scm (parse tables) and xxxact.acm (parse actions) you create a parser that uses the xxxact.scm and xxxtab.scm files only (no lalr.scm or mach.scm)

Matt




^ permalink raw reply	[flat|nested] 7+ messages in thread

* syntax-case in bootstrap path? -- Re: Mes 0.5 released
  2017-04-30 22:18     ` Matt Wette
@ 2017-05-02  5:48       ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Nieuwenhuizen @ 2017-05-02  5:48 UTC (permalink / raw)
  To: Matt Wette; +Cc: guile-user

Matt Wette writes

>>  - look into Nyacc
>>  - decide on psyntax
>
> I looked at your setup.  You could look at stripping down nyacc, if
> you trust the lang/c99/mach.scm grammar, then you don’t need lair.scm
> (and hence no psyntax (define-syntax) for lalr.scm.

It would really be a great help for bootstrapping if we could run Nyacc
for Mes without syntax-case.  Mes implements syntax-case using a variant
of the old portable psyntax[1].  I assume you have seen the psyntax.pp
output?  It looks like scheme, but I would classify it as binary, not as
source.

Sadly, I haven't found a way yet to have syntax implemented without
psyntax.  Although `it works', using psyntax currently introduces a
binary into our bootstrapping path, that I'd want to get rid of.  Note
that I do have a full source implementation of define-syntax with
syntax-rules.

> Once you use lalr.scm to convert mach.scm to xxxtab.scm (parse tables)
> and xxxact.acm (parse actions) you create a parser that uses the
> xxxact.scm and xxxtab.scm files only (no lalr.scm or mach.scm)

Thanks for looking into this!  So from this macro

    module/nyacc/lalr.scm (lalr-spec):
    ;; @deffn {Syntax} lalr-spec grammar => spec
    ;; This routine reads a grammar in a scheme-like syntax and returns an a-list.
    ;; This spec' can be an input for @item{make-parser-generator} or 
    ;; @item{pp-spec}.

we would only need its result, the a-list?  It could even be that's what
Mes is doing right now; I don't think Mes is generated these tables;
it's tables like these, right?

    module/nyacc/lang/c99/mach.d/c99tab.scm:
    (define c99-pat-v
      #(((103 . 1) (182 . 2) (95 . -281) (-1 . -281)) ((22 . 3) (28 . 4) (29 . 5
        ) (30 . 6) (31 . 7) (32 . 8) (33 . 9) (34 . 10) (35 . 11) (36 . 12) (38 . 
        13) (37 . 14) (40 . 15) (24 . 16) (25 . 17) (26 . 18) (27 . 19) (138 . 20)
    ... 
    (define c99-rto-v
      #(#f 177 177 177 177 176 176 176 176 176 176 176 176 176 176 175 175 175 
        175 171 171 168 168 168 168 168 168 167 167 167 167 167 167 166 166 165 
        165 165 165 164 164 164 163 163 163 162 162 162 162 162 161 161 161 160 

Anyway, if we are going to use generated a-lists (jump tables?) to avoid
having to use psyntax because it's too opaque to qualify as source,
aren't we introducing another binary blob into the bootstap path with
this?

Greetings,
janneke

[1] psyntax https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Mes 0.5 released
  2017-04-30 20:03     ` Christopher Allan Webber
@ 2017-05-02  5:54       ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Nieuwenhuizen @ 2017-05-02  5:54 UTC (permalink / raw)
  To: Christopher Allan Webber
  Cc: guix-devel, Arne Babenhauserheide, epsilon-devel, guile-user

Christopher Allan Webber writes:

> Wow... what a list...
>
> This is really incredible work!  Fully bootstrappable Guix is looking
> more and more feasible!

:-)
thanks!
--janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-05-02  5:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27 12:17 Mes 0.5 released Jan Nieuwenhuizen
2017-04-28  7:59 ` Arne Babenhauserheide
2017-04-28  8:16   ` Jan Nieuwenhuizen
2017-04-30 20:03     ` Christopher Allan Webber
2017-05-02  5:54       ` Jan Nieuwenhuizen
2017-04-30 22:18     ` Matt Wette
2017-05-02  5:48       ` syntax-case in bootstrap path? -- " Jan Nieuwenhuizen

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).