boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

commit d7398ef3945e0d7f61cc44a36a2cb86a7ab47093
parent 56144e7b4c2059d04a00c2c87f8f8423f3ba2c1b
Author: Ryan Sepassi <rsepassi@gmail.com>
Date:   Fri, 24 Apr 2026 15:25:46 -0700

Add readme

Diffstat:
AREADME.md | 41+++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md @@ -0,0 +1,41 @@ +# boot2, another bootstrap path + +``` +;; Bootstrap from seed +(define hex0 (hex0-seed hex0.hex0)) +(define hex1 (hex0 hex1.hex0)) +(define hex2 (hex1 hex2.hex1)) +(define catm (hex2 catm.hex2)) +(define M0 (hex2 (catm ELF.hex2 M0.hex2))) + +;; Compile+Link for arch-specific M1 source +(defn exe (M1-src) (hex2 (catm ELF.hex2 (M0 M1-src)))) + +;; P1 — portable pseudo-ISA at the M1 level. +;; P1A.M1 is the arch-specific backend +;; m1pp is itself a P1 program. +(define m1pp (exe (catm P1A.M1 m1pp.P1))) + +;; P1pp — P1 rewritten with m1pp macros. Assemble any P1pp source via m1pp. +;; P1A.M1pp is the arch-specific backend, now rewritten to use M1pp +;; P1.M1pp is the arch-agnostic interface +;; P1pp.P1pp is "libp1pp", P1pp's standard library, niceties and utilities for +;; programming in P1pp +(defn ppexe (src) (exe (m1pp (catm P1A.M1pp P1.M1pp P1pp.P1pp src)))) + +;; To Scheme! +(define scheme (ppexe scheme1.P1pp)) + +;; And finally C +(defn scc (C-src) (ppexe (scheme cc.scm C-src))) +(define tcc0 (scc tcc.c)) ;; compiler: scheme cc.scm +(define tcc1 (tcc0 tcc.c)) ;; compiler: scheme-compiled tcc +(define tcc (tcc1 tcc.c)) ;; compiler: tcc-compiled tcc +``` + +* P1: docs/P1.md +* M1pp: docs/M1PP.md +* P1PP: docs/LIBP1PP.md, p1/P1.M1pp, p1/P1pp.P1pp +* Scheme plan: docs/LISP.md, docs/LISP-C.md + +If you'd like to chat, email me at hi at ryansepassi.com