f68b169feb
* ChangeLog: Add copyright header. * build-aux/GNUmakefile.in (generate-ChangeLog): Append it as copyright footer. * BOOTSTRAP: Add copyright header. * scaffold/boot/2f-define-second-lambda.scm: Likewise. * scaffold/boot/39-global-define-override.scm: Likewise. * scaffold/boot/3a-global-define-lambda-override.scm: Likewise. * scaffold/boot/4f-string-split.scm: Likewise. * scaffold/boot/numbers.scm: Likewise. * scaffold/gc.scm: Likewise. * scaffold/b-0.mes: Remove. * doc/GNU-EVAL-APPLY: Remove. * doc/announce/README: New file. * doc/announce/ANNOUNCE: Move from doc/ANNOUNCE. * doc/announce/ANNOUNCE-0.10: Likewise. * doc/announce/ANNOUNCE-0.11: Likewise. * doc/announce/ANNOUNCE-0.12: Likewise. * doc/announce/ANNOUNCE-0.13: Likewise. * doc/announce/ANNOUNCE-0.14: Likewise. * doc/announce/ANNOUNCE-0.15: Likewise. * doc/announce/ANNOUNCE-0.16: Likewise. * doc/announce/ANNOUNCE-0.3: Likewise. * doc/announce/ANNOUNCE-0.4: Likewise. * doc/announce/ANNOUNCE-0.5: Likewise. * doc/announce/ANNOUNCE-0.6: Likewise. * doc/announce/ANNOUNCE-0.7: Likewise. * doc/announce/ANNOUNCE-0.8: Likewise. * doc/announce/ANNOUNCE-0.9: Likewise. * doc/announce/ANNOUNCE-2: Likewise. * doc/announce/UPDATE-0.13: Likewise. * doc/fosdem/README: New file. * doc/fosdem/fosdem.org: Add legalese. * doc/fosdem/fosdem.pdf: Regenerate. * doc/images/README: New file. * mes/module/mes/psyntax.pp.header: New file. * mes/module/mes/psyntax.pp: Add it to generated file.
88 lines
3.5 KiB
Plaintext
88 lines
3.5 KiB
Plaintext
Subject: on bootstrapping: 2nd status report on Mes
|
|
Date: Sun, 25 Sep 2016 13:52:11 +0200
|
|
|
|
Hi!
|
|
|
|
In June I announced[0] Mes as a project that seeks to reduce the size of/
|
|
dependency on bootstrap binaries, esp. for a system like GuixSD
|
|
|
|
The strategy was to create a minimal trusted binary (prototyped in C but
|
|
eventually to be hand-crafted in assembly/hex) that interpets a minimal
|
|
LISP. Then using this minimal but already convenient LISP, extend it
|
|
into Scheme and write a tiny C compiler/linker.
|
|
|
|
Last time I had a minimal LISP-1.5-resembling interpreter in 900 lines
|
|
of C that could interpret itself and an extension layer written in LISP
|
|
providing a minimal Scheme environment. I was stuck on adding macros in
|
|
LISP and had a broken macro implentation in C that I wanted to remove.
|
|
Also I hoped to greatly reduce the size of the C part.
|
|
|
|
New status[1]
|
|
|
|
* Provide Scheme primitives directly in 1400 lines of C
|
|
* Remove LISP-1.5 staging
|
|
* closures clue-bat, fixing bugs in begin, lambda, lexical
|
|
scoping etc. ... learned a lot!
|
|
* quasiquote, unquote, unquote-splicing (in C, too slow in Scheme)
|
|
* define-macro (in C)
|
|
* define-syntax, syntax-rules (in Scheme, using define-macro)
|
|
* all primitives needed to run LALR (strings, vectors, records,
|
|
some srfi bits; mostly in Scheme)
|
|
* test suite with 97 tests that run with Mes and also with Guile
|
|
* minimal and partial ANSI C parser for hello world
|
|
* minimal and simplistic 32 bit elf c-ast->elf generator
|
|
|
|
Mes can now create a running 32-bit elf binary from this hello
|
|
world C source with a simplistic for loop
|
|
|
|
int main ()
|
|
{
|
|
int i;
|
|
puts ("Hi Mes!\n");
|
|
for (i = 0; i < 4; ++i)
|
|
puts (" Hello, world!\n");
|
|
return 1;
|
|
}
|
|
|
|
It takes Mes 1'20" to compile this program, Guile takes 0.5 seconds.
|
|
|
|
* cannot get psyntax.pp hooked-up or running
|
|
* do not understand syntax stuff [well enough] to implement in C
|
|
-> no let-syntax, no MATCH
|
|
-> no syntax-case, no PEG parser
|
|
|
|
In theory the bootstrapping problem I set out to solve seems to be
|
|
cracked. The remaining problem is reduced to `just work':
|
|
implementing a minimal C compiler in Scheme. Questions here: I'm not
|
|
convinced yet that this is a meaningful project...aaand I really not
|
|
want to tackle this without having MATCH, which Mes does not have yet.
|
|
|
|
Of the possible directions that I see
|
|
|
|
0 write the C compiler in Scheme without match
|
|
1 rewrite match without let-syntax
|
|
2 grok+write let-syntax/syntax-case using define-macro, some bits in C
|
|
3 run and hook-up psyntax.pp...BUT that would probably require:
|
|
4 address performance problem, possibly by
|
|
5 rewrite Mes into a VM-based solution
|
|
|
|
none I find really attractive. Option 5, a VM is proven to work but
|
|
that's quite a change of direction. Looking at other VM-based projects
|
|
(e.g. GNU Epsilon[2]) I fear that this must result in a much larger code
|
|
base in C, throwing out the minimal trusted binary idea. The other
|
|
puzzles and work 0, 2 or 3 still need to be done.
|
|
|
|
However, diving into syntax-macro or eval work (2 or 3) most probably
|
|
needs the performance issue addressed. And if it turns out that a big
|
|
VM solution is needed, that may still invalidate this project after
|
|
having done even more work.
|
|
|
|
Help! :-) Ideas?
|
|
|
|
Greetings,
|
|
Jan
|
|
|
|
[0] https://lists.gnu.org/archive/html/guile-user/2016-06/msg00061.html
|
|
[1] https://gitlab.com/janneke/mes
|
|
[2] http://git.savannah.gnu.org/cgit/epsilon.git
|