Skip to content

Lasm 0.11.0

Latest

Choose a tag to compare

@github-actions github-actions released this 25 Nov 05:11
· 20 commits to main since this release
6551266

Lasm 0.11.0

A minor release with breaking changes: Stage 0 (API surface) is complete. Every public API decision in docs/API_DECISIONS.md and docs/api/decisions/ is now implemented and released, and the example apps and templates use only the final APIs. Upgrade with npm install -D @lasm/cli@0.11.0; ^0.10.0 does not pick it up. There are no compatibility aliases, deprecation notices or old-name hints: each breaking change below has a one-line migration.

Breaking changes and migration

  • lasm package is removed (decision 0.7-7, #388). Migration: use lasm build <Main.lean> --target X.
  • Lasm.JS.onEdge is deleted in favour of Lasm.target (decision 0.6-20, #388). Migration: if ← onEdge then … becomes if Lasm.target == .workers then … (or a match Lasm.target), with import Lasm.Target.
  • Lasm.JS.Class (Lasm.JS.Class.define) and the builtin module lasm:class are deleted (A6.2, #385). Migration: write the class in a project .mjs file, its methods calling Lean functions passed with Function.ofSyncFn / ofFn (docs/JS_BINDINGS.md, "JavaScript classes").
  • The browser check moves into lasm build (0.7-7, #388). Migration: lasm package dist --target browser becomes lasm build <Client.lean> --target browser, which checks its output against lasm-manifest.json and writes _headers (a project's own public/_headers is kept).
  • Azure Functions and Cloud Functions builds no longer inject their framework package (0.7-7, #388). Migration: list @azure/functions or @google-cloud/functions-framework in the app's own package.json dependencies, as lasm init --deploy azure-functions|cloud-functions already writes.
  • No hints for Lasm's own earlier names (decisions 0.7-24, 0.7-9, #384): --target azure, --target gcf and --deploy lambda-zip are refused like any unknown name, with the list of targets. Migration: use azure-functions, cloud-functions and --deploy lambda.
  • Lasm no longer changes elan (decision 0.7-25, #373, #384), so a native lake build keeps working after lasm build. Migration: if an older Lasm set an elan override in your project, run elan override unset there once.

New

  • Lasm.target : Lasm.Target (import Lasm.Target; decision 0.6-20, #388): the --target the program is built for, on every target including WASI, wasi-http and Fastly. Target has one constructor per target (.node, .lambda, … .netlifyEdge, … .wasiHttp, .browser) and Target.name gives the CLI name. The build stamps it in at link time; lasm run and a plain lasm build report .node.
  • Missing-import hints for the whole library (decision 0.3-20.1, #386). The hint under Lean's "Unknown identifier" now covers every public Lasm.* module, not only the generated Lasm.JS.* bindings. For example, div gives import Lasm.UI, HttpReq.new gives import Lasm.Fastly, and Value gives import Lasm.JS.

Editor

  • The Lean editor uses the project's own toolchain (#373, decision 0.7-25). Lasm 0.3.0 to 0.10.0 set the project directory's elan override to Lasm's own toolchain (lasm-4.35.0-…), which had Lean's C compiler only when a Lake package had C code, so a native lake build of a lean_exe fell back to cc on PATH, or failed when there was none. The editor now runs lean-toolchain (Lean 4.35.0) and finds Lasm.* through Lasm's Lake package ([[require]] lasm, path .lake/lasm-library); lasm editor adds the require when it is missing and writes lean-toolchain when there is none. Thanks to @paulbutcher for the report and the analysis.

Errors

  • A failed build step reports both of its output streams (#315, #365). When Lake wrote anything to stderr during a failing step, such as the info: <package>: remote URL changed notice that a Git insteadOf URL rewrite causes on every run, lasm build printed only that and hid the entry module's Lean error, which lake lean writes to stdout. The CLI now prints the step's stderr, then its stdout, and shows text that appears on both streams once. lasm dev, lasm dev --target browser, the Vite plugin, lasm editor, the Lasm.JS binding reader, Lake workspace loading and package C-code diagnostics use the same rule. Thanks to @paulbutcher for the report and the reproduction.

Fixes

  • Lasm's tar reader refuses a malformed number in an extended header (#371). A GNU long-name or pax header whose mode, owner, time or device number is not a number was accepted, since those fields mean nothing on an extended header. Python's tarfile and GNU tar refuse such archives, and now Lasm does too: Invalid tar archive: a mode is not a number (or a device number, and so on). No archive that npm, GNU tar or Lasm writes is affected. Found by the nightly tar fuzz campaign.

Decisions

  • WebSockets on Node: Node.serve gets no upgrade hook in Stage 0. A Node program that serves WebSockets binds an npm package such as ws with @[js], as Tandem does (docs/api/decisions/0.4.md, 0.4-7.3; #366).
  • Where the libraries live (A56.2): every Lasm.* library (Lasm.JS, the generated hosts, Lasm.WASI, Lasm.Fastly and Lasm.UI) stays inside @lasm/cli; a library becomes its own @lasm/* package only when it has users who do not need the compiler, or a release cadence of its own. Nothing changes for programs (docs/api/decisions/0.6.md, A56.2; #374).

Example apps

  • Porter on @lasm/cli 0.10.0 (#364). Its SQLite on Node, Deno and Bun goes through the generated Lasm.JS.Node.Sqlite (DatabaseSync.new, NULL as none) and Lasm.JS.Bun.Sqlite (one Data per binding), so Porter has no hand-written JavaScript binding left. Its proof checks use @lasm/cli/lean's lasmLean, and its Azure and Google scripts are build:azure-functions and build:cloud-functions.
  • Tandem on @lasm/cli 0.10.0 (#370).
    • Its SQLite modules use 0.10.0's generated shapes: DatabaseSync.new, Array (Option …) parameters, and Bun's one value per binding. The hand-written new DatabaseSync is gone.
    • The proof scripts use @lasm/cli/lean (lasmLean).
    • The one hand-written binding left is ws on Node (docs/api/decisions/0.4.md, 0.4-7.3).
  • Ledger on @lasm/cli 0.10.0 (#367).
    • Its SQLite modules use 0.10.0's generated shapes: DatabaseSync.new, Array (Option …) parameters, and Bun's one value per binding. The last hand-written binding (new DatabaseSync) is gone.
    • The proof scripts use @lasm/cli/lean (lasmLean).
    • build:azure and build:gcf are now build:azure-functions and build:cloud-functions, matching the targets' names.
  • Tandem: two sync bugs found by the DST nightly's heavy faults (#369, #375).
    • The server pushes a request's operations that were already in the log (an ambiguous commit's, answered 503) from where the log holds them. It pushed the reply (the log from the client's cursor), which missed them when the client was already past them (it had them from a long-poll) or more than a chunk behind them.
    • The editor syncs again when a WebSocket opens while a sync is in flight, since the server may have answered that sync before the socket opened.
    • Seeds 311319686, 509005383 and 766346062 are regression seeds in tandem.yml.
  • Porter, Ledger and Conduit list their Azure and Google framework packages themselves and build every platform with lasm build --target (#388).

Internals (no change to how programs build or run)

  • The API inventory check (scripts/api/inventory.mjs) also counts and checks the sub-ids that only a detail heading defines (0.4-17.1, A56.1): each must be well-formed, defined once, and a sub-id of an entry with a table row. Ids of the form 0.N-M.K are accepted in tables too (#374).
  • The API decision records, ROADMAP.md's Stage 0 state and the performance ratchet's disk-space and build-memory rows are brought up to date with 0.9.0 and 0.10.0 (#374, #376), and record Jordan's Stage 0 sign-off of 2026-11-24 (#387).
  • The Linux resource guard for CI and maintainer workloads (scripts/full-lean/run-bounded.mjs) counts the working set (memory.current less inactive file cache, as the kubelet and docker stats count it) toward its proactive budget, as the macOS and Windows guards already did (#389). Page cache from the toolchains a build extracts had stopped Conduit's and Porter's Netlify Functions and Lambda builds on 16 GiB runners at 4.3 GiB, far below Netlify's 8 GiB build allowance. The kernel cap (MemoryMax) and the pressure and host-headroom stops are unchanged. SAM-served Lambda tests now use the digest-pinned image (--skip-pull-image) instead of asking public.ecr.aws for a newer one at every start.
  • CI caches verified source archives and downloads Zig from community mirrors with a stall timeout (#390). The ui-decode fuzz oracle asks the model about every frame's slot names (#372).