Chuks v0.0.8 — HTTP & Postgres Fixes
Chuks v0.0.8 is a focused patch release. Two critical fixes on top of v0.0.7, both of them affect anyone running a chuks HTTP server or using std/db against PostgreSQL in production.
If you’re on v0.0.7, upgrade today.
HTTP Content-Length parsing is now case-insensitive
Section titled “HTTP Content-Length parsing is now case-insensitive”The gnet-based HTTP server previously matched only the canonical Content-Length: header. Clients that send the lowercase content-length: form notably Node’s undici fetch (used by Next.js route handlers and fetch() proxies) were having request bodies silently dropped, surfacing as req.body == null and parseBody(...) returning Null in handlers.
RFC 7230 §3.2 specifies header names are case-insensitive. The parser now matches both forms and trims whitespace around the value.
Symptom this fixes: cannot get property 'X' on non-instance: *vm.Null when calling a chuks API from a Next.js front-end via a server-side proxy.
// Before v0.0.8, body was silently null when called from undici/Next.jsapp.post("/api/login", (req: Request, res: Response) => { var body: any = parseBody(req) // ← Null res.json({"email": body.email}) // ← crash})
// After v0.0.8, body parses correctly regardless of header casingNo code changes needed on your side. Just upgrade.
PostgreSQL pk("id").auto() no longer breaks after the first restart
Section titled “PostgreSQL pk("id").auto() no longer breaks after the first restart”std/db schema sync was comparing the user-declared default ("") against the DB-reported default (nextval(..._seq)) for SERIAL primary keys, then issuing ALTER TABLE ... DROP DEFAULT on every startup. The next INSERT would fail with:
null value in column "id" of relation "<table>" violates not-null constraint(SQLSTATE 23502)Auto-increment primary keys are now excluded from the default/nullable comparison. Beyond fixing the regression, legacy Postgres tables whose PK has no sequence are auto-repaired a CREATE SEQUENCE IF NOT EXISTS, setval(MAX(id)+1), and SET DEFAULT nextval(...) are emitted on first sync. Existing data is preserved, and the sequence is started past the highest existing id.
const UserSchema = db.define<User>("users", (schema) => { schema.pk("id").auto() // ← now stable across restarts on Postgres schema.string("email").unique().notNull()})SQLite, MySQL/MariaDB, and MSSQL/SQL Server were not affected by this regression and continue to work as before.
Everything else from v0.0.7 is unchanged
Section titled “Everything else from v0.0.7 is unchanged”This is strictly a patch, no new APIs, no syntax changes, no breaking behavior. The full v0.0.7 highlights still apply:
- Package manager (
chuks add,install,publish) - 83 new math functions
- Generic monomorphization in AOT
- Route groups with middleware
- Watch mode
- Permission-based supply chain security
- 189k req/s HTTP, 50k-file projects compiled in ~30 s
If any of those are new to you, jump back to the v0.0.7 release notes.
Upgrading
Section titled “Upgrading”curl -fsSL https://raw.githubusercontent.com/chuks-programming-language/releases/main/install.sh | bashThen verify:
chuks --version # 0.0.8All 298 golden tests pass on both VM and AOT for this release.
Looking ahead
Section titled “Looking ahead”v0.0.9 will be the final 0.0.x patch before we open the 0.1.x line. The themes for 0.1.x:
- Phase 4 IR work (kind-tagged values, cross-module type tables, constant folding)
- Public-beta of the package registry
- Signed releases + reproducible builds
- AST-level permission scanner
Stay tuned.