Finch/boot
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nexoniarz 04d5486477 boot: structs by value (System V), addr(fn) callbacks -- the compiler builds itself
C structs travel as C passes them: up to 16 bytes in INTEGER/SSE registers per eightbyte,
bigger ones byval and through sret, out-of-registers structs on the stack. addr(fn) makes a
C-callable thunk that rebuilds the arguments. With those, the self-hosted compiler can
compile boot/cimport.fch, which calls libclang with CXCursor and CXString by value and gives
it callbacks -- so it compiles itself.

boot.sh: stage 2 and stage 3 are identical (57904 lines of IR); 22 passed, 0 failed,
0 skipped. Only x86-64 System V so far; Windows and ARM64 conventions are still in C++.
2026-10-25 19:47:20 +01:00
..
ast.fch boot: C import (import "x.h", link, C functions, constants, globals, .ptr, ptr(x)) 2026-10-25 19:44:58 +01:00
cimport.fch boot: C import (import "x.h", link, C functions, constants, globals, .ptr, ptr(x)) 2026-10-25 19:44:58 +01:00
gen.fch boot: structs by value (System V), addr(fn) callbacks -- the compiler builds itself 2026-10-25 19:47:20 +01:00
lexer.fch boot: errors as values (-> T!, error(), try, or, fallible builtins and main) 2026-10-25 19:13:46 +01:00
main.fch boot: C import (import "x.h", link, C functions, constants, globals, .ptr, ptr(x)) 2026-10-25 19:44:58 +01:00
parser.fch boot: C import (import "x.h", link, C functions, constants, globals, .ptr, ptr(x)) 2026-10-25 19:44:58 +01:00