feat: HTTP registry, app/bench harnesses, and DWARF #line maps

Ship QUALITY_PLAN sessions 31–33: fetchable package index URLs, showcase
app and micro/nexus benchmarks, and debugger-friendly C codegen.

- Registry: BUX_REGISTRY accepts http(s) URLs (curl/wget → ~/.bux/cache)
- E.2: make test-apps smoke for nexus/boko/simpledb/jwt-pitbul
- E.5: benches/micro + C/Nim/Zig twins; make bench-nexus (wrk)
- E.4: HIR locs → #line .bux; default -O0 -g; --release -O2; make test-dwarf
This commit is contained in:
2026-07-19 22:46:45 +03:00
parent 53b43b0f79
commit eb81856565
26 changed files with 983 additions and 52 deletions
+31 -1
View File
@@ -5,6 +5,8 @@ module Main {
import Router::{Handler, Route, Router};
import Server::{RunServer};
import Std::Array::{Array, Array_New, Array_Push};
import Std::Os::{Os_GetEnv};
import Std::String::{String_Len, String_ToInt};
func BuildRouter() -> Router {
var routes: Array<Route> = Array_New<Route>(8);
@@ -39,8 +41,36 @@ module Main {
};
}
/// Apply optional env overrides for benches / ops:
/// NEXUS_PORT, NEXUS_WORKERS, NEXUS_BIND, NEXUS_PUBLIC
func ApplyEnvConfig(config: *ServerConfig) {
let portEnv: String = Os_GetEnv("NEXUS_PORT");
if String_Len(portEnv) > 0 {
let p: int64 = String_ToInt(portEnv);
if p > 0 && p < 65536 {
config.port = p as int;
}
}
let workersEnv: String = Os_GetEnv("NEXUS_WORKERS");
if String_Len(workersEnv) > 0 {
let w: int64 = String_ToInt(workersEnv);
if w > 0 && w <= 256 {
config.workerCount = w as int;
}
}
let bindEnv: String = Os_GetEnv("NEXUS_BIND");
if String_Len(bindEnv) > 0 {
config.bindAddr = bindEnv;
}
let pubEnv: String = Os_GetEnv("NEXUS_PUBLIC");
if String_Len(pubEnv) > 0 {
config.publicDir = pubEnv;
}
}
func Main() -> int {
let config: ServerConfig = DefaultConfig();
var config: ServerConfig = DefaultConfig();
ApplyEnvConfig(&config);
let router: Router = BuildRouter();
return RunServer(config, router);