{"id":46743479,"url":"https://github.com/almide/almide","last_synced_at":"2026-05-24T06:03:29.748Z","repository":{"id":342789608,"uuid":"1175180941","full_name":"almide/almide","owner":"almide","description":"A functional programming language optimized for LLM code generation. Compiles to Rust and WebAssembly.","archived":false,"fork":false,"pushed_at":"2026-04-08T23:19:40.000Z","size":34624,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2026-04-09T00:38:08.557Z","etag":null,"topics":["code-generation","compiler","functional-programming","llm","programming-language","rust","webassembly"],"latest_commit_sha":null,"homepage":"https://almide.github.io/playground/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/almide.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/roadmap/GRAND_PLAN.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-07T10:48:58.000Z","updated_at":"2026-04-08T22:59:35.000Z","dependencies_parsed_at":"2026-04-02T12:09:00.124Z","dependency_job_id":null,"html_url":"https://github.com/almide/almide","commit_stats":null,"previous_names":["almide/almide"],"tags_count":65,"template":false,"template_full_name":null,"purl":"pkg:github/almide/almide","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almide%2Falmide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almide%2Falmide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almide%2Falmide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almide%2Falmide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/almide","download_url":"https://codeload.github.com/almide/almide/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almide%2Falmide/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31785682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generation","compiler","functional-programming","llm","programming-language","rust","webassembly"],"created_at":"2026-03-09T18:21:48.410Z","updated_at":"2026-05-24T06:03:29.742Z","avatar_url":"https://github.com/almide.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./docs/assets/almide.svg\" alt=\"Almide\" width=\"200\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eAlmide\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003eA programming language designed for LLM code generation.\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://almide.github.io/playground/\"\u003ePlayground\u003c/a\u003e ·\n  \u003ca href=\"./docs/SPEC.md\"\u003eSpecification\u003c/a\u003e ·\n  \u003ca href=\"./docs/GRAMMAR.md\"\u003eGrammar\u003c/a\u003e ·\n  \u003ca href=\"./docs/CHEATSHEET.md\"\u003eCheatsheet\u003c/a\u003e ·\n  \u003ca href=\"./docs/DESIGN.md\"\u003eDesign Philosophy\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/almide/almide/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/almide/almide/actions/workflows/ci.yml/badge.svg\" alt=\"CI\"\u003e\u003c/a\u003e\n  \u003ca href=\"./LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT%20%2F%20Apache--2.0-blue.svg\" alt=\"License: MIT / Apache-2.0\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://deepwiki.com/almide/almide\"\u003e\u003cimg src=\"https://deepwiki.com/badge.svg\" alt=\"Ask DeepWiki\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## What is Almide?\n\nAlmide is a statically-typed language optimized for AI-generated code. It compiles to native binaries (via Rust) and WebAssembly.\n\nThe 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.\n\nThe flywheel: LLMs write Almide reliably → more code is produced → training data grows → LLMs write it better → the ecosystem expands.\n\n### MSR Scorecard\n\nMeasured by [almide-dojo](https://github.com/almide/almide-dojo) across 30 tasks (basic / intermediate / advanced):\n\n| Model | Pass Rate | 1-Shot Rate |\n|---|---|---|\n| Claude Sonnet 4.6 | **100%** (30/30) | 47% |\n| Llama 3.3 70B | 61% (17/28) | 33% |\n\n## Quick Start\n\n**[Try it in your browser →](https://almide.github.io/playground/)** — No installation required.\n\n### Install (macOS / Linux)\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/almide/almide/main/tools/install.sh | sh\n```\n\n### Install (Windows)\n\n```powershell\nirm https://raw.githubusercontent.com/almide/almide/main/tools/install.ps1 | iex\n```\n\n### Install from source\n\nRequires [Rust](https://rustup.rs/) (stable, 1.89+):\n\n```bash\ngit clone https://github.com/almide/almide.git\ncd almide\ncargo build --release\ncp target/release/almide ~/.local/bin/\n```\n\n### Hello World\n\n```almd\nfn main() -\u003e Unit = {\n  println(\"Hello, world!\")\n}\n```\n\n```bash\nalmide run hello.almd\n```\n\n## Features\n\n- **Multi-target** — Same source compiles to native binary (via Rust) or WebAssembly (direct emit)\n- **Generics** — Functions (`fn id[T](x: T) -\u003e T`), records, variant types, recursive variants with auto Box wrapping\n- **Pattern matching** — Exhaustive match with variant destructuring\n- **Effect functions** — `effect fn` for explicit error propagation (`Result` auto-wrapping)\n- **Bidirectional type inference** — Type annotations flow into expressions (`let xs: List[Int] = []`)\n- **Codec system** — `Type.decode(value)` / `Type.encode(value)` convention with auto-derive\n- **Map literals** — `[\"key\": value]` syntax with `m[key]` access and `for (k, v) in m` iteration\n- **Fan concurrency** — `fan { a(); b() }`, `fan.map`, `fan.race`, `fan.any`, `fan.settle`\n- **Top-level constants** — `let PI = 3.14` at module scope, compile-time evaluated\n- **Pipeline operator** — `data |\u003e transform |\u003e output`\n- **Module system** — Packages, sub-namespaces, visibility control, diamond dependency resolution\n- **Standard library** — 430 functions across 23 modules (string, list, map, json, http, fs, etc.)\n- **Built-in testing** — `test \"name\" { assert_eq(a, b) }` with `almide test`\n- **Actionable diagnostics** — Every error includes file:line, context, and a concrete fix suggestion\n\n## Why Almide?\n\n- **Predictable** — One canonical way to express each concept, reducing token branching for LLMs\n- **Local** — Understanding any piece of code requires only nearby context\n- **Repairable** — Compiler diagnostics guide toward a specific fix, not multiple possibilities\n- **Compact** — High semantic density, low syntactic noise\n\nFor the full design rationale, see [Design Philosophy](./docs/DESIGN.md).\n\n## Example\n\n```almd\nlet PI = 3.14159265358979323846\nlet SOLAR_MASS = 4.0 * PI * PI\n\ntype Tree[T] =\n  | Leaf(T)\n  | Node(Tree[T], Tree[T])\n\nfn tree_sum(t: Tree[Int]) -\u003e Int =\n  match t {\n    Leaf(v) =\u003e v\n    Node(left, right) =\u003e tree_sum(left) + tree_sum(right)\n  }\n\neffect fn greet(name: String) -\u003e Result[Unit, String] = {\n  guard string.len(name) \u003e 0 else err(\"empty name\")\n  println(\"Hello, ${name}!\")\n  ok(())\n}\n\neffect fn main() -\u003e Result[Unit, String] = {\n  greet(\"world\")\n}\n\ntest \"greet succeeds\" {\n  assert_eq(\"hello\".len(), 5)\n}\n```\n\n## How It Works\n\nAlmide source (`.almd`) is compiled by a pure-Rust compiler through a three-layer codegen architecture:\n\n```\n.almd → Lexer → Parser → AST → Type Checker → Lowering → IR\n                                                            ↓\n                                              Nanopass Pipeline (semantic rewrites)\n                                                            ↓\n                                              Template Renderer (TOML-driven)\n                                                            ↓\n                                                    .rs / .wasm\n```\n\nThe 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.\n\n```bash\nalmide run app.almd              # Compile + execute (Rust target)\nalmide run app.almd -- arg1      # With arguments\nalmide build app.almd -o app     # Build standalone binary\nalmide build app.almd --target wasm  # Build WebAssembly (WASI)\nalmide compile                   # Compile to .almdi (module interface + IR)\nalmide compile parser            # Compile a specific module\nalmide compile --json            # Output interface as JSON\nalmide test                      # Find and run all test blocks (recursive)\nalmide test spec/lang/           # Run tests in a directory\nalmide test --run \"pattern\"      # Filter tests by name\nalmide check app.almd            # Type check only\nalmide check app.almd --json     # Type check with JSON output\nalmide fmt app.almd              # Format source code\nalmide clean                     # Clear build + dependency cache\n```\n\n## WASM Binary Size\n\nAlmide emits WASM bytecode directly (no LLVM, no Cranelift). Each binary is self-contained — allocator, string handling, and runtime are all included. No external GC or host runtime dependency. Aggressive DCE strips unused runtime functions and data automatically.\n\n| Program | Size |\n|---------|-----:|\n| Hello World | **336 B** |\n| FizzBuzz | **605 B** |\n| Fibonacci (recursive) | **558 B** |\n| Closure + call_indirect | **590 B** |\n| Variant (match + float) | **1,081 B** |\n\nThese are raw `almide build --target wasm` output — no post-processing. `wasm-opt -O3` saves only 1–5 more bytes because the compiler's built-in dead code and dead data elimination already strips everything unused.\n\n## Native Performance\n\nAlmide compiles to Rust, which then compiles to native machine code. No runtime, no GC, no interpreter.\n\n| Metric | Value |\n|--------|-------|\n| Binary size (minigit CLI) | **444 KB** (stripped) |\n| Runtime (100 ops) | **1.1s** |\n| Dependencies | **0** (single static binary) |\n| WASM target | `almide build app.almd --target wasm` |\n\n## Project Status\n\n| Category | Status |\n|----------|--------|\n| Compiler | Pure Rust, single binary, 0 ICE |\n| Targets | Rust (native), WASM (direct emit) |\n| Codegen | v3 — Nanopass + TOML templates, fully target-agnostic walker |\n| Stdlib | 430 functions across 23 modules |\n| Tests | 177 test files pass (Rust), 278 pass (WASM) |\n| MSR | 23/25 exercises pass (Sonnet 4.6, WASM, max 3 attempts) |\n| MiniGit Bench | 41/41 tests pass, 100% success rate ([ai-coding-lang-bench](https://github.com/mame/ai-coding-lang-bench)) |\n| Artifacts | `.almdi` module interface files via `almide compile` |\n| Playground | [Live](https://almide.github.io/playground/) — compiler runs as WASM in browser |\n\n### AI Coding Language Benchmark\n\nComparison with 15 established languages using [mame/ai-coding-lang-bench](https://github.com/mame/ai-coding-lang-bench) (MiniGit implementation task).\n\n![Execution Time](docs/figures/lang-bench-time.png?v=1775655978)\n![Code Size](docs/figures/lang-bench-loc.png?v=1775655978)\n![Pass Rate](docs/figures/lang-bench-pass-rate.png?v=1775655978)\n\n\u003e 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.\n\n## Ecosystem\n\n### Grammar — [almide-grammar](https://github.com/almide/almide-grammar)\n\nSingle source of truth for Almide syntax — keywords, operators, precedence, and TextMate scopes. Written in Almide itself.\n\nAll tools that need to know Almide's syntax import this module rather than maintaining their own keyword lists:\n\n```toml\n# almide.toml\n[dependencies]\nalmide-grammar = { git = \"https://github.com/almide/almide-grammar\", tag = \"v0.1.0\" }\n```\n\n```almide\nimport almide_grammar\nalmide_grammar.keyword_groups()    // 6 groups, 41 keywords\nalmide_grammar.precedence_table()  // 8 levels, pipe → unary\n```\n\nThe 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.\n\n### Editor Support\n\n- **VS Code** — [vscode-almide](https://github.com/almide/vscode-almide) — Syntax highlighting, bracket matching, comment toggling, code folding\n- **Tree-sitter** — [tree-sitter-almide](https://github.com/almide/tree-sitter-almide) — Tree-sitter grammar for editors that support it (Neovim, Helix, Zed)\n\n### Playground — [playground](https://github.com/almide/playground)\n\nBrowser-based compiler and runner. The Almide compiler runs as WASM — no server, no installation. Try it at [almide.github.io/playground](https://almide.github.io/playground/).\n\n## Documentation\n\n- [docs/ARCHITECTURE.md](./docs/ARCHITECTURE.md) — Compiler pipeline, module map, design decisions\n- [docs/SPEC.md](./docs/SPEC.md) — Full language specification\n- [docs/GRAMMAR.md](./docs/GRAMMAR.md) — EBNF grammar + stdlib reference\n- [docs/CHEATSHEET.md](./docs/CHEATSHEET.md) — Quick reference for AI code generation\n- [docs/DESIGN.md](./docs/DESIGN.md) — Design philosophy and trade-offs\n- [docs/STDLIB-SPEC.md](./docs/STDLIB-SPEC.md) — Standard library specification (381 functions)\n- [docs/roadmap/](./docs/roadmap/README.md) — Language evolution plans\n\n## Contributing\n\nContributions are welcome! Please open an issue or pull request on [GitHub](https://github.com/almide/almide).\n\nAfter cloning, install the git hooks:\n\n```bash\nbrew install lefthook  # macOS; see https://github.com/evilmartians/lefthook for other platforms\nlefthook install\n```\n\nAll commits must be in English (enforced by the commit-msg hook). See [CLAUDE.md](./CLAUDE.md) for project conventions.\n\n## License\n\nLicensed under either of [MIT](./LICENSE-MIT) or [Apache 2.0](./LICENSE-APACHE) at your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falmide%2Falmide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falmide%2Falmide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falmide%2Falmide/lists"}