Skip to content

feat: consolidate LK language, VM, AOT, and platform support - #32

Open
lollipopkit wants to merge 732 commits into
mainfrom
feat/aot-try-catch
Open

feat: consolidate LK language, VM, AOT, and platform support#32
lollipopkit wants to merge 732 commits into
mainfrom
feat/aot-try-catch

Conversation

@lollipopkit

@lollipopkit lollipopkit commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

This branch started by removing try/catch from the AOT coverage allowlist and grew into a broad consolidation of LK's language implementation, VM, native backend, standard library, tooling, and bare-metal targets.

The result is a substantially wider and more consistently tested language surface across the interpreter and Cranelift paths. The branch contains 732 commits and changes 506 files; the sections below describe the main outcomes rather than every individual fix.

Highlights

Language and front end

  • Expanded expression-oriented control flow, pattern matching, closures, traits, structs, machine integers, defer, and first-class try/catch.
  • Strengthened parsing, name resolution, import handling, type checking, builtin signatures, default/named arguments, and diagnostics.
  • Extended declarative and procedural macro support, hygiene, origin tracking, expansion inspection, and LSP integration.
  • Consolidated user-visible semantics for equality, ordering, display, indexing, slicing, map keys, error values, and method lookup.

VM and runtime correctness

  • Reworked VM compilation and execution around verified bytecode, explicit call frames, protected regions, closures, containers, imports, and runtime callables.
  • Made GC marking iterative and tightened roots for pending raises, host-held values, exports, and cross-runtime payloads.
  • Added recursion/depth limits where script-shaped values could otherwise overflow the Rust stack.
  • Unified behavior that previously drifted across equality, display, map-key conversion, type naming, slices, and container operations.
  • Preserved first-class raised values across function, module, task, and heap boundaries.

Native backend

  • Expanded the typed MIR and Cranelift pipeline across control flow, containers, dynamic values, closures, traits, globals, imports, stdlib calls, and machine-width operations.
  • Added native try/catch through outlined protected regions and the setjmp trampoline.
  • Hardened Tier 1 hybrid ownership and reachability so outlined try bodies cannot become invalid VM bridge targets or dangling MIR calls.
  • Added MIR validation for function references, protected calls, arity, and entry-return capability.
  • Added scope-drop, CSE, DCE, ABI-schema conformance, optimized-build coverage, and native container-result display.
  • Kept unsupported shapes explicit: eligible helpers use the hybrid bridge, while other valid programs use the Tier 0 VM bundle.

Standard library and platforms

  • Expanded and aligned the desktop standard library across IO, encoding, bytes, iterators, math, strings, filesystem, process, environment, regex, random, networking, streams, tasks, channels, and time.
  • Kept browser and bare-metal module surfaces explicit, with computation-only modules available under no_std.
  • Added and extended Cortex-M VM execution, AArch64 native object execution, and the x86-64 bare-metal kernel, drivers, tasks, user mode, storage, input, and display checks.

Tooling and ecosystem

  • Expanded the CLI across checking, formatting, bytecode/native/object compilation, bundling, coverage, macro inspection, and package workflows.
  • Extended LSP diagnostics, completion, hover, definitions, references, rename, semantic tokens, code actions, code lenses, formatting, and inlay hints.
  • Updated VS Code, Zed, tree-sitter, WASM playground, examples, documentation, benchmarks, and CI scripts.

Verification

Verified locally on the current head:

  • cargo test --workspace --all-features
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo clippy -p lk-core --no-default-features --all-targets -- -D warnings
  • cargo clippy -p lkrt --no-default-features --all-targets -- -D warnings
  • cargo test -p lk-core --no-default-features: 1113 passed, 1 ignored
  • AOT native-lowering coverage: 76/76, empty allowlist
  • VM/native repository sweep: 78 identical, 1 allowed timing divergence, 0 fallback
  • Strict AOT differential suites: 13/13 and 101/101
  • Hybrid compile suite: 7/7
  • Optimized AOT coverage and native execution checks
  • LSP latency budgets and compiler scaling budget
  • WASM, Zed, MCU, and no_std build checks
  • Rust and LK formatting checks

The GitHub Rust Check and Performance Gate for the current head are running.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant