NOT WORKING SOFTWARE - YET
This is the blueprint for Nake: a next-generation build tool that combines the high-level safety of Nickel with the low-level speed of Ninja and the surgical precision of execline.
"The Brain of Nickel, the Brawn of Ninja."
Traditional build tools fail because they mix Logic, Dependency Tracking, and Command Execution into one messy pot. Nake separates them:
- Logic (Nickel): Programmable, typed, and validated via Contracts.
- Dependency Graph (Ninja): A flat, fast machine-code equivalent for builds.
- Execution (Pluggable): Choice of Bash (compatibility), YSH (data), or execline (performance).
Nake operates as a "Build Compiler." It takes high-level Nickel intent and "lowers" it into an optimized Ninja manifest.
- Contract Layer: Users define tasks using Nickel records. Every task is validated against a schema (e.g., ensuring
inputsandoutputsare defined). - Modular Backends: The execution engine (the shell) is a merged module. You can switch from
Bashtoexeclineby changing one line of code. - The Lowering Phase: Nake evaluates the Nickel logic and generates a
build.ninjafile. - The Execution Phase: Ninja runs the generated commands in parallel with zero overhead.
Unlike Make, which only checks exit codes, Nake can use structured shells (like YSH or Nushell) to create a feedback loop:
- Command: Compile
app.c. - Response: Shell returns a JSON object:
{ "size": "45kb", "dynamic_libs": ["libc.so"] }. - Validation: Nickel checks this against a contract (e.g., "Binary must be < 50kb"). If it fails, the build stops.
| Feature | Make / CMake | Nake |
|---|---|---|
| Logic Language | Brittle String-matching | Nickel (Functional & Typed) |
| Orchestrator | Slow Serial/Parallel | Ninja (Blazing Fast) |
| Execution | Raw Shell (unsafe) | execline (Atomic / No-shell) |
| Validation | Post-build scripts | In-engine Contracts |
let nake = import "nake_std.ncl" in
let engine = import "nake/engines/execline.ncl" in
{
# Merge the high-performance execline engine into the project
project = {
name = "Chromium-Scale-Project",
} & engine.PerformanceSettings,
tasks = {
compile = {
cmd = ["clang", "-O3", "main.c", "-o", "main.o"],
inputs = ["main.c"],
outputs = ["main.o"],
} | nake.Task,
}
}For massive projects like Chromium (40,000+ files):
- Standard Shell: Spawning 40,000 shells adds minutes of idle overhead.
- execline Backend: Zero shell overhead. Each process "chains" into the next via
execve, saving significant CPU time and eliminating shell-parsing bugs.
- Nake-Std: A Nickel library defining the
TaskandBackendcontracts. - Nake-CLI: A Rust-based wrapper that executes
nickel exportand templates the results into abuild.ninjafile. - Backend Modules: Initial modules for
bash.nclandexecline.ncl.
Nake represents the transition from "Build Scripts" to "Build Engineering." It provides the safety of a modern programming language with the performance of a handwritten Ninja file.