freshcrate
Skin:/
Home > Uncategorized > almide

almide

A functional programming language optimized for LLM code generation. Compiles to Rust and WebAssembly.

Why this rank:Recent releaseStrong adoptionHealthy release cadence

Description

A functional programming language optimized for LLM code generation. Compiles to Rust and WebAssembly.

README

Almide

Almide

A programming language designed for LLM code generation.

Playground ยท Specification ยท Grammar ยท Cheatsheet ยท Design Philosophy

CI License: MIT / Apache-2.0 Ask DeepWiki

What is Almide?

Almide is a statically-typed language optimized for AI-generated code. It compiles to native binaries (via Rust) and WebAssembly.

The core metric is modification survival rate โ€” how often code still compiles and passes tests after a series of AI-driven modifications. The language achieves this through unambiguous syntax, actionable compiler diagnostics, and a standard library that covers common patterns out of the box.

The flywheel: LLMs write Almide reliably โ†’ more code is produced โ†’ training data grows โ†’ LLMs write it better โ†’ the ecosystem expands.

MSR Scorecard

Measured by almide-dojo across 30 tasks (basic / intermediate / advanced):

Model Pass Rate 1-Shot Rate
Claude Sonnet 4.6 100% (30/30) 47%
Llama 3.3 70B 61% (17/28) 33%

Quick Start

Try it in your browser โ†’ โ€” No installation required.

Install (macOS / Linux)

curl -fsSL https://raw.githubusercontent.com/almide/almide/main/tools/install.sh | sh

Install (Windows)

irm https://raw.githubusercontent.com/almide/almide/main/tools/install.ps1 | iex

Install from source

Requires Rust (stable, 1.89+):

git clone https://github.com/almide/almide.git
cd almide
cargo build --release
cp target/release/almide ~/.local/bin/

Hello World

fn main() -> Unit = {
  println("Hello, world!")
}
almide run hello.almd

Features

  • Multi-target โ€” Same source compiles to native binary (via Rust) or WebAssembly (direct emit)
  • Generics โ€” Functions (fn id[T](x: T) -> T), records, variant types, recursive variants with auto Box wrapping
  • Pattern matching โ€” Exhaustive match with variant destructuring
  • Effect functions โ€” effect fn for explicit error propagation (Result auto-wrapping)
  • Bidirectional type inference โ€” Type annotations flow into expressions (let xs: List[Int] = [])
  • Codec system โ€” Type.decode(value) / Type.encode(value) convention with auto-derive
  • Map literals โ€” ["key": value] syntax with m[key] access and for (k, v) in m iteration
  • Fan concurrency โ€” fan { a(); b() }, fan.map, fan.race, fan.any, fan.settle
  • Top-level constants โ€” let PI = 3.14 at module scope, compile-time evaluated
  • Pipeline operator โ€” data |> transform |> output
  • Module system โ€” Packages, sub-namespaces, visibility control, diamond dependency resolution
  • Standard library โ€” 430 functions across 23 modules (string, list, map, json, http, fs, etc.)
  • Built-in testing โ€” test "name" { assert_eq(a, b) } with almide test
  • Actionable diagnostics โ€” Every error includes file:line, context, and a concrete fix suggestion

Why Almide?

  • Predictable โ€” One canonical way to express each concept, reducing token branching for LLMs
  • Local โ€” Understanding any piece of code requires only nearby context
  • Repairable โ€” Compiler diagnostics guide toward a specific fix, not multiple possibilities
  • Compact โ€” High semantic density, low syntactic noise

For the full design rationale, see Design Philosophy.

Example

let PI = 3.14159265358979323846
let SOLAR_MASS = 4.0 * PI * PI

type Tree[T] =
  | Leaf(T)
  | Node(Tree[T], Tree[T])

fn tree_sum(t: Tree[Int]) -> Int =
  match t {
    Leaf(v) => v
    Node(left, right) => tree_sum(left) + tree_sum(right)
  }

effect fn greet(name: String) -> Result[Unit, String] = {
  guard string.len(name) > 0 else err("empty name")
  println("Hello, ${name}!")
  ok(())
}

effect fn main() -> Result[Unit, String] = {
  greet("world")
}

test "greet succeeds" {
  assert_eq("hello".len(), 5)
}

How It Works

Almide source (.almd) is compiled by a pure-Rust compiler through a three-layer codegen architecture:

.almd โ†’ Lexer โ†’ Parser โ†’ AST โ†’ Type Checker โ†’ Lowering โ†’ IR
                                                            โ†“
                                              Nanopass Pipeline (semantic rewrites)
                                                            โ†“
                                              Template Renderer (TOML-driven)
                                                            โ†“
                                                    .rs / .wasm

The Nanopass pipeline applies target-specific transformations: ResultPropagation (Rust ?), CloneInsertion (Rust borrow analysis), LICM (loop-invariant code motion). The Template Renderer is purely syntactic โ€” all semantic decisions are already encoded in the IR.

