doc: Release udpate.

* HACKING: Update.
* INSTALL: Update.
* NEWS: Update.
* README: Update.
* doc/ANNOUNCE-0.9: New file.
* make.scm: Install it.
* guix.scm (mescc-tools): Bump to 0.2.
This commit is contained in:
Jan Nieuwenhuizen 2017-07-09 18:40:12 +02:00
parent 4b1de28449
commit e1e8f03735
9 changed files with 197 additions and 58 deletions

41
HACKING
View file

@ -13,9 +13,12 @@ To help development we assume ./configure sets these variables for make
CC -- gcc CC -- gcc
CC32 -- i686-unknown-linux-gnu-gcc (or on x86, also gcc) CC32 -- i686-unknown-linux-gnu-gcc (or on x86, also gcc)
GUILE -- guile GUILE -- guile
HEX2 -- hex2
MES -- unset MES -- unset
M1 -- M1
PREFIX -- ""
Mes is supposed to serve as a full equivalent for GUILE, however mes is much, much Mes is supposed to serve as a full equivalent for Guile, however mes is much, much
slower than guile. That's why we usually don't use mes during development. slower than guile. That's why we usually don't use mes during development.
gcc is used to verify the sanity of our C sources. gcc is used to verify the sanity of our C sources.
@ -23,50 +26,46 @@ gcc is used to verify the sanity of our C sources.
i686-unknown-linux-gnu-gcc is used to compare hex/assembly, to test i686-unknown-linux-gnu-gcc is used to compare hex/assembly, to test
the gcc variant of mlbic: mlibc/libc-gcc.c and steal ideas. the gcc variant of mlbic: mlibc/libc-gcc.c and steal ideas.
guile is used to develop mescc, the C compiler in Scheme that during Guile is used to develop mescc, the C compiler in Scheme that during
bootstrapping will be executed by mes. bootstrapping will be executed by mes.
** BOOTSTRAP BUILD ** BOOTSTRAP BUILD
In bootstrap mode, we don't have gcc (CC), we don't have pa 32 bit gcc In bootstrap mode, we don't have gcc (CC), we don't have pa 32 bit gcc
(CC32), we have no guile (GUILE)...but we should have a bootstrap mes (CC32), we have no guile (GUILE)...but we should have hex2, M1, and
(MES). FIXME. FIXME: mes.M1.
mes is built from src/*.c and some out/src/*.h files that are snarfed from mes is built from src/*.c and some out/src/*.h files that are snarfed from
src/*.c by build-aux/mes-snarf.scm. src/*.c by build-aux/mes-snarf.scm.
Also, during bootstrap we don't have make. Running `make build-scripts' Running ./make.scm produces a `script' file.
generates several recipies of sh build scripts in out/.
* ROADMAP * ROADMAP
** TODO ** TODO
*** release 0.8 *** release 0.10
- produce ELF_sym and ELF_str tables from hex2; nicer for objdump -d, gdb - mescc: compile minimal main.c with tcc.mes https://gitlab.com/janneke/tinycc wip-mescc
*** release 0.x, unsorted *** release 0.x, unsorted
- simplify [at least the bootstrap] build process.
- seamless connection to stage0.
- mescc: compile tcc.c.
- mescc: support unsigned comparison, arithmetic. - mescc: support unsigned comparison, arithmetic.
- mescc: support bitfields. - mescc: support bitfields.
- mescc: support unions. - mescc: support floats.
- mescc: support anonymous unions. - mescc: some success with 8cc/pcc/libguile/eval.c.
- mescc: refactor compiler.mes, esp. (decl ..) bits. - build: guile/guix/make.scm: add file-types, intermediate, hash all dependencies
- build: make.scm: imperative->declaritive
- hex2: produce ELF_sym and ELF_str tables from hex2; nicer for objdump -d, gdb (in mescc-tools?)
- rewrite src/mes.c in stage0's stage2 LISP. - rewrite src/mes.c in stage0's stage2 LISP.
- and/or: rewrite src/mes.c in [annotated] assembly. - and/or: rewrite src/mes.c M1
- and/or: rewrite src/mes.c in annotated hex2.
- and/or: connect to GNU Epsilon's VM - and/or: connect to GNU Epsilon's VM
- and/or: compile Scheme to C, rewrite Mes.c into Mes.scm. - 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 - real module support, bonus for supporting Guile's define-module/define-public syntax
- get full source syntax-case up (Andre van Tonder?) OR drop - get full source syntax-case up (Andre van Tonder?) OR drop it
psyntax/syntax-case and rewrite Nyacc without syntax-case+R7RS Ellipsis psyntax/syntax-case and rewrite Nyacc without syntax-case+R7RS Ellipsis
- support regexp OR rewrite Nyacc without regexps - support regexp OR rewrite Nyacc without regexps
- split-off Guile C compiler as standalone Guile project, still - split-off Guile C compiler as standalone Guile project
respecting no-syntax-case bootstrap requirement
*** Compile the [[https://en.wikipedia.org/wiki/Tiny_C_Compiler][Tiny C Compiler]]
- build tcc (tinycc)
*** release 1.0 *** release 1.0
- work to replace GuixSD's bootstrap binaries for x86 - work to replace GuixSD's bootstrap binaries for x86
- more architectures? - more architectures?
** DONE ** DONE
** 0.9: Mescc now writes M1 macro assembly files and compiles tcc.
** 0.8: Mescc now writes object files in stage0's labeled hex2 format.
** 0.7: Mescc supports -E, -c, -o options, include more complete set of header files, ** 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. 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.6: Work with unmodified, unbundled Nyacc; compile 33/55 tinycc's tests/test2 suite.

13
INSTALL
View file

@ -7,10 +7,10 @@ Building and Installing Mes
* Prerequisites * Prerequisites
** Bootstrapping ** Bootstrapping
For bootstrapping, the only dependency is the hex2 linker For bootstrapping, the M1 macro assembler and hex2 linker and Nyacc
*** [[https://github.com/oriansj/MESCC_Tools][MESCC_Tools]], 0.1 is known to work. *** [[https://github.com/oriansj/MESCC_Tools][MESCC_Tools]], 0.2 is known to work.
*** [[https://savannah.gnu.org/projects/nyacc][Nyacc]], 0.80.3 is known to work.
For development For development
**
** Development ** Development
For development, there are some more dependencies. For development, there are some more dependencies.
*** Guix *** Guix
@ -19,11 +19,8 @@ For development, there are some more dependencies.
guix environment --system=i686-linux -l guix.scm #32 bit only guix environment --system=i686-linux -l guix.scm #32 bit only
*** Other GNU/Linux *** Other GNU/Linux
**** [[https://github.com/oriansj/MESCC_Tools][MESCC_Tools]], 0.0 is known to work. **** [[https://github.com/oriansj/MESCC_Tools][MESCC_Tools]], 0.2 is known to work.
**** [[https://savannah.gnu.org/projects/nyacc][Nyacc]], 0.80.3 is known to work.
**** [[https://savannah.gnu.org/projects/nyacc][Nyacc]], 0.78.0 is known to work.
Matt Wette's C99 LALR parser.
**** GNU Gcc, 4.9.3 is known to work. **** GNU Gcc, 4.9.3 is known to work.
The idea is to drop this requirement, of course. The idea is to drop this requirement, of course.

35
NEWS
View file

@ -10,6 +10,41 @@ Copyright © 2016,2017 Jan Nieuwenhuizen <janneke@gnu.org>
Please send Mes bug reports to janneke@gnu.org. Please send Mes bug reports to janneke@gnu.org.
* Changes in 0.9 since 0.8
** Core
*** Mes now builds better in non-Guix[SD] legacy distros/environments. Thanks, rain1!
** Mescc
*** Mescc now compiles a modified tinycc into a running [mostly segfaulting] tcc.mes.
https://gitlab.com/janneke/tinycc branch wip-mescc.
*** Mescc now supports locals stack frame larger than 1 byte offset.
*** Mescc now supports incomplete struct initializers {0}.
*** Mescc now supports >>=, <<=, ^=, ~.
*** Mescc now supports the comma operator.
*** Mescc now supports mullti-line string initializers.
*** Mescc now supports unions.
*** Mescc now supports arrays in structs.
*** Mescc now supports structs in structs.
*** Mescc now builds and runs with Guile-2.0 (legacy distro support, Guile-2.2 recommended).
*** Mescc has been refactored to use records.
*** Mescc now bundles tinycc's test2 test suite, passes one more test [34/55 pass].
*** Mescc now has an incremental test suite consisting of 56 tests.
*** Mescc now supports stdarg variable argument lists.
*** Mescc now has __GNUC__ unset, #f (WAS: 0).
*** Mescc now depends on Nyacc 0.80.3.
*** Mescc now depends on M1 from [[https://github.com/oriansj/MESCC_Tools][MESCC_Tools]] v0.2.
*** Mescc now compiles to M1 object files.
**** 7 new mlibc functions
calloc, close, getcwd, lseek, sprintf, unlink, vprintf.
**** 31 new mlibc stubs
execvp, fclose, fdopen, fflush, fopen, fprintf, fread, free, fseek,
ftell, fwrite, localtime, longjmp, memcpy, memmove, memmove, memset,
qsort, remove, setjump, snprintf, sscanf, strchr, strrchr, strstr,
strtol, strtoll, strtoul, strtoull, time, vnsprintf.
**** 10 new header files
alloca.h, float.h, libgen.h, locale.h, stdbool.h, stddef.h, stdint.h,
stdnoreturn.h, sys/select.h, sys/wait.h.
** Noteworthy bug fixes
*** Many bugs and limitations in mescc have been fixed and removed.
* Changes in 0.8 since 0.7 * Changes in 0.8 since 0.7
** Mescc ** Mescc
*** Mescc now has experimental annotation support for hex2. *** Mescc now has experimental annotation support for hex2.

40
README
View file

@ -1,26 +1,38 @@
-*- org -*- -*- org -*-
Mes -- Maxwell Equations of Software Mes -- Maxwell Equations of Software
Mes aims to create full source bootstrapping for GuixSD: an entirely [[https://gitlab.com/janneke/mes][Mes]] aims to create full source bootstrapping for [[https://www.gnu.org/software/guix][GuixSD]] as part of the
source-based bootstrap path. The target is to [have GuixSD] boostrap [[http://bootstrappable.org][bootstrappable builds]] effort.
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-] It currently consists of a mutual self-hosting [close to Guile-]
Scheme interpreter prototype in C and a Nyacc-based C compiler in Scheme interpreter prototype in C and a Nyacc-based C compiler in
[Guile] Scheme. [Guile] Scheme. This C prototype will be rewritten in [[https://github.com/oriansj/stage0][stage0]] M1
assembly (or possibly stage2 slow-LISP, or ...).
The Scheme interpreter prototype (mes.c) has a Garbage Collector, a The Scheme interpreter prototype (mes.c) has a Garbage Collector, a
library of loadable Scheme modules-- notably [[https://github.com/schemeway/lalr-scm][Dominique Boucher's LALR]], library of loadable Scheme modules-- notably Dominique Boucher's [[https://github.com/schemeway/lalr-scm][LALR]],
[[https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html][Pre-R6RS portable syntax-case]] with R7RS ellipsis, [[http://www.nongnu.org/nyacc/][Matt Wette's Nyacc]] Pre-R6RS [[https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html][portable syntax-case]] with R7RS ellipsis, Matt Wette's [[https://www.nongnu.org/nyacc][Nyacc]],
and [[https://www.gnu.org/software/guile/docs/master/guile.html/PEG-Parsing.html][Guile's PEG]] --and test suite just barely enough to support a Guile's [[https://www.gnu.org/software/guile/docs/master/guile.html/PEG-Parsing.html][PEG]] --and test suite just barely enough to support a simple
simple REPL (repl.mes) and simple C-compiler (mescc.mes) that can REPL (repl.mes) and simple C-compiler (mescc.mes).
produce the second initial ELF binary from binary from mes.c, in only
about 2h30'.
Mes is inspired by The Maxwell Equations of Software: [[http://www.softwarepreservation.org/projects/LISP/book/LISP%25201.5%2520Programmers%2520Manual.pdf][LISP-1.5]] -- John The simple C compiler can now compile a [[https://gitlab.com/janneke/tinycc][modified TinyCC]]. This needs
McCarthy page 13, [[https://www.gnu.org/software/guix/][GNU Guix's]] source/binary packaging transparency and more work. A with gcc compiled tcc is [[https://lists.gnu.org/archive/html/tinycc-devel/2017-05/msg00103.html][known]] to compile GCC.
[[https://github.com/oriansj/stage0][Jeremiah Orians's stage0]] bootstrap project.
Mes is inspired by The Maxwell Equations of Software: [[http://www.softwarepreservation.org/projects/LISP/book/LISP%2525201.5%252520Programmers%252520Manual.pdf][LISP-1.5]] -- John
McCarthy page 13, GNU Guix's source/binary packaging transparency and
Jeremiah Orians's stage0 ~300 byte self-hosting hex assembler.
[0] https://gitlab.com/janneke/mes
[1] https://www.gnu.org/software/guix
[2] http://bootstrappable.org
[3] https://github.com/oriansj/stage0
[4] https://github.com/schemeway/lalr-scm
[5] https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html
[6] https://www.nongnu.org/nyacc
[7] https://www.gnu.org/software/guile/docs/master/guile.html/PEG-Parsing.html
[8] https://gitlab.com/janneke/tinycc
[9] https://lists.gnu.org/archive/html/tinycc-devel/2017-05/msg00103.html
[10] http://www.softwarepreservation.org/projects/LISP/book/LISP%25201.5%2520Programmers%2520Manual.pdf
Mes is free software, it is distributed under the terms of the GNU Mes is free software, it is distributed under the terms of the GNU
General Public Licence version 3 or later. See the file COPYING. General Public Licence version 3 or later. See the file COPYING.

4
configure vendored
View file

@ -174,7 +174,7 @@ exec ${GUILE} --no-auto-compile -L $(pwd) -C $(pwd) -e 'main' -s "$0" ${1+"$@"}
(if (member ARCH '("i686" "arm")) (string-append BUILD_TRIPLET "-" CC) (if (member ARCH '("i686" "arm")) (string-append BUILD_TRIPLET "-" CC)
"i686-unknown-linux-gnu-gcc"))) "i686-unknown-linux-gnu-gcc")))
(define HEX2 (or (getenv "HEX2") "hex2")) (define HEX2 (or (getenv "HEX2") "hex2"))
(define M1 (or (getenv "M1") "M0")) (define M1 (or (getenv "M1") "M1"))
(define (parse-opts args) (define (parse-opts args)
(let* ((option-spec (let* ((option-spec
@ -220,7 +220,7 @@ Usage: ./configure [OPTION]...
(set! *verbose?* verbose?) (set! *verbose?* verbose?)
(check-version 'guile '(2 0)) (check-version 'guile '(2 0))
(check-version HEX2 '(0 1)) (check-version HEX2 '(0 1))
;;(check-version M1 '(0 1)) ;; FIXME: 0xXX: bump to 0.2 (check-version M1 '(0 2))
(check-version 'nyacc '(0 80 3) #:command (string-append GUILE " -c '(use-modules (nyacc lalr)) (display *nyacc-version*)'")) (check-version 'nyacc '(0 80 3) #:command (string-append GUILE " -c '(use-modules (nyacc lalr)) (display *nyacc-version*)'"))
(check-version 'bash '(4 0)) (check-version 'bash '(4 0))

93
doc/ANNOUNCE-0.9 Normal file
View file

@ -0,0 +1,93 @@
Subject: Mes 0.9 released
I am pleased to announce the release of Mes 0.9, representing 107
commits over 5 weeks. Mescc now compiles to a surprisingly readable
stage0 M1 macro assembler output format. Mescc now compiles a
modified TinyCC into a running [mostly segfaulting] executable. This
is a major milestone as tcc can compile GCC.
* About
Mes[0] aims to create full source bootstrapping for GuixSD[1] as
part of the bootstrappable builds[2] project.
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. This C prototype will be rewritten in stage0[3]
M1 assembly (or possibly stage2 slow-LISP, or ...).
The Scheme interpreter prototype (mes.c) has a Garbage Collector,
a library of loadable Scheme modules-- notably Dominique Boucher's
LALR[4], Pre-R6RS portable syntax-case[5] with R7RS ellipsis, Matt
Wette's Nyacc[6], Guile's PEG[7] --and test suite just barely
enough to support a simple REPL (repl.mes) and simple C-compiler
(mescc.mes).
The simple C compiler can compile a modified TinyCC[8]. This
needs more work. A gcc-compiled tcc is known[9] to compile GCC.
Mes is inspired by The Maxwell Equations of Software: LISP-1.5[10]
-- John McCarthy page 13, GNU Guix's source/binary packaging
transparency and Jeremiah Orians's stage0 ~300 byte self-hosting
hex assembler.
* Download
git clone https://gitlab.com/janneke/mes
wget https://gitlab.com/janneke/mes/repository/archive.tar.gz?ref=v0.9 -O mes-0.9.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.9 since 0.8
** Core
*** Mes now builds better in non-Guix[SD] legacy distros/environments. Thanks, rain1!
** Mescc
*** Mescc now compiles a modified tinycc into a running [mostly segfaulting] tcc.mes.
https://gitlab.com/janneke/tinycc branch wip-mescc.
*** Mescc now supports locals stack frame larger than 1 byte offset.
*** Mescc now supports incomplete struct initializers {0}.
*** Mescc now supports >>=, <<=, ^=, ~.
*** Mescc now supports the comma operator.
*** Mescc now supports mullti-line string initializers.
*** Mescc now supports unions.
*** Mescc now supports arrays in structs.
*** Mescc now supports structs in structs.
*** Mescc has been refactored to use records.
*** Mescc now builds and runs with Guile-2.0 (legacy distro support, not recommended).
*** Mescc now bundles tinycc's test2 test suite, passes one more test [34/55 pass].
*** Mescc now has an incremental test suite consisting of 56 tests.
*** Mescc now supports stdarg variable argument lists.
*** Mescc now has __GNUC__ unset, #f (WAS: 0).
*** Mescc now depends on Nyacc 0.80.3.
*** Mescc now depends on M1 from MESCC_Tools v0.2.
*** Mescc now compiles to M1 object files.
**** 7 new mlibc functions
calloc, close, getcwd, lseek, sprintf, unlink, vprintf.
**** 31 new mlibc stubs
execvp, fclose, fdopen, fflush, fopen, fprintf, fread, free, fseek,
ftell, fwrite, localtime, longjmp, memcpy, memmove, memmove, memset,
qsort, remove, setjump, snprintf, sscanf, strchr, strrchr, strstr,
strtol, strtoll, strtoul, strtoull, time, vnsprintf.
**** 10 new header files
alloca.h, float.h, libgen.h, locale.h, stdbool.h, stddef.h, stdint.h,
stdnoreturn.h, sys/select.h, sys/wait.h.
Greetings,
janneke
[0] https://gitlab.com/janneke/mes
[1] https://www.gnu.org/software/guix
[2] http://bootstrappable.org
[3] https://github.com/oriansj/stage0
[4] https://github.com/schemeway/lalr-scm
[5] https://www.cs.indiana.edu/chezscheme/syntax-case/old-psyntax.html
[6] https://www.nongnu.org/nyacc/
[7] https://www.gnu.org/software/guile/docs/master/guile.html/PEG-Parsing.html
[8] https://gitlab.com/janneke/tinycc
[9] https://lists.gnu.org/archive/html/tinycc-devel/2017-05/msg00103.html
[10] http://www.softwarepreservation.org/projects/LISP/book/LISP%25201.5%2520Programmers%2520Manual.pdf

View file

@ -84,7 +84,7 @@
(define-public mescc-tools (define-public mescc-tools
(package (package
(name "mescc-tools") (name "mescc-tools")
(version "0.1") (version "0.2")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append (uri (string-append
@ -94,8 +94,9 @@
(file-name (string-append name "-" version ".tar.gz")) (file-name (string-append name "-" version ".tar.gz"))
(sha256 (sha256
(base32 (base32
"1lzi9sqv41269isn7in70q2hhh087n4v97zr5i2qzz69j2lkr3xb")))) "13hcz7cpp6fsq55di2kbff0bxad95cbfyzcrziynybb16px5hgz4"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(supported-systems '("i686-linux" "x86_64-linux"))
(arguments (arguments
`(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))) `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
#:test-target "test" #:test-target "test"
@ -104,7 +105,7 @@
(synopsis "Tools for the full source bootstrapping process") (synopsis "Tools for the full source bootstrapping process")
(description (description
"Mescc-tools is a collection of tools for use in a full source "Mescc-tools is a collection of tools for use in a full source
bootstrapping process. Currently consists of the M0 macro assembler and the bootstrapping process. Currently consists of the M1 macro assembler and the
hex2 linker.") hex2 linker.")
(home-page "https://github.com/oriansj/MESCC_Tools") (home-page "https://github.com/oriansj/MESCC_Tools")
(license gpl3+))) (license gpl3+)))
@ -151,11 +152,12 @@ hex2 linker.")
build-aux/gitlog-to-changelog --srcdir=<git-checkout> > ChangeLog\n"))) build-aux/gitlog-to-changelog --srcdir=<git-checkout> > ChangeLog\n")))
#t)) #t))
(delete 'strip)))) (delete 'strip))))
(synopsis "Maxwell Equations of Software") (synopsis "Scheme interpreter with C compiler for full source bootstrapping")
(description (description
"Mes aims to create full source bootstrapping for GuixSD. It "Mes [Maxwell Equations of Software] aims to create full source
consists of a mutual self-hosting [close to Guile-] Scheme interpreter bootstrapping for GuixSD. It consists of a mutual self-hosting [close to
prototype in C and a Nyacc-based C compiler in [Guile] Scheme.") Guile-] Scheme interpreter prototype in C and a Nyacc-based C compiler in
[Guile] Scheme.")
(home-page "https://gitlab.com/janneke/mes") (home-page "https://gitlab.com/janneke/mes")
(license gpl3+)))) (license gpl3+))))

View file

@ -533,7 +533,8 @@ exec ${GUILE-guile} --no-auto-compile -L . -L guile -C . -C guile -s "$0" ${1+"$
"HACKING" "HACKING"
"INSTALL" "INSTALL"
"NEWS" "NEWS"
"README")) "README"
"doc/ANNOUNCE-0.9"))
(add-target (install "doc/fosdem/fosdem.pdf" #:dir "share/doc/mes")) (add-target (install "doc/fosdem/fosdem.pdf" #:dir "share/doc/mes"))

View file

@ -74,7 +74,7 @@
(define (hex2:offset1 o) (define (hex2:offset1 o)
(string-append "!" o)) (string-append "!" o))
(define hex? #f) ; We need unreleased messc-tools 0.2 wih 0xXX support for this (define hex? #t)
(define (hex2:immediate o) (define (hex2:immediate o)
(if hex? (string-append "%0x" (dec->hex o)) (if hex? (string-append "%0x" (dec->hex o))