diff --git a/HACKING b/HACKING index d9e40bd4..399f3f29 100644 --- a/HACKING +++ b/HACKING @@ -39,14 +39,22 @@ generates several recipies of sh build scripts in out/. * ROADMAP ** TODO +*** release 0.8 + - move from lambda-based .o format to stage0's hex2. + - use stage0's linker to produce ELF. + - simplify [at least bootstrap] build process. *** release 0.x, unsorted - - discuss full source bootstrap strategy on guile-user with Jeremiah - Orians (stage0+) Luca Saiu (GNU Epsilon). - - fix bugs - - produce intermediate annotated assembly-like mes.S - - and/or: connect to OriansJ's stage0...LISP bootstrapping tools + - seamless connection to stage0. + - mescc: compile tcc.c. + - mescc: support unsigned comparison, arithmetic. + - mescc: support bitfields. + - mescc: support unions. + - mescc: support anonymous unions. + - mescc: refactor compiler.mes, esp. (decl ..) bits. + - rewrite src/mes.c in stage0's stage2 LISP. + - and/or: rewrite src/mes.c in [annotated] assembly. + - and/or: rewrite src/mes.c in annotated hex2. - and/or: connect to GNU Epsilon's VM - - and/or: translate Mes.c interpreter into VM - and/or: compile Scheme to C, rewrite Mes.c into Mes.scm. - real module support, bonus for supporting Guile's define-module/define-public syntax - get full source syntax-case up (Andre van Tonder?) OR drop @@ -60,6 +68,9 @@ generates several recipies of sh build scripts in out/. - work to replace GuixSD's bootstrap binaries for x86 - more architectures? ** DONE +** 0.7: Mescc supports -E, -c, -o options, include more complete set of header files, +enough to work on compiling tinycc's tcc.c albeit a somewhat modified version. +** 0.6: Work with unmodified, unbundled Nyacc; compile 33/55 tinycc's tests/test2 suite. ** 0.5: Mutual self-hosting Scheme interpreter and C compiler: mes.c and mescc, Support call-with-current-continuation, refactor catch/throw ** 0.4: Support Nyacc, Gcc-compiled Mes compiles minimal main.c using nyacc @@ -193,3 +204,17 @@ https://web.archive.org/web/20160604041431/http://homepage.ntlworld.com/edmund.g https://github.com/rswier/c4/blob/master/c4.c ** Compilers for free http://codon.com/compilers-for-free +** Small lisps +*** [[https://www.mirrorservice.org/sites/www.bitsavers.org/bits/TI/Explorer/zeta-c/][ZETA-C]] +** Small C compilers +*** tinycc +*** [[https://github.com/rui314/8cc][8cc]] -- a C11 compiler, but simple +8cc is a compiler for the C programming language. It's intended to +support all C11 language features while keeping the code as small and +simple as possible. +*** pcc +*** early GCC? +*** [[http://tack.sourceforge.net/][ack]] + it may be possible to compile like this: mes |> ack |> pcc |> tcc |> + gcc 4.7.4 |> gcc later version... up to modern +** rain1's Bootstrapping Wiki: https://bootstrapping.miraheze.org/wiki/Main_Page diff --git a/INSTALL b/INSTALL index abf5202c..b27bb483 100644 --- a/INSTALL +++ b/INSTALL @@ -38,12 +38,18 @@ Let's just say for now that it gets awkward without a shell. * Build it ./configure - make all + make + +** For a quick build, skip running mescc on Mes + make MES_SKIP_MES=1 * Check it make check +** For a quick check, skip running mescc on Mes + make MES_SKIP_MES=1 + * Install it make install diff --git a/NEWS b/NEWS index 1d24a377..167fd308 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,34 @@ Copyright © 2016,2017 Jan Nieuwenhuizen Please send Mes bug reports to janneke@gnu.org. +* Changes in 0.7 since 0.6 +** Core +*** The minimal C reader is now always included; dependencies +on i686-unknown-linux-gnu-gcc and binary read-0-32.mo have been +dropped, these are now optional. +** Language +*** Mes reader now supports octal numbers #oXXX. +*** 10 new functions +current-output-port, getopt-long, negate, open-output-file, +option-ref, set-current-output-port, string-rindex, string-suffix?, +with-ouwith-output-to-file, with-output-to-port. +** Mescc +*** Mescc can now be installed and used alongside a gcc installation. +*** Mescc can now handle const anywhere. +*** Mescc now supports array fields in structs. +*** Mescc now supports forward declarations and typedef. +*** Mescc can now handle comments anywhere. +*** Mescc now supports addition and substraction for enum field values. +*** Mescc now supports anonymous enums. +*** Mescc now supports all C99 header files needed to compile tcc.c. +*** build: C sources are now preprocessed separately, then compiled and linked. +*** build: mlibc and C sources are now compiled separately and then linked. +*** mlibc has been moved from Scheme snippets into C. +*** Mescc now supports -c, -D, -E, -I and -o options. +**** open now supports optional third mode parameter. +** Noteworthy bug fixes +*** string-index now supports function predicate. +*** number->string for radix > 10 now produces `a' instead of `:'. * Changes in 0.6 since 0.5 ** Core *** configure, build now supports x86 and development for arm with-courage. diff --git a/doc/ANNOUNCE-0.6 b/doc/ANNOUNCE-0.6 index a4bb0386..38a55ff8 100644 --- a/doc/ANNOUNCE-0.6 +++ b/doc/ANNOUNCE-0.6 @@ -1,7 +1,7 @@ Subject: Mes 0.6 released I am pleased to announce the release of Mes 0.6, representing 32 -commits over 17 days. Mescc now works with vanilla Nyacc 0.78.3 +commits over 24 days. Mescc now works with vanilla Nyacc 0.78.3 (thanks Matt!), Nyacc has been unbundled and Mescc compiles 33/55 of tinycc test2 tests. diff --git a/doc/ANNOUNCE-0.7 b/doc/ANNOUNCE-0.7 new file mode 100644 index 00000000..3f8e5812 --- /dev/null +++ b/doc/ANNOUNCE-0.7 @@ -0,0 +1,83 @@ +Subject: Mes 0.7 released + +I am pleased to announce the release of Mes 0.7, representing 32 +commits over 4 weeks. Mescc now behaves more like a regular C +compiler: supporting -E, -c, -o options and with a more complete set +of header files [stubs]; enough to work on compiling tinycc's tcc.c +albeit a somewhat modified version[8]. + +* 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.7 -O mes-0.7.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.7 since 0.6 + ** Core + *** The minimal C reader is now always included; dependencies + on i686-unknown-linux-gnu-gcc and binary read-0-32.mo have been + dropped, these are now optional. + ** Language + *** Mes reader now supports octal numbers #oXXX. + *** 10 new functions + current-output-port, getopt-long, negate, open-output-file, + option-ref, set-current-output-port, string-rindex, string-suffix?, + with-ouwith-output-to-file, with-output-to-port. + ** Mescc + *** Mescc can now be installed and used alongside a gcc installation. + *** Mescc can now handle const anywhere. + *** Mescc now supports array fields in structs. + *** Mescc now supports forward declarations and typedef. + *** Mescc can now handle comments anywhere. + *** Mescc now supports addition and substraction for enum field values. + *** Mescc now supports anonymous enums. + *** Mescc now supports all C99 header files needed to compile tcc.c. + *** build: C sources are now preprocessed separately, then compiled and linked. + *** build: mlibc and C sources are now compiled separately and then linked. + *** mlibc has been moved from Scheme snippets into C. + *** Mescc now supports -c, -D, -E, -I and -o options. + **** open now supports optional third mode parameter. + ** Noteworthy bug fixes + *** string-index now supports function predicate. + *** number->string for radix > 10 now produces `a' instead of `:'. + +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 +[8] https://gitlab.com/janneke/tinycc