almide run app.almd              # Compile + execute (Rust target)
almide run app.almd -- arg1      # With arguments
almide build app.almd -o app     # Build standalone binary
almide build app.almd --target wasm  # Build WebAssembly (WASI)
almide compile                   # Compile to .almdi (module interface + IR)
almide compile parser            # Compile a specific module
almide compile --json            # Output interface as JSON
almide test                      # Find and run all test blocks (recursive)
almide test spec/lang/           # Run tests in a directory
almide test --run "pattern"      # Filter tests by name
almide check app.almd            # Type check only
almide check app.almd --json     # Type check with JSON output
almide fmt app.almd              # Format source code
almide clean                     # Clear build + dependency cache

WASM Binary Size

Almide emits WASM bytecode directly (no Rust/C intermediary). Each binary is self-contained โ€” allocator, string handling, and runtime are all included. No external GC or host runtime dependency.

Sizes below are with ALMIDE_WASM_OPT=1 (post-build wasm-opt -O3, opt-in for now).

Program Default wasm-opt -O3
Hello World 2,587 B 889 B
FizzBuzz 2,880 B 1,135 B
Fibonacci 2,942 B 1,086 B
Closure 3,161 B 1,193 B
Variant 3,628 B 1,680 B

vs Rust + wasm-bindgen

For trivial programs the two are tied. For numerical / stdlib-heavy code, Almide stays small while wasm-bindgen grows with API surface:

Workload Almide Rust + wasm-bindgen Ratio
Hello World (println) 889 B 852 B tie
Matmul + scale (matrix stdlib) 1,492 B 10,701 B Almide 7.17ร— smaller
Elementwise chain (scale + scale + add) 2,108 B 10,701 B Almide 5.07ร— smaller

Why: wasm-bindgen's type-marshalling glue grows with each exported API; Almide's stdlib lives in a single coherent runtime that doesn't bloat as the call surface expands.

Bench source: almide-wasm-bindgen/examples/bench.

Native Performance

Almide compiles to Rust, which then compiles to native machine code. No runtime, no GC, no interpreter.

Metric Value
Binary size (minigit CLI) 444 KB (stripped)
Runtime (100 ops) 1.1s
Dependencies 0 (single static binary)
WASM target almide build app.almd --target wasm

Project Status

Category Status
Compiler Pure Rust, single binary, 0 ICE
Targets Rust (native), WASM (direct emit)
Codegen v3 โ€” Nanopass + TOML templates, fully target-agnostic walker
Stdlib 430 functions across 23 modules
Tests 177 test files pass (Rust), 278 pass (WASM)
MSR 23/25 exercises pass (Sonnet 4.6, WASM, max 3 attempts)
MiniGit Bench 41/41 tests pass, 100% success rate (ai-coding-lang-bench)
Artifacts .almdi module interface files via almide compile
Playground Live โ€” compiler runs as WASM in browser

AI Coding Language Benchmark

Comparison with 15 established languages using mame/ai-coding-lang-bench (MiniGit implementation task).

Execution Time Code Size Pass Rate

Almide uses Sonnet 4.6 (unknown language); all others use Opus 4.6 (known language). Almide achieves 100% pass rate with fewer lines of code than most languages, despite needing more time due to the model having no prior training data for the language.

Ecosystem

Grammar โ€” almide-grammar

Single source of truth for Almide syntax โ€” keywords, operators, precedence, and TextMate scopes. Written in Almide itself.

All tools that need to know Almide's syntax import this module rather than maintaining their own keyword lists:

# almide.toml
[dependencies]
almide-grammar = { git = "https://github.com/almide/almide-grammar", tag = "v0.1.0" }
import almide_grammar
almide_grammar.keyword_groups()    // 6 groups, 41 keywords
almide_grammar.precedence_table()  // 8 levels, pipe โ†’ unary

The compiler itself uses almide-grammar's TOML files (tokens.toml, precedence.toml) at build time to generate its lexer keyword table โ€” ensuring the compiler and all tooling stay in sync.

Editor Support

  • VS Code โ€” vscode-almide โ€” Syntax highlighting, bracket matching, comment toggling, code folding
  • Tree-sitter โ€” tree-sitter-almide โ€” Tree-sitter grammar for editors that support it (Neovim, Helix, Zed)

Playground โ€” playground

Browser-based compiler and runner. The Almide compiler runs as WASM โ€” no server, no installation. Try it at almide.github.io/playground.

Documentation

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub.

After cloning, install the git hooks:

brew install lefthook  # macOS; see https://github.com/evilmartians/lefthook for other platforms
lefthook install

All commits must be in English (enforced by the commit-msg hook). See CLAUDE.md for project conventions.

License

Licensed under either of MIT or Apache 2.0 at your option.

Release History

VersionChangesUrgencyDate
v0.23.14## Determinism Belt โ€” codegen output is a pure function of `(IR, target)`, by construction v0.23.13 was a hotfix for two host-determinism bugs that crashed the browser playground (`wasm32-unknown-unknown`). Both were the same class: codegen read a non-deterministic / impure / non-portable source instead of being a pure function of `(IR, target)`. This release makes that property **structural** โ€” a Perceus-analog "belt" of layered gates so the bug class can't ship again โ€” rather than fixed case-High6/1/2026
v0.23.11## WASM Engine Foundation + Memory Safety Hardening ### WASM Engine Redesign (Phase 1) - **WasmBuilder + WasmIR + LayoutRegistry** โ€” typed instruction builder with layout-safe memory access, zero hardcoded offsets - Migrated all layout constants across 23 files to LayoutRegistry (single source of truth) - Swiss Table rewrite: `group_by`, `merge`, `map.map`, fold/each/any/all/count - Free list reuse in `rc_dec` allocator (193 โ†’ 237/240 WASM tests passing) - `wasmtime` replaces Node.js WASI for WHigh5/28/2026
v0.23.4## WASM Binary Size: 336 bytes hello world Almide now produces the smallest known WASM binaries for a high-level language with automatic memory management. | Program | Size | |---------|-----:| | Hello World | **336 B** | | Fibonacci (recursive) | **561 B** | | Closure + call_indirect | **593 B** | | FizzBuzz | **608 B** | | Variant (match + float) | **1,085 B** | For comparison, equivalent `println` programs: - **Zig** (`std.debug.print`): 32,240 B โ€” Almide is **96ร— smaller** - **Rust** (`prHigh5/24/2026
v0.17.7## v0.17.7 ### syntax_guide False-Positive Fix - Identifiers like `new`, `null`, `void`, `self` no longer incorrectly rejected when used as parameter names, variable names, or in expressions (`new.kind`, `new == old`) - Hints still correctly fire for keyword-like misuse (e.g. `let x = new Foo()`) ### RcCow Ownership Conversion (COW Completeness) - `render_expr_owned` helper auto-unwraps `RcCow<T>` โ†’ owned `T` via `(*var).clone()` - Applied at all 13 contexts: function args, record fields, listHigh5/16/2026
v0.15.7## What's Changed * fix: promote let โ†’ let mut for Bytes/Vec/HashMap bindings by @O6lvl4 in https://github.com/almide/almide/pull/250 * fix: err() in match arm treated as early return by @O6lvl4 in https://github.com/almide/almide/pull/251 * v0.15.7 by @O6lvl4 in https://github.com/almide/almide/pull/252 * v0.15.7 hotfix by @O6lvl4 in https://github.com/almide/almide/pull/253 * v0.15.7 final by @O6lvl4 in https://github.com/almide/almide/pull/254 * v0.15.7 FileStat auto-emit by @O6lvl4 in https:High5/10/2026
v0.15.2## What's Changed * add 'almide install' subcommand by @O6lvl4 in https://github.com/almide/almide/pull/240 * bump version to 0.15.2 by @O6lvl4 in https://github.com/almide/almide/pull/241 * Release v0.15.2 by @O6lvl4 in https://github.com/almide/almide/pull/242 **Full Changelog**: https://github.com/almide/almide/compare/v0.15.1...v0.15.2High5/4/2026
v0.15.0## What's Changed * Add almide-egg-lab feasibility PoC by @O6lvl4 in https://github.com/almide/almide/pull/171 * Bridge IrExpr to egg for real-IR fusion by @O6lvl4 in https://github.com/almide/almide/pull/172 * egg-lab: lower RecExpr back to IrExpr with fresh-VarId compose beta-reduction by @O6lvl4 in https://github.com/almide/almide/pull/173 * Parse generic @name(args) attributes as Stage 1a of Stdlib Unification by @O6lvl4 in https://github.com/almide/almide/pull/174 * Stdlib Unification StageHigh4/20/2026
v0.14.8Hotfix for a v0.14.7 regression: external package dispatch (e.g. `almai` loaded from `[dependencies]` in `almide.toml`) failed to link because the Phase 1b `ResolveCallsPass` rewrote every `CallTarget::Module` โ€” including user-package modules โ€” to a non-versioned mangled name. The walker then emitted those functions under their versioned identifier (`almide_rt_<pkg>_v<major>_<fn>`) while the call sites referenced the unversioned form (`almide_rt_<pkg>_<fn>`), producing Rust E0425 at compile timeHigh4/16/2026
v0.14.7 Phase 3 "Ideal Form Migration" arc. Six ship points (`-phase3.1` through `-phase3.5` plus the interim B fix-up) are merged into this release. Combined goal: drive every patch-layer special case in the bundled-Almide / codegen dispatch to zero. After this release, every `CallTarget::Module` either resolves to a TOML stdlib fn (per-target inline emit) or is rewritten to `Named` (bundled-Almide path); unresolved stdlib calls are compile-time ICE; monomorphization drops every generic source post-paHigh4/16/2026
v0.14.6 Phase 2 of the "LLM-first language" roadmap. **Focus**: make the compiler produce copy-pasteable fix snippets in diagnostics, so LLM retries converge faster. Measured against [almide-dojo] 30-task benchmark. ### LLM writability (dojo MSR, 2026-04-16) | Model | v0.14.5 baseline | 0.14.6 | ฮ” | |---|---|---|---| | Sonnet 4.6 | โ€” | **30/30 (100%)** | โ€” | | llama-3.3-70b | 17/30 (57%) | **23/30 (77%)** | **+6 (+20pt)** | | llama-3.1-8b | 13/30 (43%) | 10/30 (33%) | -3 (within noise band, ฯƒโ‰ˆ2) | SHigh4/16/2026
v0.14.5## Highlights From almide-dojo data (v0.14.4 run): 7/13 failures on `llama-3.3-70b` came from the LLM writing idioms of **other languages** and getting a generic `Expected ...` error with no Almide-specific clue. This release detects the specific patterns and emits a targeted hint. - **`let x = 1 in expr`** (OCaml / Haskell) โ†’ `` `let ... in <expr>` is OCaml/Haskell syntax `` + newline-separated example of the Almide form. - **`let rec name(args) = ...`** (OCaml / SML) โ†’ `` `let rec` is OCaml/High4/15/2026
v0.14.4## Highlights Diagnostics built from real data โ€” almide-dojo's LLM-retry loop showed which `EXXX` messages dominate unrecoverable errors. This release sharpens those specific paths so models (and humans) can act on a single read. - **Parse-error cascade suppression**: when a function body fails to parse, downstream `undefined function 'foo'` errors from call sites are hidden so the real parse error sits on top. - **Method-call syntax hint**: `n.to_uppercase()` on a String now emits an Almide-sHigh4/15/2026
v0.14.3## Highlights - **WASM bundles are now ~57% smaller by default**: `wasm-opt -O3 --enable-simd --enable-bulk-memory` runs as a post-build step. Hello World drops from 2,587 B to 889 B. Round-trip verified across all 200+ spec tests. Opt out with `ALMIDE_NO_WASM_OPT=1`. - **Cross-module `let` access** (`utils.CATEGORY_ORDER`) โ€” spec-compliant, works on Rust and WASM targets. - **Selective import** `import x.{A, B}` โ€” bare names resolve via the source module on both targets. - **`almide explainHigh4/15/2026
v0.14.2## What's Changed * Fix TCO/BorrowInsertion call-site mismatch for String params by @O6lvl4 in https://github.com/almide/almide/pull/155 * Improve diagnostics: assignment-in-expression and Unit-vs-List by @O6lvl4 in https://github.com/almide/almide/pull/156 * Record stdlib coverage audit + ideal named-type design by @O6lvl4 in https://github.com/almide/almide/pull/157 * Cover all 32 previously-untested matrix stdlib functions by @O6lvl4 in https://github.com/almide/almide/pull/158 * Parse [[typeHigh4/14/2026
v0.14.0## Highlights Almide's matrix runtime now matches or beats NumPy on every transformer primitive we measured, while keeping the language unchanged โ€” all gains come from stdlib/runtime additions. ### Benchmarks on Apple Silicon (f32) | Workload | Almide | NumPy | Ratio | |---|---|---|---| | Single matmul 3ยฒ-1024ยฒ (f32 & f64) | โ€” | โ€” | All sizes Almide 1.03-38x | | Chained matmul (2 ops) | โ€” | โ€” | All sizes Almide 1.02-1.12x | | Full MLP: `gelu(X @ W1 + b1) @ W2 + b2` | | | Almide **1.20-1.30x**High4/14/2026
v0.13.4## Highlights - **WASM Whisper end-to-end** โ€” Almide-compiled WebAssembly runs OpenAI Whisper (tiny.en) in Node.js and the browser, backed by matrix/bytes runtime. - **Codegen ideal-form** โ€” pass split (LambdaTypeResolve / ConcretizeTypes / ResolveCalls), `IrMutVisitor`, declarative stdlib dispatch, WASM emit layer cleanup. - **Complete bytes stdlib** โ€” symmetric LE/BE read/append/set for all dtypes, cursor-style read, search/cmp, high-level ops (reverse/fill/map_each/insert/remove_at/chunks/spMedium4/13/2026
v0.13.3## Highlights **MSR Feedback Loop** โ€” Almide Dojo now measures Modification Survival Rate across 30 tasks. Claude Sonnet 4.6 achieves 100% (30/30). Compiler diagnostic improvements directly raised pass rates. **almai** โ€” New multi-provider LLM client library for Almide ([github.com/almide/almai](https://github.com/almide/almai)). 8 providers, tool calling, JSON mode, conversation builder. ## Codegen Fixes - Fix module codegen uppercasing parameters via inherited `lazy_vars` when using `imporMedium4/12/2026
v0.13.2## What's Changed ### Documentation Overhaul - **ARCHITECTURE.md** rewritten to reflect the 9-crate workspace structure (72k lines). Removed stale references to the removed TypeScript codegen. - **CHEATSHEET.md** stdlib function counts corrected. Removed phantom modules (`path`, `args`) that had docs without implementations. - **SPEC.md** TypeScript/JavaScript codegen references removed. Cross-target semantics updated to Rust / WASM only. - **Stdlib docs**: added missing functions in `bytes` (High4/10/2026
v0.13.1## What's Changed ### Windows CI Fix `process.kill` / `process.is_alive` runtime functions now work on Windows: - **Unix**: `kill -<signal> <pid>` / `kill -0 <pid>` - **Windows**: `taskkill /PID <pid> /F` / `tasklist /FI "PID eq <pid>"` Tests updated for cross-platform compatibility (`HOME` โ†’ `USERPROFILE` fallback, `sleep` โ†’ `ping` on Windows). **Full Changelog**: https://github.com/almide/almide/compare/v0.13.0...v0.13.1High4/8/2026
v0.13.0## What's Changed ### Distribution โ€” Install Without Rust Almide no longer requires the Rust toolchain to install. Three new installation methods: **One-line installer** (macOS / Linux): ```bash curl -fsSL https://raw.githubusercontent.com/almide/almide/main/tools/install.sh | sh ``` **PowerShell installer** (Windows): ```powershell irm https://raw.githubusercontent.com/almide/almide/main/tools/install.ps1 | iex ``` **Self-update** โ€” update the compiler from itself: ```bash almide self-updaMedium4/8/2026
v0.12.3## What's Changed ### Prebuilt Binary Distribution - **Release workflow**: Tag push now automatically builds binaries for 5 platforms (Linux x86_64/aarch64, macOS x86_64/aarch64, Windows x86_64) and publishes them as GitHub Release assets with SHA-256 checksums. No more building from source required. ### WASM Host Imports - **`@extern(wasm)` support**: Declare custom host function imports for the WASM target. Works in both top-level files and imported modules, enabling host-provided functionalMedium4/8/2026
v0.12.2## What's Changed ### WASM Compiler Fixes - **Closure mutable capture**: Lambdas that assign to captured `var` variables now work correctly. ClosureConversion skips these lambdas, letting the WASM emitter's heap-cell path handle shared mutation across multiple closure invocations. - **`demote_unused_mut` traversal**: The unused-mut demotion pass now uses `IrVisitor` for exhaustive tree walking, fixing a bug where assignments inside callback lambdas (e.g. `list.map(xs, (x) => { acc = acc + x })`Medium4/8/2026
v0.12.1## What's Changed ### Compiler Fixes - **Eta-expand function references**: Functions and variant constructors used as first-class values (e.g., `list.map(Wrap)`, `list.filter_map(parse_tag)`) are now eta-expanded into lambdas, fixing Rust borrow mismatch errors. - **WASM: generic variant constructor codegen**: Fixed type mismatch when generic variant constructors like `Box[T]` are passed as function values โ€” the WASM emitter now uses instantiated types from the type checker instead of raw `TyMedium4/7/2026
v0.12.0## WebAssembly 3.0 Almide now targets WebAssembly 3.0. This is the first language to ship native WASM 3.0 features for linear-memory compilation. ### Native Tail Calls All tail-position calls emit `return_call` / `return_call_indirect` instead of regular `call`. This applies to **all** tail calls โ€” not just self-recursive ones. - Mutual recursion is stack-safe (e.g., `is_even` โ†” `is_odd` with 10,000+ depth) - New `TailCallMarkPass` replaces loop-based `TailCallOptPass` in the WASM pipeline -Medium4/6/2026
v0.11.7## Monomorphization: Per-Specialization VarId Alpha-Renaming The root cause of stale VarTable types across monomorphization specializations has been fixed. `specialize_function` now allocates **fresh VarIds** for each specialization via alpha-renaming, ensuring that multiple specializations of the same generic function never share VarTable entries. ### What changed - **Alpha-renaming in mono** โ€” Each specialization gets isolated VarIds with correctly substituted types at allocation time - **RMedium4/6/2026
v0.11.6## Fix: Chained UFCS Pipe Type Inference Fixed a type inference gap where chained UFCS method calls (e.g., `xs |> list.map(f) |> list.join(",")`) left intermediate types unresolved as TypeVar, causing module resolution failures in the second pipe. ### Root Cause During inference, `infer_pipe_direct` stored the left-hand side's type as a raw TypeVar in the TypeMap. Although `constrain()` eagerly unifies via `unify_infer()`, the intermediate result was never resolved through the UnionFind beforMedium4/6/2026
v0.11.5## What's New ### WASM Target: Full Test Suite Green (259/259) Fixed all 13 WASM regressions introduced by nominal type preservation: - **Lambda type inference**: Closure conversion now resolves param/ret types via `Ty::Fn` propagation, VarTable updates, and body expression analysis when type inference leaves them as Unknown/TypeVar - **Record destructure**: Pre-scan correctly resolves `Ty::Named` record fields via `record_fields` lookup for WASM local ValType allocation - **Plain record matcMedium4/6/2026
v0.11.4## Breaking Changes - **Test blocks no longer auto-unwrap effect fn results.** Calls to user-defined `effect fn` in test blocks now return `Result[T, String]` instead of silently unwrapping. Use `!` for explicit unwrap, or assert on `ok()`/`err()` directly: ```almide effect fn validate(n: Int) -> Int = { guard n > 0 else err("bad")! n } test "ok value" { assert_eq(validate(5)!, 5) } test "ok result" { assert_eq(validate(5), ok(5)) } test "err path" { assert_eq(validate(-1),Medium4/3/2026
v0.11.2## Compiler Hardening Systematic bug hunt via monkey testing found and fixed 6 issues across codegen, parser, and monomorphization. ### Monomorphization ICE Fix Recursive generic functions with multiple type parameters now work correctly: ```almide fn tree_fold[T, U](t: Tree[T], leaf_fn: (T) -> U, node_fn: (U, U) -> U) -> U = match t { Leaf(v) => leaf_fn(v), Node(l, r) => node_fn(tree_fold(l, leaf_fn, node_fn), tree_fold(r, leaf_fn, node_fn)), } fn tree_size[T](t: Tree[T]) -> InMedium4/2/2026
v0.11.1## List Pattern Matching `match` now supports list patterns. ```almide fn describe(xs: List[Int]) -> String = match xs { [] => "empty", [0] => "zero", [x] => "one: " + int.to_string(x), [a, b] => "pair", _ => "many", } ``` - Empty list `[]`, length match `[x]` `[a, b]`, and literal match `[0]` - Guards work naturally: `[x] if x > 0 => ...` - Desugared to if/else chains via an IR-level nanopass โ€” works on all targets (Rust, WASM) ## Fn Type Codegen FixesMedium4/2/2026
v0.11.0## Highlights ### C FFI & Native Library Export Almide can now call C libraries and export functions as shared libraries. - **`@extern(c, "lib", "func")`** โ€” Call C functions from Almide with automatic safe wrapper generation - **`@export(c, "func")`** โ€” Expose Almide functions with C ABI for use from other languages - **`almide build app.almd --cdylib`** โ€” Build `.so` / `.dylib` shared libraries from pure Almide code - **`RawPtr` type** with `bytes.from_raw_ptr` / `bytes.copy_to_ptr` for lowMedium4/1/2026
v0.10.5## Codegen optimization: Rust-equivalent performance ### Benchmark (`almide build --fast`) | Benchmark | Rust ref | Almide | Ratio | |---|---|---|---| | spectralnorm | 0.81s | 0.84s | **1.04x** | | nbody | 1.18s | 1.29s | **1.09x** | | fannkuchredux | 1.88s | 1.85s | **0.98x (Almide wins)** | | binarytrees | 1.99s | 0.29s | **6.9x faster** | ### Clone elimination - Last-use move inference: skip `.clone()` at final variable use - Borrow clone strip: `&x.clone()` โ†’ `&x` in stdlib args - Lambda Medium3/31/2026
v0.10.4## main signature simplified - `effect fn main() -> Unit = { ... }` is now the canonical form - No args parameter โ€” use `process.args()` or `env.args()` (Go-style) - No explicit `Result` needed โ€” `effect fn` auto-wraps return to `Result<(), String>` - `almide init` template updated to new form - Spec finalized in `docs/specs/result-option-effect.md` ## Examples fixed - All 8 example files now compile and pass tests (was 4/8) - `api-client.almd`, `typed-api-client.almd`: added missing `!` on `Medium3/31/2026
v0.10.3## Result/Option/effect unification - **WASM now wraps effect fn in Result**, matching Rust behavior. `!` propagates errors via early return instead of trapping - **`?` (ToOption) WASM codegen fix**: local variable type was incorrectly resolved as inner Result type instead of Option - **`wrap_tail_in_ok` skips calls to other effect fns** to prevent double-wrapping `Ok(Result<T>)` - **Test unwrap uses `Unwrap` IR node** instead of Rust-specific `.unwrap()` method call โ€” works on both targets - MMedium3/31/2026
v0.10.2## Closure Conversion pass โ€” fix nested lambda captures in WASM Function parameters captured through 2+ levels of lambda nesting read as 0 in WASM. The playground's default Shape renderer (wave pattern) was affected. ### Root cause WASM codegen handled closures ad-hoc: BFS scanning for lambdas, manual environment building, and per-site capture resolution. When an inner lambda captured a variable from a grandparent scope, the environment builder couldn't find it in the current `var_map` and siMedium3/30/2026
v0.10.1## Fix: check_program auto-installs ImportTable `check_program` now internally calls `install_import_table`, so callers (CLI, playground, external tools) no longer need to remember a separate setup step. v0.10.0 required all callers to explicitly call `install_import_table` before `check_program`. Missing this caused `import json` and other explicit imports to silently fail โ€” types resolved as Unknown, producing broken codegen. The playground's default demo (Shape renderer) was affected.Medium3/30/2026
v0.10.0## Go-style module system - **Explicit imports required**: each module must declare its own imports โ€” no transitive access from parent files - **Last-segment namespace**: `import pkg.sub` makes `sub.func()` available (Go-style implicit alias) - **`import self`**: packages reference their own public API via `import self` (resolves to package name from `almide.toml`) - **Import diagnostics**: name collision errors, duplicate import warnings ## ImportTable โ€” single source of truth Replaced 4 scaMedium3/30/2026
v0.9.12## WASM safety & correctness - Fix `starts_with`/`ends_with` WASM dispatch (was `unreachable` trap) - Fix TypeVar/Unknown comparison: trap instead of silent i64 fallback - Fix stub calls: trap instead of returning silent default values - Fix WASM closure capture for `BindDestructure` pattern variables - Implement `value.get`, `value.as_array`, `matrix.map`, `json.get` in WASM - Implement `int.rotate_left/right`, `list.group_by`, `math.log_gamma` in WASM - Implement datetime runtime: `from_unix`Medium3/30/2026
v0.9.11## Codegen fixes - **Fix Range-to-Vec codegen (Rust)**: Range expressions (`0..n`) inside match arms, if expressions, and function returns now correctly emit `.collect::<Vec<_>>()` instead of `.to_vec()` - **Fix Range as first-class list in WASM**: Range expressions used as values (e.g. `0..n |> list.map(...)`) are now materialized into lists in WASM codegen โ€” previously caused `unreachable` trap at runtime ## Improvements - **Precise error underlines**: Token/Span now tracks `end_col` for acMedium3/30/2026
v0.9.10## Codegen fixes - **Fix FnMut closure capture (E0507/E0382)**: `__cap_` and `__licm` variables are now always cloned inside closures and loops, preventing ownership errors in generated Rust - **Fix tuple destructuring in closures**: `let (i, x) = entry` inside lambdas with inferred parameter types now correctly binds variables - **Fix WASM closure capture**: `BindDestructure` pattern variables (from tuple destructuring) are now registered in scope, so inner closures correctly capture them in WMedium3/30/2026
v0.9.9## Fixes - **CloneInsertionPass: Deref node traversal** โ€” `insert_clones` did not recurse into `Deref` nodes, causing use-after-move errors when Box'd pattern variables from recursive types were used multiple times - **Closure tuple destructuring** โ€” Fixed tuple destructuring in closures with inferred parameter types - **Clone for captures and LICM vars** โ€” Always clone `__cap_` / `__licm` variables in FnMut closures and loops ## Improvements - **`list.sort_by` generalized key type** โ€” Key fuMedium3/30/2026
v0.9.8## Benchmark-driven codegen optimization Almide now matches Rust performance on the Computer Language Benchmarks Game. All 6 classic benchmarks implemented in Almide, with iterative compiler optimization achieving up to 543x speedup. ### Benchmark results | Benchmark | Before | After | vs Rust (safe, 1T) | Improvement | |---|---|---|---|---| | n-body | 1.6s | 1.9s | On par | โ€” | | spectral-norm | 869s | 2.0s | On par | 435x | | binary-trees | 121s | 2.9s | On par | 42x | | fasta | 112s | 2.7sMedium3/29/2026
v0.9.7## Compiler Fixes (6) - **LICM pass**: `BindDestructure` (tuple `let (a, b) = ...`) was not tracked as loop-defined, causing incorrect hoisting of expressions referencing destructured variables - **`import self` alias**: type checker overwrote correct alias with raw path `"self"`, breaking `import self as pkg` in package tests - **TCO pass**: tail-call optimization crashed on functions returning `Named` types (e.g. `Value`) or complex tuples โ€” now skips TCO for types that can't be default-initiMedium3/29/2026
v0.9.6## Almide 0.9.6 ### `almide compile` โ€” module interface artifacts New first-class CLI command that compiles source to `.almdi` files: ```bash almide compile # project โ†’ target/compile/main.almdi almide compile parser # specific module by name almide compile --json # interface JSON to stdout almide compile --dry-run # human-readable display ``` `.almdi` is a binary artifact with two sections: - **Interface** โ€” public API surface (types, function sigMedium3/28/2026
v0.9.5## Almide 0.9.5 ### WASM codegen: complete stdlib coverage WASM target now achieves **100% stdlib parity with Rust**. - Implement WASM codegen for all remaining stdlib modules: `datetime`, `testing`, `json_path`, `log`, `io`, `process`, `fs` - WASI-based implementations for filesystem, process, environment, and datetime operations - **129/129** spec tests pass on WASM (up from partial coverage) - Add stdlib parity check tooling and cross-target CI (Rust vs WASM) ### Remove TypeScript/JavaScrMedium3/28/2026
v0.9.4## Almide 0.9.4 ### Unwrap operators: `!` `??` `?` Three postfix operators for unified Result/Option handling: | Operator | On success | On failure | Context | |----------|-----------|------------|---------| | `expr!` | unwrap | propagate err | `effect fn` only | | `expr ?? val` | unwrap | use fallback | anywhere | | `expr?` | unwrap โ†’ some | `none` | anywhere | ```almide effect fn load(path: String) -> Result[Config, String] = { let text = fs.read_text(path)! // err โ†’ propagates Medium3/27/2026
v0.9.3## Almide 0.9.3 ### New primitive types **Matrix** โ€” First-class matrix type with auto-detected BLAS acceleration (#110, #111) - `Matrix.zeros(rows, cols)`, `Matrix.identity(n)`, `Matrix.from_list(data)` - Arithmetic operators: `+`, `-`, `*` (matmul), element-wise ops - `almide build` auto-detects system BLAS (Accelerate on macOS, OpenBLAS on Linux) and links it transparently **Bytes** โ€” Raw byte buffer type (#108) - `Bytes.new()`, `Bytes.from_list(ints)`, `Bytes.from_string(s)` - Full WASM cMedium3/26/2026
v0.9.2## Almide 0.9.2 ### Full-pipeline Sym unification Migrated AST layer identifiers from `String` to `Sym` (string interning), completing the unification across the entire pipeline: parser โ†’ AST โ†’ IR โ†’ codegen. - IR layer was converted in 0.9.1; this release completes the AST layer - Identifier comparison is now pointer equality (O(1)), eliminating duplicate strings in memory - Foundational improvement that benefits compilation performance on larger programs ### Inter-pass IR verification AddeMedium3/24/2026
v0.9.1## Almide 0.9.1 ### Remove `do` block Completely removed `do` blocks from the language. Migrated 66 existing usages to `while` / block expressions and stripped `do` from parser, AST, IR, and codegen. - Guarded `do` โ†’ `while` loop - Unguarded `do` โ†’ plain block expression - `do` is freed as a reserved word for future reuse ### Effect fn Result wrapping Effect functions now automatically wrap return values in `Result<T, String>` for Rust/WASM targets. - Effect fns with non-Result return typeMedium3/24/2026
v0.9.0## Almide 0.9.0 ### 3-Target Architecture Removed the JS target. Almide now ships with **Rust / TypeScript / WASM** โ€” three targets. - `--target js` removed. Node.js users can run TS output directly via `node --experimental-strip-types` (Node 22.6+) - Deleted `runtime/js/` (23 files) and `javascript.toml` template - Eliminated dual runtime maintenance โ€” single TS runtime serves both Deno and Node ### Stdlib v2 Redesigned stdlib based on cross-language comparison. Every module justified agaiMedium3/23/2026
v0.8.4## User Module Codegen Fix Fixes all 8 rustc errors when compiling programs that import user-defined modules (e.g., `almide-grammar`). ### Fixes - **Unprefixed module type registration**: Types like `KeywordGroup` from modules are now accessible by simple name, not just `grammar.KeywordGroup` - **Local variable precedence over module names**: `let args = env.args()` no longer misresolves `args.len()` as a call to the stdlib `args` module - **Lazy field type resolution for lambda parameters**:Low3/19/2026
v0.8.3## Highlights ### Target::JavaScript `--target js` now emits proper JavaScript without TypeScript type annotations. The playground's `compile_to_js` uses this to produce browser-executable code. - New `codegen/templates/javascript.toml` โ€” all type annotations stripped - JS runtime via `full_runtime(true)` โ€” uses `runtime/js/` sources - All nanopass passes (MatchLowering, ResultErasure, ShadowResolve, FanLowering) enabled for JS ### Build artifact cleanup Rustc incremental cache routed to `.alLow3/19/2026
v0.8.2## Highlights ### Generic function lambda fix `ResultPropagationPass` no longer recurses into lambda bodies. This fixes the generic adapter pattern โ€” `fn fetch[T](..., decoder: (Value) -> Result[T, String])` now works correctly. Lambdas are independent scopes; their Result-returning expressions are no longer auto-unwrapped by the enclosing effect fn. ### Build artifact cleanup Rustc incremental cache is now routed to `.almide/cache/incremental/` instead of polluting the project root with hundrLow3/19/2026
v0.8.0## Highlights ### Stdlib Scope Reform - **Removed** uuid, crypto (all compared languages have these outside stdlib) - **Moved** toml, compress, term to `packages/` (first-party, not frozen) - **Added** set module (11 functions: new, from_list, insert, remove, contains, len, is_empty, to_list, union, intersection, difference) - Final: **22 modules, 381 functions** ### Compiler Architecture - **InferTy โ†’ Ty unification**: dual type system eliminated - **emit_ts/ deleted**: -1,807 lines (v3 TS coLow3/18/2026
v0.7.0## Highlights ### Codegen v3 Complete - **Rust: 72/72**, **TS cross-target: 106/106** - `is_rust()` 42 โ†’ 0 โ€” walker fully target-agnostic - Legacy emit_rust/ deleted: -2,340 lines - 9 Nanopass passes, 40+ TOML templates ### Language Changes (Breaking) - `++` โ†’ `+` for string/list concatenation - Single-quote strings `'{"key": "value"}'` - Formatter auto-converts `\"` to single quotes ### Stdlib Verb Reform Complete - Option module (11 fns), Map expansion (7 fns), String slice (6 fns), List coLow3/18/2026
v0.6.3## Almide 0.6.3 ### Fix: AnonRecord codegen for empty typed lists Empty lists with record type annotations now compile correctly: ```almide type Product = { name: String, price: Int, category: String } let ps: List[Product] = [] // Previously: Vec::<AnonRecord>::new() (compile error) // Now: vec![] or Vec::<Product>::new() ``` - Uses `lower_ty_with` to resolve Record types through anon/named type maps - Falls back to untyped `vec![]` if type cannot be resolved -Low3/17/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

SignSign integrity generic notationmain@2026-06-06
blitzA pure-Rust x86-64 compiler backend with e-graph optimization as coremaster@2026-04-23
alefGenerate fully-typed, lint-clean language bindings for Rust libraries across 11 languagesv0.23.18
ponyiserWrap concurrent code in Pony reference capabilities for data-race freedommain@2026-06-02
phronesiserAdd provably safe ethical constraints to AI agents via Phronesismain@2026-06-02

More in Uncategorized

llama.cppLLM inference in C/C++
modal-clientSDK libraries for Modal
anolisaANOLISA - Agentic Nexus Operating Layer & Interface System Architecture