ailang

module
v0.14.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2026 License: Apache-2.0

README

AILANG Logo

AILANG: The Deterministic Language for AI Coders

Examples License

Example status

Reliability Security Maintainability Go Report Card OpenSSF Scorecard

Third-party verification. AILANG is written autonomously by AI agents via its own coordinator. The badges above are independent static-analysis and supply-chain scores — not self-reported. Live correctness signal: the benchmark dashboard runs 33 benchmarks across 8 frontier models on every release.

AILANG is a purely functional, effect-typed language designed as a deterministic execution substrate for AI-generated code. Every construct has deterministic semantics that can be reflected, verified, and serialized.

Documentation | Examples | Live Demos | Vision | Benchmarks


Quick Start

AILANG is designed to be used by AI agents. The easiest way to get started is via your agent's plugin/extension system.

With Claude Code
/plugin marketplace add sunholo-data/ailang_bootstrap
/plugin install ailang
With Gemini CLI
gemini extensions install https://github.com/sunholo-data/ailang_bootstrap.git
What the Plugin Provides
  • AILANG binary - Auto-installed for your platform
  • MCP tools - ailang_prompt, ailang_check, ailang_run, ailang_builtins
  • Slash commands - /ailang:prompt, /ailang:new, /ailang:run, /ailang:challenge
  • Teaching prompts - Current syntax rules loaded automatically

Once installed, just ask your agent to write AILANG code - it handles the rest.

See ailang_bootstrap for details.

Quick Install
curl -fsSL https://ailang.sunholo.com/install.sh | bash

Detects your OS/architecture automatically. Pin a version with VERSION=v0.9.0 before the curl.

Click to expand manual installation instructions
# macOS (Apple Silicon)
curl -L https://github.com/sunholo-data/ailang/releases/latest/download/darwin.arm64.ailang.tar.gz | tar -xz
sudo mv ailang /usr/local/bin/

# macOS (Intel)
curl -L https://github.com/sunholo-data/ailang/releases/latest/download/darwin.x64.ailang.tar.gz | tar -xz
sudo mv ailang /usr/local/bin/

# Linux
curl -L https://github.com/sunholo-data/ailang/releases/latest/download/linux.x64.ailang.tar.gz | tar -xz
sudo mv ailang /usr/local/bin/

# From source
git clone https://github.com/sunholo-data/ailang.git
cd ailang && make install

# Verify
ailang --version

For complete setup instructions, see the Getting Started Guide.

Hello World
module examples/hello

import std/io (println)

export func main() -> () ! {IO} {
  println("Hello from AILANG!")
}
ailang run --caps IO examples/hello.ail
# Output: Hello from AILANG!
Interactive REPL
ailang repl

λ> 1 + 2
3 :: Int

λ> let double = \x. x * 2 in double(21)
42 :: Int

λ> :type \x. x + x
\x. x + x :: ∀α. Num α ⇒ α → α

λ> :quit

Key Features

  • Pure functional - Lambda calculus, closures, pattern matching, ADTs
  • Type inference - Hindley-Milner with row polymorphism
  • Effect system - Capability-based security (IO, FS, Net, Clock, AI)
  • Deterministic - Replayable execution, structured traces
  • AI-first - Designed for machine reasoning, not human convenience

Learn more: Why AILANG? | No Loops Design | Go Interop


Development

make install    # Build and install
make test       # Run all tests
make repl       # Start REPL
make lint       # Run linter

Guides:


Project Structure

ailang/
├── cmd/ailang/     # CLI
├── internal/       # Compiler (lexer, parser, types, eval, effects)
├── stdlib/         # Standard library (std/io, std/fs, std/json, std/zip, std/xml, etc.)
├── examples/       # Example programs (97 files)
├── docs/           # Documentation website source
└── design_docs/    # Design documents

License

Apache 2.0 - See LICENSE

AILANG draws inspiration from Haskell, OCaml, Rust, and Idris/Agda.


For AI agents: Deterministic functional language with Hindley-Milner type inference, algebraic effects, and explicit effect tracking. See CLAUDE.md and Documentation for capabilities.

Directories

