From 5a1bc4fc3c5990f7e71ccf5191bc33c5874dea04 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 13 May 2022 10:56:04 +0200 Subject: added notes about ras52 bootstrapping from hex to C project added about t3x --- README.bootstrapping | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/README.bootstrapping b/README.bootstrapping index 6d77295..7cbcbd9 100644 --- a/README.bootstrapping +++ b/README.bootstrapping @@ -12,8 +12,27 @@ https://github.com/aalhour/awesome-compilers notes on specific projects -------------------------- +Richard Smith bootstrap experiment +---------------------------------- + https://github.com/ras52/bootstrap +Full bootstrap of linker, assember, C-compiler, stages from hex. +Too much assembly for my taste. I would like to freeze version of +the generated code (C code, AST code, assembly code, hex dumps) +for bootstrapping, but generate them with tools written in high-level +languages (at least C). +Not strictly cascaded output, for instance as0 outputs unelfified +binary instead of hexl. elfification is a nice idea, keeping things +nicely apart. Some code is just available in HEX (undex, elfify), we +would actually like just to write in C later on in the bootstrapping +process and the freeze the intermediate formats for later bootstrapping. +This would also serve as documentation (note: of course there is objdump -d) +ELF and linking is quite complex, I wouldn't go that route.. +Stage 4 has no type system in compiler, this makes things easy. Making a +compiler behaving like B but in the syntax of C is a smart idea. And it's +always forward compatible.. + bcompiler --------- @@ -30,7 +49,24 @@ Bootstrap a C environment via intermediate language (G), writes assembly and proto-tinity in G, then bootstraps a tinyc and a libc. Good testbed, demonstrates the whole bootstrapping process in qemu, really nice. Why is the minikernel written in assembly? Most likely needed early on.. -Very good back and forth of documenting the requirements whicle bootstrapping +Very good back and forth of documenting the requirements while bootstrapping (ASSUMPTIONS.md). +t3x +--- +http://t3x.org/t3x/index.html +virtual stack machine for code generation, self-bootstrappable. +Weird %1 for -1 just to avoid const expressions, I would actually support +at least this one case as -1 (%1 is only in the first versions, when there +is no constexpressions). I would bootstrap via VSM emulator or a +C code generator backend, not by having a second compiler written in C. +Allocation of vectors strictly on the stack, to avoid heap memory management, +BCPL style, very interesting. Tables are very lua-like, many things we +only have again in C99 and later. Computed tables I have never seen before. +No type system, byte and word deref and signed/unsigned operators are +represented in the grammar. T3X9 is the simple non-OOP-version used for +bootstrapping, there are TCode-middle-code and more feature-full versions. +Precedence loop for operator parsing. Minimalistic dependencies (read, write, exit) +on the operating system, especially no sbrk/mmap for dynamic memory management. +Bootstrapping compiler is written in C (tested with multiple C compilers, fine). -- cgit v1.2.3-54-g00ecf