You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[self-hosting D] Retire Python from the compile critical path #153
Started Phase D slice 1 in a separate worktree (feature/flowc-phase-d) to avoid colliding with pattern-adoption work on src/flow/*.py. PR incoming: pip-free flowc-compile CI + docs; no Python module deletions yet.
New CI job flowc-compile (no pip): downloads Stage-A driver artifact; compiles Stage-A programs with no pip install
Gen0 bootstrap still needs pip (transpiler → numpy); documented
Host plugins (dynamics/shader/verify/LSP) stay on FLOW_HOST=python — no src/flow/*.py deletions (coordinated around concurrent pattern-adoption work)
Remaining for #153 exit: broaden Stage-A surface, move example/tier2 compile off Python pip, optional lazy-import numpy so Gen0 can go bare-python later.
Phase D exit reached: no Python anywhere on the compile path
Branch flowc/self-hosting-chain. Slice 1 (#197) proved the CI compile job needs no pip install. What remained was the Gen0 bootstrap: getting a compiler out of a clean checkout still required the Python host.
Slice 2
compiler/bootstrap/flowc_stage_a.c is now checked in — driver.flow plus every module it imports, emitted by flowc as a single 121 KB translation unit. cc on that file is a complete compiler.
./compiler/scripts/bootstrap_from_c.sh
./flow run examples/basics/fibonacci.flow # exit 55
Verified with python and python3 replaced by shims that exit 127 and log any invocation. Nothing logged. The whole three-generation self-host chain (self_host_full.sh) also runs clean under the same shims.
New CI job flowc self-host (no Python) with no setup-python step: build from the bootstrap C, run the self-compile audit, run the three-generation fixed point, compile and run fibonacci through FLOW_HOST=flowc, then repeat it with python removed from PATH, then package. It is in the ci-ok required set.
A bootstrap bug this exposed
ensure_flowc.sh ran its Python fallback with FLOWC_PHASE_A_ONLY=1, which exits roundtrip.sh before any driver is linked. On a clean tree the default FLOW_HOST=flowc path could not bootstrap at all:
ensure_flowc: bootstrap finished but no stage_a_driver* binary found
❌ flowc emit failed (Stage-A subset?)
ensure_flowc.sh now builds the bootstrap C first and drops FLOWC_PHASE_A_ONLY=1 from the fallback.
Drift protection
bootstrap_from_c.sh --verify runs in roundtrip.sh and requires the checked-in C to be byte-for-byte what flowc emits from compiler/src today. Regenerate with --regen, which picks the freshest driver so a cgen change lands in one step.
What still uses Python, and why none of it is the compile path
Thing
Why
Full language surface (FLOW_HOST=python)
Stage-A is a subset — generics, effects, MLIR/GPU, DSLs
./flow test, benchmarks, wiki build, LSP glue
tooling, not compilation
compiler/scripts/flowc_c_to_hdr.py
roundtrip's per-module .o dogfood only; the bundle path needs no headers
Re-deriving Gen0 from source without the checked-in C
only if you distrust compiler/bootstrap/
Nothing in src/flow/*.py was deleted. The Python host stays for the language surface Stage-A does not cover; it is no longer required to obtain or use a compiler.
Gates: roundtrip.sh ALL PASS; ./flow test --strict --tier2 516/516.
Activity
godofecht commentedon Aug 5, 2026
Started Phase D slice 1 in a separate worktree (
feature/flowc-phase-d) to avoid colliding with pattern-adoption work onsrc/flow/*.py. PR incoming: pip-freeflowc-compileCI + docs; no Python module deletions yet.godofecht commentedon Aug 5, 2026
Phase D slice 1 merged (#197):
flowc-compile (no pip): downloads Stage-A driver artifact; compiles Stage-A programs with no pip installFLOW_HOST=python— nosrc/flow/*.pydeletions (coordinated around concurrent pattern-adoption work)Remaining for #153 exit: broaden Stage-A surface, move example/tier2 compile off Python pip, optional lazy-import numpy so Gen0 can go bare-python later.
godofecht commentedon Aug 6, 2026
Phase D exit reached: no Python anywhere on the compile path
Branch
flowc/self-hosting-chain. Slice 1 (#197) proved the CI compile job needs nopip install. What remained was the Gen0 bootstrap: getting a compiler out of a clean checkout still required the Python host.Slice 2
compiler/bootstrap/flowc_stage_a.cis now checked in —driver.flowplus every module it imports, emitted by flowc as a single 121 KB translation unit.ccon that file is a complete compiler../compiler/scripts/bootstrap_from_c.sh ./flow run examples/basics/fibonacci.flow # exit 55Verified with
pythonandpython3replaced by shims that exit 127 and log any invocation. Nothing logged. The whole three-generation self-host chain (self_host_full.sh) also runs clean under the same shims.New CI job
flowc self-host (no Python)with nosetup-pythonstep: build from the bootstrap C, run the self-compile audit, run the three-generation fixed point, compile and run fibonacci throughFLOW_HOST=flowc, then repeat it with python removed fromPATH, then package. It is in theci-okrequired set.A bootstrap bug this exposed
ensure_flowc.shran its Python fallback withFLOWC_PHASE_A_ONLY=1, which exitsroundtrip.shbefore any driver is linked. On a clean tree the defaultFLOW_HOST=flowcpath could not bootstrap at all:ensure_flowc.shnow builds the bootstrap C first and dropsFLOWC_PHASE_A_ONLY=1from the fallback.Drift protection
bootstrap_from_c.sh --verifyruns inroundtrip.shand requires the checked-in C to be byte-for-byte what flowc emits fromcompiler/srctoday. Regenerate with--regen, which picks the freshest driver so a cgen change lands in one step.What still uses Python, and why none of it is the compile path
FLOW_HOST=python)./flow test, benchmarks, wiki build, LSP gluecompiler/scripts/flowc_c_to_hdr.py.odogfood only; the bundle path needs no headerscompiler/bootstrap/Nothing in
src/flow/*.pywas deleted. The Python host stays for the language surface Stage-A does not cover; it is no longer required to obtain or use a compiler.Gates:
roundtrip.shALL PASS;./flow test --strict --tier2516/516.fix+docs: close resolved issues; ILP32 sizeof_ptr; Homebrew; linguist…
docs: close shipped issues via Fixes keywords (#261)