The JIT that runs makepad apps from source: lexer, front end, type checker, lazy borrow checker (Gandalf; `--check-first` opts in), codegen, session and warm/cold caches keyed by compiler stamp, provided crates bound late, startup images, live patching. User-facing name is `makepad run` (binary `makepad`, MAKEPAD_RUN_* env, ~/.makepad-run); libs/relax stays the internal library name. `makepad check` reports rustc-style diagnostics with rustc error codes and checks a whole workspace (`--workspace`). Runs on macOS, Linux, Windows and Android. makepad-remote: one tool schema for apps and the WM (app/1): grabs, captures, traces, frame profiles and tweaks. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
22 lines
494 B
Rust
22 lines
494 B
Rust
// Live-patch demo: the test hashes `kernel` over a range; edits swap `kernel`.
|
|
const STEPS: u32 = 1_000_000;
|
|
|
|
fn kernel(x: f64) -> f64 {
|
|
let table = [1.0, 2.0, 3.0];
|
|
let i = (x as usize) / 100;
|
|
table[i] * x
|
|
}
|
|
|
|
fn checksum() -> u64 {
|
|
let mut h: u64 = 0xcbf29ce484222325;
|
|
for i in 0..STEPS {
|
|
let v = kernel(i as f64 * 0.001);
|
|
h = (h ^ v.to_bits()).wrapping_mul(0x100000001b3);
|
|
}
|
|
h
|
|
}
|
|
|
|
#[test]
|
|
fn run() {
|
|
println!("checksum {:016x}", checksum());
|
|
}
|