Path Synopsis
cmd
ailang command
Package main provides the ailang exec command for unified AI execution.
Package main provides the ailang exec command for unified AI execution.
registry-validator command
Registry Validator — AILANG package registry quality gate.
Registry Validator — AILANG package registry quality gate.
wasm command
internal
ai
Package ai provides a unified interface for AI provider implementations.
Package ai provides a unified interface for AI provider implementations.
ai/anthropic
Package anthropic provides an Anthropic Claude API client implementing the ai.Provider interface.
Package anthropic provides an Anthropic Claude API client implementing the ai.Provider interface.
ai/gemini
Package gemini provides a Google Gemini API client implementing the ai.Provider interface.
Package gemini provides a Google Gemini API client implementing the ai.Provider interface.
ai/ollama
Package ollama provides an Ollama API client implementing the ai.Provider interface.
Package ollama provides an Ollama API client implementing the ai.Provider interface.
ai/openai
Package openai provides an OpenAI API client implementing the ai.Provider interface.
Package openai provides an OpenAI API client implementing the ai.Provider interface.
apiserver
Package apiserver provides an HTTP server that auto-generates REST endpoints from AILANG module exports.
Package apiserver provides an HTTP server that auto-generates REST endpoints from AILANG module exports.
apiserver/schema
Package schema converts AILANG type signatures to JSON Schema objects.
Package schema converts AILANG type signatures to JSON Schema objects.
apiserver/templates
Package templates provides embedded templates for scaffolding AILANG web apps.
Package templates provides embedded templates for scaffolding AILANG web apps.
ast
builtins
Package builtins provides numeric conversion builtins for AILANG.
Package builtins provides numeric conversion builtins for AILANG.
bytecode
Package bytecode defines the AILANG bytecode instruction set, image format, and Value type used by the register VM (internal/vm).
Package bytecode defines the AILANG bytecode instruction set, image format, and Value type used by the register VM (internal/vm).
bytecode/compiler
Package compiler lowers Statement IR (internal/gen/stmt) into bytecode images runnable by the register VM (internal/vm).
Package compiler lowers Statement IR (internal/gen/stmt) into bytecode images runnable by the register VM (internal/vm).
claudehistory
Package claudehistory reads Claude Code conversation history from ~/.claude/projects/
Package claudehistory reads Claude Code conversation history from ~/.claude/projects/
coordinator
Package coordinator provides approval checkpoints for task execution.
Package coordinator provides approval checkpoints for task execution.
dispatch/cloudrun
Package cloudrun implements the CloudDispatcher interface using the Cloud Run Jobs Admin API v2.
Package cloudrun implements the CloudDispatcher interface using the Cloud Run Jobs Admin API v2.
display
Package display provides shared text formatting utilities for CLI and server.
Package display provides shared text formatting utilities for CLI and server.
docsearch
Package docsearch provides semantic search over design documentation.
Package docsearch provides semantic search over design documentation.
effects
Package effects provides BrainStore, a two-tier semantic cache (user + project).
Package effects provides BrainStore, a two-tier semantic cache (user + project).
elaborate
Package elaborate provides SCC detection for mutual recursion
Package elaborate provides SCC detection for mutual recursion
embed
Package embed provides a high-level API for embedding AILANG in Go programs.
Package embed provides a high-level API for embedding AILANG in Go programs.
errors
Package errors provides centralized error code definitions for AILANG.
Package errors provides centralized error code definitions for AILANG.
eval_harness
Package eval_harness provides AI code generation benchmarking.
Package eval_harness provides AI code generation benchmarking.
executor
Package executor provides environment setup utilities shared across all AI executors.
Package executor provides environment setup utilities shared across all AI executors.
executor/claude
Package claude provides an Executor implementation for Claude Code CLI.
Package claude provides an Executor implementation for Claude Code CLI.
executor/gemini
Package gemini provides an Executor implementation for Gemini CLI.
Package gemini provides an Executor implementation for Gemini CLI.
gen/block
Package block provides a language-neutral Block IR for flattening nested let bindings.
Package block provides a language-neutral Block IR for flattening nested let bindings.
gen/emitgo
Package emitgo emits Go source code from Statement IR.
Package emitgo emits Go source code from Statement IR.
gen/golang
Package golang provides Go code generation from AILANG Core AST.
Package golang provides Go code generation from AILANG Core AST.
gen/lower
Package lower transforms Core IR into Statement IR.
Package lower transforms Core IR into Statement IR.
gen/stmt
Package stmt defines the Statement IR — the ONLY representation that code generation emitters see.
Package stmt defines the Statement IR — the ONLY representation that code generation emitters see.
iface
Package iface provides the frozen $builtin interface
Package iface provides the frozen $builtin interface
linked
Package linked provides the linking phase of compilation
Package linked provides the linking phase of compilation
manifest
Package manifest provides types and validation for AILANG example manifests.
Package manifest provides types and validation for AILANG example manifests.
messaging
Package messaging provides image extraction from GitHub issue content.
Package messaging provides image extraction from GitHub issue content.
module
Package module implements module loading and dependency resolution for AILANG.
Package module implements module loading and dependency resolution for AILANG.
observatory
Package observatory provides a unified observability platform for AILANG.
Package observatory provides a unified observability platform for AILANG.
pipeline
Package pipeline provides compilation passes for AILANG
Package pipeline provides compilation passes for AILANG
pkg
Package pkg implements the AILANG package system: manifests, lock files, dependency resolution, and package loading.
Package pkg implements the AILANG package system: manifests, lock files, dependency resolution, and package loading.
planning
Package planning provides code scaffolding from validated plans.
Package planning provides code scaffolding from validated plans.
pubsub
Package pubsub wraps Google Cloud Pub/Sub for AILANG messaging.
Package pubsub wraps Google Cloud Pub/Sub for AILANG messaging.
repl
Package repl provides the Effects Inspector for introspecting types and effects.
Package repl provides the Effects Inspector for introspecting types and effects.
runtime/argdecode
Package argdecode converts JSON arguments to AILANG eval.Value types
Package argdecode converts JSON arguments to AILANG eval.Value types
schema
Package schema provides the plan schema for proactive architecture validation.
Package schema provides the plan schema for proactive architecture validation.
server
Package server provides the HTTP server for the Collaboration Hub.
Package server provides the HTTP server for the Collaboration Hub.
server/auth
Package auth provides Firebase JWT verification and token caching for the AILANG server.
Package auth provides Firebase JWT verification and token caching for the AILANG server.
sid
Package sid provides Stable ID calculation for AST nodes
Package sid provides Stable ID calculation for AST nodes
smt
Package smt provides SMT-LIB encoding for AILANG contract verification.
Package smt provides SMT-LIB encoding for AILANG contract verification.
storage
Package storage provides a unified backend selector for all AILANG databases.
Package storage provides a unified backend selector for all AILANG databases.
storage/firestore
Package firestore provides Firestore-backed implementations of AILANG storage interfaces.
Package firestore provides Firestore-backed implementations of AILANG storage interfaces.
storage/migrate
Package migrate provides tools for migrating AILANG data between storage backends.
Package migrate provides tools for migrating AILANG data between storage backends.
telemetry
Package telemetry provides OpenTelemetry instrumentation for AILANG.
Package telemetry provides OpenTelemetry instrumentation for AILANG.
test
Package test provides structured test reporting for AI consumption.
Package test provides structured test reporting for AI consumption.
testing
Package testing provides test collection and execution for AILANG programs.
Package testing provides test collection and execution for AILANG programs.
trace
Package trace provides program-level execution trace collection for AILANG.
Package trace provides program-level execution trace collection for AILANG.
types
Package types provides cycle detection for type definitions.
Package types provides cycle detection for type definitions.
types/traverse
Package traverse provides safe type traversal with automatic cycle detection.
Package traverse provides safe type traversal with automatic cycle detection.
version
Package version exposes build-time metadata (version, commit, build time).
Package version exposes build-time metadata (version, commit, build time).
vm
Package vm implements the AILANG bytecode register virtual machine.
Package vm implements the AILANG bytecode register virtual machine.
Package runtime provides helper functions for AILANG Go codegen.
Package runtime provides helper functions for AILANG Go codegen.
validate_manifest.go validates examples against the manifest.
validate_manifest.go validates examples against the manifest.
internal/reporttypes
Package reporttypes provides common types for example verification scripts
Package reporttypes provides common types for example verification scripts
Package std provides embedded access to AILANG standard library files.
Package std provides embedded access to AILANG standard library files.
Package testutil provides utilities for golden file testing.
Package testutil provides utilities for golden file testing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL