Skip to content

almide/almide

Repository files navigation

Almide

Almide

A programming language designed for LLM code generation.

Playground · Specification · Grammar · Cheatsheet · Design Philosophy

CI License: MIT / Apache-2.0

What is Almide?

Almide is a statically-typed language optimized for AI-generated code. It compiles to Rust, TypeScript, 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.

Quick Start

Try it in your browser → — No installation required.

Prerequisites

  • Rust (stable, 1.80+)

Install from source

git clone https://github.com/almide/almide.git
cd almide
cargo build --release

Copy the binary to a directory on your PATH:

# macOS / Linux
cp target/release/almide ~/.local/bin/

# or system-wide
sudo cp target/release/almide /usr/local/bin/

Verify the installation:

almide --version
# almide 0.4.1

Hello World

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

Features

  • Multi-target — Same source compiles to Rust (native binary), TypeScript, or WebAssembly
  • Generics — Functions, records, variant types, recursive variants with auto Box wrapping
  • Pattern matching — Exhaustive match with variant destructuring
  • Effect functionseffect fn for explicit error propagation (Result auto-wrapping)
  • Pipeline operatordata |> transform |> output
  • Module system — Packages, sub-namespaces, visibility control, diamond dependency resolution
  • Built-in testingtest "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

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)
  }

type AppError =
  | NotFound(String)
  | Io(IoError)
  deriving From

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

effect fn main(args: List[String]) -> Result[Unit, AppError] = {
  let name = match list.get(args, 1) {
    some(n) => n
    none => "world"
  }
  greet(name)
}

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

How It Works

Almide source (.almd) is compiled by a pure-Rust compiler to Rust, TypeScript, or WebAssembly.

.almd → Lexer → Parser → AST → Type Checker → CodeGen → .rs / .ts / .wasm
almide run app.almd              # Compile + execute
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 test                      # Run tests/ directory
almide check app.almd            # Type check only (no compilation)
almide fmt app.almd              # Format source code
almide clean                     # Clear dependency cache
almide app.almd --target rust    # Emit Rust source
almide app.almd --target ts      # Emit TypeScript source

Benchmark

MiniGit Benchmark: Almide vs 15 languages

Tested with the MiniGit benchmark — Claude Code implements a mini version control system from a spec, with multiple trials per language.

Language Total Time Avg Cost Pass Rate
Ruby 73.1s $0.36 40/40
Python 74.6s $0.38 40/40
TypeScript 133.0s $0.62 40/40
Rust 113.7s $0.54 38/40
Almide 206.3s $0.59 8/8

Almide has no training data in any public LLM corpus yet, so the generation speed gap is expected to narrow as more Almide code enters training sets. See full results for all 16 languages.

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) 635 KB (stripped)
Runtime (100 ops) 1.6s
Dependencies 0 (single static binary)
WASM target almide build app.almd --target wasm

Editor Support

Install syntax highlighting from almide/almide-editors:

  • VS Code — Download .vsix from Releases, then code --install-extension almide-lang-*.vsix
  • Chrome — Highlights .almd files on GitHub and ```almd code blocks on any website. See install instructions

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.

About

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

Topics

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages