Holy shit, Mes compiles tinycc now: https://lists.gnu.org/archive/html/guile-user/2017-07/msg00089.html
We may be well on our way to full bootstrappability of the GNU system!
Mes is a mutually self-hosting Scheme interpreter in C and C compiler in Scheme. It can compile itself both ways. Tinycc is known to compile earlier versions of gcc (before gcc went C++) so we have a path, finally, to building the entire GNU system from the bottom up.
@arunisaac It's not so complicated! Four points to think about:
1) How do you compile a compiler?
2) The compiler you compile it with could possibly secretly insert hidden malware into the compiled compiler, which is propagated into the future by all later compilers.
3) Mes is very small and pretty easy to audit. And how does mutual self-hosting help?
4) Guix right now requires an initial set of binaries to "bootstrap" the system. Could we get rid of that with Mes?
@craigmaloney @arunisaac You implement a C compiler in Scheme! And that's what nyacc is, which is bundled with Mes. So all you need is a minimal Scheme implementation that's just-good-enough to be able to run the C compiler, written in scheme. Now use that to compile a better C compiler (tinycc) and use that to compile GCC... and you're off to the races!
- nyacc is used by mes, but is now unbundled from it.
- nyacc is a C99 parser, ie C99 -> AST
- mescc is a C99 compiler, ie AST -> M
- mes is a scheme interpreter that can run mescc
- nyacc in an amazing parser generator framework that comes with an almost complete c99 parser and preprocessor
I noticed it here:
Which I got to via here: https://gitlab.com/janneke/mes
"This C prototype will be rewritten in [[https://github.com/oriansj/stage0][stage0]] M1"
I noticed that Parrot also had a M1 "phase" for code, which made me wonder if that was VM code or what-not (iirc Parrot uses a VM).