ββββββ βββββββ βββ βββ βββββββ βββββββ βββββββ ββββββββββββ
βββββββββββββββββββ ββββ ββββββββββββββββββββββββ βββββββββββββ
βββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββ βββββββ ββββββββββββββββββββββββββββ
βββ ββββββ ββββββ βββ βββ βββ βββββββββ βββ βββββββββββ
βββ ββββββ ββββββ βββ βββ βββ βββββββββ βββββββββββ
THE ARK COMPILER v112.0 (PRIME)
-------------------------------
System: Linear Type System & Neuro-Symbolic Intrinsic Engine
Ark is a programming language where resource safety is a compile-time guarantee, not a runtime hope. It combines a high-performance Rust core with a Linear Type System that eliminates garbage collection, prevents double-spends, and catches resource leaks before your code ever runs.
Use it for: Financial systems, cryptographic protocols, AI-native applications, and anywhere resource correctness is non-negotiable.
Philosophical Manifesto: For the project's vision and design philosophy, see docs/MANIFESTO.md.
The runtime is built on a high-performance Rust foundation (1.93-slim).
- Parity: 107/107 Python intrinsics ported to Rust (109 total including Rust-only additions).
- Performance:
sys.network,sys.fs,sys.cryptorun at native speeds. - Safety: Memory safety enforced by Rust's ownership model + Ark's Linear Checker.
Ark treats sensitive data (Money, Sockets, File Handles) as "Linear Resources".
- No GC: Resources must be used exactly once.
- No Leaks: Dropping a linear variable without consumption causes a Compile-Time Error.
- No Double-Spend: Passed variables are moved, not copied.
AI calls are treated as standard compiler intrinsics (sys.ai.ask), allowing future optimizations like caching, batching, and formal verification of outputs.
Beyond the basics, the Standard Library and featured apps demonstrate production-grade capabilities.
Status: π’ PRODUCTION
A full implementation of the Secp256k1 Elliptic Curve and BIP39 Mnemonic generation written entirely in Ark.
- Features: Point Addition, Point Doubling, Scalar Multiplication, PBKDF2-HMAC-SHA512.
- Significance: Proves Ark can handle complex mathematical operations without relying on C bindings.
Status: π‘ BETA
A 1000+ line Recursive Descent Parser and Lexer for the Ark language, written in Ark.
- Features: Tokenizes source code, builds AST nodes, reports range-based errors.
- Significance: Demonstrates language self-sufficiency and complex data structure handling (recursive structs/lists).
Ark ships with a multi-agent AI orchestration layer β spawn, coordinate, and sandbox AI agents from Ark code or the CLI.
Task β RouterAgent β [CoderAgent | ResearcherAgent | ReviewerAgent] β Review β Result
β execute_ark / compile_check
Ark Compiler (meta/ark.py, core/)
- 4 Specialist Agents: Router, Coder (Ark-aware), Researcher, Reviewer
- Swarm Orchestration:
router,broadcast,consensus,pipelinestrategies - MCP Client: JSON-RPC 2.0 over Stdio/HTTP/SSE
- Security: AST-level sandboxing + Docker isolation for untrusted workloads
- Memory: Fernet-encrypted storage + TF-IDF semantic recall
- Backend-agnostic: Gemini, OpenAI, Ollama β configure via env vars
# Run the agent orchestrator
python -m src.agent "Write a Python script that sorts a CSV by the second column"Full guide: User Manual β Agent Framework
Call AI directly from .ark code β built-in intrinsics, no external SDK required:
// Direct AI call
answer := sys.ai.ask("What is the capital of France?")
print(answer)
// Agent with persona + conversation history
sys.vm.source("lib/std/ai.ark")
coder := Agent.new("You are a Rust expert.")
response := coder.chat("Explain ownership.")
// Multi-agent swarm
swarm := Swarm.new([coder, Agent.new("You are a code reviewer.")])
results := swarm.run("Write a sort function")
Configuration: Set
GOOGLE_API_KEYorARK_LLM_ENDPOINT. No key? AI degrades gracefully.
# Clone the Repository
git clone https://github.com/merchantmoh-debug/ark-compiler.git
cd ark-compiler
# Build Docker Container (Recommended)
docker build -t ark-compiler .
# Run Interactive Shell
docker run -it --rm ark-compiler# Install Python dependencies
pip install -r requirements.txt
# Install Rust toolchain (if building from source)
cargo build --release1. Wallet CLI (Pure Ark Crypto): Secp256k1 + BIP39 β zero C bindings, 100% Ark.
python3 meta/ark.py run apps/wallet.ark create "mypassword"2. Market Maker (Linear Types in Action): HFT bot simulation β Linear Types enforce that positions are never double-counted.
python3 meta/ark.py run apps/market_maker.ark3. Snake Game (Live Web App): A fully functional game served over HTTP, written in Ark.
python3 meta/ark.py run examples/snake.ark
# Open http://localhost:8000 in your browserNew to Ark? Start here:
| Document | Description |
|---|---|
| User Manual | Complete language guide β variables, functions, control flow, imports, stdlib, crypto, blockchain, AI, and more. |
| Quick Start | 5-minute setup and Hello World. |
| API Reference | All 109 built-in intrinsics with signatures and examples. |
| Stdlib Reference | Documentation for all 12 standard library modules. |
| Manifesto | Why Ark exists β the design philosophy. |
| Directory | Description | Maturity |
|---|---|---|
core/ |
Rust Runtime & Intrinsics. The engine. | π’ STABLE |
lib/std/ |
Standard Library. 12 modules (math, net, io, crypto, chain, etc.). |
π’ STABLE |
lib/wallet_lib.ark |
Crypto Library. Secp256k1/BIP39 implementation. | π’ STABLE |
apps/lsp.ark |
Language Server. Self-hosted Parser/Lexer. | π‘ BETA |
apps/server.ark |
HTTP Server. Functional web server. | π‘ BETA |
src/ |
Agent Framework. Multi-agent orchestration, MCP client, sandboxed execution, encrypted memory. | π‘ BETA |
meta/ |
Tooling. Python-based JIT, Security Scanner, Gauntlet runner. | π‘ BETA |
docs/ |
Documentation. API Reference, Stdlib Reference, Manifesto. | π’ STABLE |
site/ |
Web Assets. Landing page, WASM test harness. | π‘ BETA |
tests/ |
Test Suite. 100+ feature tests (Gauntlet runner). | π’ PASSING |
Ark uses a Capability-Token System (ARK_CAPABILITIES) to sandbox execution.
- Default: Safe Mode (No IO/Net).
- Dev Mode:
export ARK_CAPABILITIES="exec,net,fs_write,fs_read,thread,ai"
Security Scanner:
The JIT engine includes a static analysis pass (meta/ark_security.py) that scans for:
- SQL/Command Injection patterns.
- Path Traversal vulnerabilities.
- Hardcoded Secrets.
Dual Licensed: AGPL v3 (Open Source) or Commercial (Sovereign Systems).