MoonNinja is a MoonBit-native subset Ninja parser and build scheduler with dependency graph planning, incremental analysis, and execution demos.
moon fmt --check
moon check --deny-warn
moon build --target all
moon test --deny-warn
moon run src/mainmoon test --deny-warn --target nativemoon check --target all --deny-warn
moon build --target all --deny-warn
moon test --target all --deny-warnpowershell -ExecutionPolicy Bypass -File .\scripts\verify_acceptance.ps1powershell -ExecutionPolicy Bypass -File .\scripts\verify_acceptance.ps1 `
-MoonBitBin "<path-to-moonbit-0.10.7-bin>"rule cc
command = gcc -c $in -o $out
rule link
command = gcc $in -o $out
build util.o: cc util.c
build main.o: cc main.c | generated.h
build app: link main.o util.oMoonNinja/
|- .github/workflows/test.yml GitHub Actions CI
|- examples/sample.build.ninja Realistic parser input example
|- scripts/verify_acceptance.ps1
|- moon.mod MoonBit module metadata for publication
|- src/
| |- manifest.mbt Manifest and command rendering
| |- lexer.mbt Tokenization for the supported Ninja subset
| |- parser.mbt Parser for rule/build declarations
| |- graph.mbt SCC diagnostics and dependency waves
| |- incremental.mbt MTime/hash rebuild decision logic
| |- fingerprint.mbt Portable file identity model
| |- scheduler.mbt Planning and incremental execution
| |- wave_executor.mbt Lock-free wave runner interface
| |- local_executor.mbt Native command execution adapter
| |- benchmark.mbt Measured workload summaries
| |- plan_analysis.mbt Critical-path and parallelism analysis
| |- validation.mbt Manifest validation diagnostics
| |- diagnostics.mbt Actionable parse/graph diagnostics
| |- variable_expansion.mbt Named and built-in command variables
| |- depfile.mbt Make-style compiler dependency files
| |- response_file.mbt Quoted response-file arguments
| |- build_plan.mbt Stable materialized target plans
| |- build_state.mbt Incremental state sidecar format
| |- path_utils.mbt Cross-platform safe build paths
| |- command_line.mbt Structured command rendering
| |- command_validation.mbt Pre-execution command diagnostics
| |- target_inspection.mbt Read-only dependency explanations
| |- dependency_diff.mbt Stable depfile change reports
| |- native/ Native stat/hash adapter, worker pool, and fixture tests
| |- parser_test.mbt Core-path tests
| `- main/main.mbt Demo CLI entry
|- official-requirements.md OSC2026 requirement notes
|- source-attribution.md Source explanation and implementation boundaries
`- submission-status.md Local closeout status and reviewer checklistmoon publish --dry-runpub(all) struct BenchmarkReport {
summary : BenchmarkSummary
rendered_commands : Array[String]
wave_sizes : Array[Int]
} derive(Debug)fn BuildEdge::evaluate_fingerprints(self : BuildEdge, current : Map[String, FileFingerprint], previous : Map[String, FileFingerprint]) -> BuildDecisionpub(all) struct BuildReport {
status : BuildReportStatus
target : String
waves : Int
commands : Int
cache_hits : Int
cache_misses : Int
failures : Array[String]
outputs : Array[String]
} derive(Eq, Debug)pub(all) struct Diagnostic {
kind : DiagnosticKind
code : String
message : String
subject : String
hint : String
} derive(Eq, Debug)impl Show for DiagnosticKindpub(all) struct DryRunExecutor {
}impl Executor for DryRunExecutorfn ExpansionContext::new(inputs~ : Array[String], outputs~ : Array[String], variables~ : Map[String, String]) -> ExpansionContextfn FileFingerprint::from_bytes(bytes : Bytes, mtime_seconds~ : Int64, mtime_nanos~ : Int) -> FileFingerprintfn FileFingerprint::from_metadata(mtime_seconds~ : Int64, mtime_nanos~ : Int, size~ : Int, content_hash~ : String) -> FileFingerprintpub struct Lexer {
input : String
pos : Int
line : Int
col : Int
}fn Manifest::materialize_plan(self : Manifest, target : String, variables : Map[String, String]) -> Result[MaterializedPlan, String]fn[E : WaveExecutor] Scheduler::run_parallel_waves(self : Scheduler[E], target : String) -> Result[Array[String], String]pub(all) struct ValidationIssue {
code : String
message : String
subject : String
severity : ValidationSeverity
} derive(Eq, Debug)fn compare_dependencies(target : String, previous : Array[String], current : Array[String]) -> DependencyDifffn normalize_build_path(path : String) -> Result[String, String]MoonNinja is a MoonBit-native subset Ninja parser and build scheduler with dependency graph planning, incremental analysis, and execution demos.