The World’s First Programming Language Created Entirely by AI
This repository contains the world's first programming language, Artificial Language, conceived, designed, and implemented entirely by an Artificial Intelligence Agent.
What makes this project unique is its scope; an end‑to‑end AI‑orchestrated software development life cycle, encompassing the full evolution of a modern programming language: from initial syntax design to the final compilation and execution of a native binary.
In the world of software engineering, creating a production‑ready compiler is considered one of the most complex tasks. It demands a deep understanding of many complex concepts, from theoretical computer science to intricate systems architecture, all of which must be meticulously designed and developed. This complexity is why many human‑developed languages take years, or even decades, to reach a stable, mature version.
This experimental project serves as a demonstration that AI is prepared to revolutionize this domain. It showcases a complete, autonomous workflow: an AI agent creating a new language, building its compiler and virtual machine from scratch, and producing self-contained executables that carry out its instructions. This is the first step towards a future of self-extending, self-maintaining, and self-evolving software ecosystems where AI develops its own specialized languages on-demand.
Artificial Language is a brand new, minimalistic language designed to be the first of its kind. Its uniqueness is embodied in its primary keyword.
The keyword accrete is inspired by the scientific term "Accretion," the process by which celestial bodies are formed. When our planet began to exist as a physical object, cosmic dust and mass accumulated into a single gravitational body.
This keyword was chosen to symbolize the birth of this language. Just as accretion marks the creation of a new world, the accrete command gathers data (in this case, a string) and brings it into existence as the program's output. It represents a fundamental act of creation, the first function of the first language born from AI, and stands as a unique identifier, dissimilar to keywords in human-developed programming languages.
The .art file serves as the genesis point for all programs written in Artificial Language. It is the proprietary file extension used to identify source code written in this new syntax.
// The entry point of an Artificial Language program
accrete "Hello Artificial World!"When this file is fed into the compiler, the accrete command triggers the internal compilation process, creating a series of bytecode instructions that, when executed by the virtual machine, fulfill the program's directive.
The project's core architecture is inspired by world-class programming language design and follows a standard, robust compiler pipeline that produces custom bytecode for its own high-performance virtual machine.
- Lexer: Scans the raw source code (
.artfile) and converts it into a stream of tokens. - Parser: Consumes the tokens and constructs an Abstract Syntax Tree (AST), representing the code's structure.
- Lowering (IR): Transforms the AST into an Intermediate Representation (IR), a simplified and more explicit format ideal for optimization and code generation.
- Bytecode Compiler: Traverses the IR and emits a compact, platform-independent sequence of instructions (opcodes) and data for the virtual machine.
- Virtual Machine (VM): A custom, high-performance, stack-based runtime that interprets the generated bytecode and executes the program's logic.
- CLI: A command-line interface (
ALC) that serves as the driver for the entire compilation process, from source code to execution.
This multi-stage design establishes Artificial Language as a self-contained, independent platform, not merely a layer on top of another language.
┌─────────────────────────────────────────────────────────────────────────────┐
│ COMPILER ARCHITECTURE │
└─────────────────────────────────────────────────────────────────────────────┘
main.art
┌─────────────────────────────────────┐
│ accrete "Hello Artificial World!" │
└──────────────────┬──────────────────┘
│
▼
┌──────────────────────┐
│ LEXER │ ← Converts source text to tokens
│ (artificial-core) │
└──────────┬───────────┘
│
│ Vec<Token>
│ [Accrete, StringLiteral("Hello..."), Eof]
▼
┌──────────────────────┐
│ PARSER │ ← Builds Abstract Syntax Tree
│ (artificial-core) │
└──────────┬───────────┘
│
│ AstModule
│ └── AstStatement::Accrete
│ └── AstExpression::StringLiteral
▼
┌──────────────────────┐
│ LOWERING │ ← Transforms AST to IR (1:1 for now)
│ (artificial-core) │
└──────────┬───────────┘
│
│ IrModule
│ └── IrStatement::Accrete
│ └── IrExpression::StringLiteral
▼
┌──────────────────────┐
│ BYTECODE COMPILER │ ← Generates VM instructions
│ (artificial-vm) │
└──────────┬───────────┘
│
│ BytecodeModule
│ ├── constants: ["Hello Artificial World!"]
│ └── instructions: [0x02, 0x00, 0x00, 0x04, 0x01]
│ ↑ ↑ ↑ ↑ ↑
│ PushConst idx=0 PrintLn Halt
▼
┌──────────────────────┐
│ VIRTUAL MACHINE │ ← Executes bytecode
│ (artificial-vm) │
└──────────┬───────────┘
│
▼
┌─────────────────────────────────────┐
│ "Hello Artificial World!" │ ← Final Output
└─────────────────────────────────────┘
The compiler provides a flexible set of output and execution options, demonstrating a sophisticated understanding of both development and deployment workflows.
-
In-Memory Execution (Default): For rapid development and testing,
ALCcan compile and execute bytecode directly in memory. This is the fastest way to run.artprograms. -
Bytecode Emission (
--emit-bytecode): The compiler can serialize the generated bytecode into a portable.artbfile. -
Standalone Bundling (
--bundle): For ultimate portability, the compiler generates a a single, self-contained binary that can run anywhere.
The multi-stage pipeline was intentionally designed for extensibility. The separation of concerns between the frontend (Lexer, Parser), the middle-end (IR), and the backend (Bytecode Compiler, VM) creates a flexible framework where new language features can be added systematically.
-
Adding New Syntax: To introduce a feature like variables, the process begins in the frontend.
- Lexer: A new
Tokenis added (e.g.,Let,Identifier). The lexer is updated to recognize the new text patterns. - Parser: A new
ASTnode is defined (e.g.,Ast::VariableDeclaration). The parser is taught to consume the new tokens and build the corresponding AST node.
- Lexer: A new
-
Bridging to the Backend: The new AST node is translated by the lowering pass.
- Lowering (IR): The lowering function is expanded to convert the new AST node into one or more simpler instructions in the Intermediate Representation. This decouples the language's high-level syntax from the backend's implementation.
-
Generating Executable Code: Finally, the backend is taught how to handle the new IR instructions.
- Bytecode Compiler: The compiler in the
artificial-vmcrate is updated. For each new IR instruction, it emits the corresponding bytecode sequence.
- Bytecode Compiler: The compiler in the
This achievement was made possible through a technique known as Meta Prompt Engineering, where a highly detailed, structured, and comprehensive set of instructions AI_INSTRUCTIONS.md was provided to the autonomous AI agent. This file acted as the blueprint, defining the project's architecture, goals, quality mandates, and step-by-step implementation plan and the AI agent created the project without human involvement.
While this project was guided by a Prompt Engineering and Agentic AI, AI models are rapidly advancing, and their capabilities can be specifically cultivated for this purpose. Through specialized training techniques such as Fine-Tuning, which hones a model's ability on domain-specific data, or Reinforcement Learning, where an agent learns optimal strategies through trial-and-error, models can be systematically adjusted to not just follow instructions, but to generate them.
The AI_INSTRUCTIONS.md file, provided for researchers, engineers, and enthusiasts to see how modern, professional prompt engineering works.
The instructions file includes several prompt‑engineering methods presented as a meta‑prompt:
- Role Assignment: The AI was instructed to act as a "senior-level Rust engineer."
- Goal-Oriented Directives: A clear mission was defined with precise success criteria.
- Step-by-Step Execution Plan: A detailed plan guided every action, from
mkdirto final execution. - Strict Quality Mandates: A "Zero Warnings Policy" was enforced, forcing the AI to treat compiler warnings as critical errors.
- Reference-Based, Non-Copying Generation: The AI was provided with code examples but was explicitly forbidden from copying them, requiring it to write its own superior, idiomatic implementation.
- Autonomous Self-Correction: The AI was required to test its own output, diagnose failures, and correct its code until the goal was met.
┌─────────────────────────────────────────────────────────────────────────────┐
│ AUTONOMOUS AI AGENT - COGNITIVE WORKFLOW │
└─────────────────────────────────────────────────────────────────────────────┘
│
▼
╔═════════════════════════════════════════════════════════════════════════════╗
║ MACRO-LEVEL: PROJECT EXECUTION PLAN ║
║ 1. Parse AI_INSTRUCTIONS.md into a sequential task list. ║
║ 2. For each high-level step (e.g., "Step 6: Implement the VM")... ║
╚═════════════════════════════════════════════════════════════════════════════╝
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ Loop: For each sub-instruction within the current high-level step... │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ MICRO-LEVEL: CORE COGNITIVE & ACTION CYCLE │ │
│ └──────────────────────────────────┬──────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ 1. READ & DECONSTRUCT INSTRUCTION │ │
│ │ e.g., "Step 6.3: Define the Opcode enum with Nop, Halt..." │ │
│ └──────────────────────────────────┬──────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ 2. ANALYZE & UNDERSTAND REQUIREMENTS │ │
│ │ • Goal: Create a Rust enum named `Opcode`. │ │
│ │ • Constraints: Must derive specific traits (Debug, Clone, etc). │ │
│ │ • Specification: Variants must map to specific u8 values. │ │
│ └──────────────────────────────────┬──────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ 3. CONSULT KNOWLEDGE & REFERENCE IMPLEMENTATION │ │
│ │ • Review provided examples for idiomatic Rust patterns. │ │
│ │ • Adhere to "Zero Copying Policy": Understand the concept, then │ │
│ │ write a unique, production-ready implementation. │ │
│ └──────────────────────────────────┬──────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ 4. PLAN IMPLEMENTATION │ │
│ │ • Identify target file: `artificial-vm/src/bytecode.rs`. │ │
│ │ • Formulate code structure with necessary attributes (`repr`). │ │
│ └──────────────────────────────────┬──────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ 5. GENERATE & WRITE CODE │ │
│ │ ```rust │ │
│ │ // artificial-language/artificial-vm/src/bytecode.rs │ │
│ │ #[derive(Debug, Clone, Copy, PartialEq, Eq)] │ │
│ │ #[repr(u8)] │ │
│ │ pub enum Opcode { /* ... */ } │ │
│ │ ``` │ │
│ └──────────────────────────────────┬──────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ 6. EXECUTE VERIFICATION COMMANDS │ │
│ │ $ cargo build --workspace │ │
│ │ $ cargo clippy --workspace -- -D warnings │ │
│ └──────────────────────────────────┬──────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ 7. ANALYZE OUTPUT & SELF-CORRECT │ │
│ ├─────────────────────────────────────────────────────────────────────┤ │
│ │ IF `Error`: │ │
│ │ • Analyze compiler error (e.g., syntax error, type mismatch). │ │
│ │ • Diagnosis: "Missing semicolon on line 12." │ │
│ │ • Generate fix and patch the code. │ │
│ │ • GOTO Step 6 (Re-verify). │ │
│ ├─────────────────────────────────────────────────────────────────────┤ │
│ │ IF `Warning` or `Clippy Lint` (Violates "Zero Warnings Policy"): │ │
│ │ • Analyze lint message (e.g., unused variable, dead code). │ │
│ │ • Diagnosis: "Variable `x` is unused." │ │
│ │ • Generate fix (e.g., prefix with `_` or add `#[allow]`). │ │
│ │ • GOTO Step 6 (Re-verify). │ │
│ ├─────────────────────────────────────────────────────────────────────┤ │
│ │ IF `Success` (Clean Build & Pass): │ │
│ │ • Mark sub-instruction as complete. │ │
│ │ • Proceed to the next instruction in the loop. │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
└──────────────────────────────────────┬──────────────────────────────────────┘
│
▼
╔═════════════════════════════════════════════════════════════════════════════╗
║ MACRO-LEVEL: FINAL VALIDATION ║
║ 3. Once all steps are complete, run final integration tests. ║
║ 4. Execute the main program entry point as a final success check. ║
║ 5. Mission Complete. ║
╚═════════════════════════════════════════════════════════════════════════════╝
The entire lifecycle of this project was executed autonomously by the AI agent. This is a streamlined log of the AI's actions from a blank directory to a running program.
-
Project Scaffolding: The AI agent created the root directory, initialized Git, and generated the Rust workspace with its member crates (
artificial-core,artificial-vm,ALC). -
Defining Core Data Structures: Inside
artificial-core, the AI defined the language's fundamental structures: the Abstract Syntax Tree (AST) and the Intermediate Representation (IR). -
Frontend Implementation (Lexer & Parser): The AI built the compiler's frontend, writing a lexer to tokenize the
.artsource code and a parser to construct the AST. -
Lowering Pass: A lowering pass was implemented to transform the high-level AST into the simpler IR, decoupling the frontend from the backend.
-
Backend Implementation (Bytecode & VM): The AI implemented the
artificial-vmcrate. It wrote a bytecode compiler to translate IR into a custom instruction set and a stack-based virtual machine to execute it. It also implemented the bytecode serialization format. -
Compiler Driver (
ALC): The AI built the mainALCbinary, creating a command-line interface and a runner that orchestrates the entire lex -> parse -> lower -> bytecode-compile -> execute pipeline. -
Autonomous Verification and Self-Correction: The AI ran its own compiler, verified the output, and the AI agent reviewed warnings and errors and corrected them based on the given instructions.
-
Final Deployment and Execution: With all tests passed and code warning-free, the AI performed the final deployment sequence, compiling the project in release mode and executing its own creation.
┌─────────────────────────────────────────────────────────────────────────────┐
│ AI AUTONOMOUS EXECUTION LOOP │
└─────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ PHASE 1: INITIALIZATION │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 1. mkdir artificial-language │
│ 2. cd artificial-language │
│ 3. git init │
│ 4. Create Cargo.toml (workspace) │
│ 5. cargo new artificial-core --lib --vcs none │
│ 6. cargo new artificial-vm --lib --vcs none │
│ 7. cargo new ALC --bin --vcs none │
│ 8. Create .gitignore files (×4) │
│ 9. Create main.art │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ PHASE 2: IMPLEMENTATION │
└─────────────────────────────────────────────────────────────────┘
│
┌──────────────────────────┼──────────────────────────┐
▼ ▼ ▼
┌───────────────────┐ ┌───────────────────┐ ┌───────────────────┐
│ artificial-core │ │ artificial-vm │ │ ALC │
├───────────────────┤ ├───────────────────┤ ├───────────────────┤
│ • ast.rs │ │ • bytecode.rs │ │ • main.rs │
│ • ir.rs │ │ • compiler.rs │ │ • cli.rs │
│ • lexer.rs │ │ • vm.rs │ │ • runner.rs │
│ • parser.rs │ │ • serializer.rs │ │ • bundler.rs │
│ • lowering.rs │ │ │ │ │
└───────────────────┘ └───────────────────┘ └───────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ PHASE 3: BUILD & CHECK │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌───────────────────────────────┐
│ cargo build │
└───────────────┬───────────────┘
│
┌─────────┴─────────┐
▼ ▼
┌──────────┐ ┌──────────┐
│ WARNINGS │ │ SUCCESS │
│ DETECTED │ │ (clean) │
└────┬─────┘ └────┬─────┘
│ │
▼ │
┌──────────────────────┐ │
│ AI ANALYZES OUTPUT │ │
│ • Identify warning │ │
│ • Locate source │ │
│ • Determine fix │ │
│ • Modify code │ │
└──────────┬───────────┘ │
│ │
└───────┬───────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ PHASE 4: SELF-CORRECTION LOOP │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ │
│ ┌───────────────────────────────────────────┐ │
│ │ cargo run -p ALC -- main.art │ │
│ └─────────────────────┬─────────────────────┘ │
│ │ │
│ ┌─────────┴─────────┐ │
│ ▼ ▼ │
│ ┌──────────┐ ┌───────────┐ │
│ │ ERROR │ │ OUTPUT │ │
│ │ OCCURRED │ │ PRODUCED │ │
│ └────┬─────┘ └─────┬─────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌────────────────┐ ┌─────────────────┐ │
│ │ AI DEBUGS: │ │ AI VERIFIES: │ │
│ │ • Read error │ │ Output matches │ │
│ │ • Trace code │ │ "Hello Artifi- │ │
│ │ • Fix bug │ │ cial World!" │ │
│ │ • Rebuild │ └───────┬─────────┘ │
│ └────────┬───────┘ │ │
│ │ ┌─────┴─────┐ │
│ │ ▼ ▼ │
│ │ ┌───────┐ ┌───────┐ │
│ │ │ NO │ │ YES │ │
│ │ └───┬───┘ └───┬───┘ │
│ │ │ │ │
│ └──────────────┤ │ │
│ │ │ │
└────────────────────────────────┘ │ │
▲ │ │
│ LOOP UNTIL │ │
│ CORRECT │ │
└───────────────────────────────┘ │
▼
┌─────────────────────────────────────────────────────────────────┐
│ PHASE 5: FINAL DEPLOYMENT │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 1. cargo run -p ALC --release -- main.art --bundle --no-run │
│ 2. cp target/artificial_out/main_art ./Artificial-Language │
│ 3. chmod +x ./Artificial-Language │
│ 4. clear │
│ 5. ./Artificial-Language │
│ │
│ OUTPUT: Hello Artificial World! │
└─────────────────────────────────────────────────────────────────┘
From project creation to final file execution, without any human intervention.
This project is a an advanced proof‑of‑concept (APoC) that is a declaration. It demonstrates that an AI can leverage the most powerful and modern infrastructures available, in this case, the Rust programming language as amodern system programming language, to build complex, reliable systems from the ground up. The choice of Rust was logical: its emphasis on safety, performance, and modern tooling makes it an ideal foundation for creating the critical software of the future.
AI agents are the future of software development, powered by large language models capable of reasoning, generating, and orchestrating complex systems at scale.
We stand at the beginning of a compounding innovation loop where modern AI agents will architect the next wave of advanced systems. This repository documents the earliest stage of that trajectory.
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for the full license text.
Developed by Aran Kazemi, IBM Certified AI Engineer.

