Files
hakorune/docs/development/strategies/de-rust-roadmap.md

1.8 KiB
Raw Blame History

DeRust Roadmap (Phase 21.9+)

Purpose: reduce Rust surface (nonplugin) while keeping correctness and reversibility. Make Hakorune (Hako) the primary host for parsing/building/executing; keep Rust for kernel/ABI/thin wrappers.

Phases

Phase 0 — Archive (low risk)

  • Target: Rust LLVM backend (src/backend/llvm) — deprecated in favor of Python llvmlite.
  • Action: move to archive/rust-llvm-backend/ with a clear RESTORE.md.
  • Acceptance: cargo build --release (default features) remains green; quick smokes green.
  • Revert: git mv archive/rust-llvm-backend/llvm src/backend/.

Phase 1 — Quick Wins (12 months)

  • hv1_inline → Hako parity (already functionally covered; keep as perf path).
  • MIR interpreter parity check; route Primary to Hako VM.
  • TLV codec → C shim (FFI) with thin Rust wrapper.
  • LLVM wrapper → Hako/C harness (Python stays primary until Hako IR is ready).

Phase 2 — Core Thinning (24 months)

  • Plugin loader thin C wrapper (dlopen/dlsym), unify host ABI.
  • Basic boxes (Array/Map/File) small C core (handlebased), keep Rust shim.
  • Resolver/Using: SSOT in Hako; runner uses shared policy.

Phase 3 — Longhaul (36 months)

  • Python llvmlite → Hako IR builder + C ABI.
  • Parser/MIR builder fully Hakofirst; Rust becomes fallback.
  • NyKernel minimal C runtime (BoxCall dispatcher + collections + file).

Principles

  • Guard everything by env/features; defaults unchanged.
  • Keep changes reversible (small diffs, RESTORE docs, fallbacks).
  • Test gates: quick smokes + representative hv1/hakovm parity.

Today (suggested)

  1. Stage Phase0 move as a script (not autorun) + RESTORE.md.
  2. Add phase docs (docs/private/roadmap/phases/phase-21.9/PLAN.md).
  3. Keep CI/dev instructions intact (no build break when features=none).