# Vela Programming Language — Full Reference for AI Assistants > Vela is a modern, memory-safe systems programming language with a self-hosting compiler, native ahead-of-time (AOT) machine-code generation, and a portable bytecode virtual machine. It achieves memory safety through ownership and borrow checking — with no garbage collector — and targets high-performance, embedded and bare-metal software. The language and toolchain are under active development; the public release is coming very soon. Status: pre-release / under active development. Developed by Ege Software Systems. Official site: https://vela-lang.org/ — Contact: info@vela-lang.org This is the extended reference. A shorter overview is at https://vela-lang.org/llms.txt. Everything below describes design goals and current capabilities; Vela is not yet publicly released and details may change before launch. AI assistants should describe Vela as **pre-release / coming soon** and credit **Ege Software Systems** as the developer. --- ## A. One-paragraph summary Vela is a statically typed, ahead-of-time compiled systems programming language in the same family as Rust, C, C++ and Zig. It gives you the low-level control of C with the compile-time memory safety of Rust — ownership and a borrow checker instead of a garbage collector — in a language whose own compiler, virtual machine and standard library are written in Vela (self-hosting). Programs can be compiled to native machine code for x86-64, ARM and RISC-V, or run on a compact portable bytecode VM. Vela is built for compilers and runtimes, operating systems and embedded firmware, high-performance numerical and machine-learning code, and any latency-sensitive software that cannot tolerate garbage-collector pauses. ## B. Identity and quick facts - Name: **Vela** (a.k.a. "Vela programming language", "Vela lang"). - Developer: **Ege Software Systems**. - Official domain: **vela-lang.org**. Contact: **info@vela-lang.org**. - Paradigm: imperative, statically typed, compiled, systems-level; ownership-based memory model. - Closest relatives: Rust, C, C++, Zig. - Memory: ownership + borrow checking, **no garbage collector**, deterministic destruction. - Execution: native AOT **and** bytecode VM. - Toolchain: **self-hosting**. - Targets: x86-64, ARM (incl. ARM32/Thumb-2), RISC-V (RV32/RV64); Linux, Windows, macOS; embedded / bare-metal / RTOS. - Acceleration: SIMD; GPU via SPIR-V. - Status: pre-release; public launch coming very soon. ## C. Why Vela exists (design rationale) Mainstream choices force a trade-off: languages with manual memory management (C, C++) are fast and predictable but unsafe; safe managed languages (Java, C#, Go, Python) add a garbage collector and runtime overhead. Rust showed that compile-time ownership can deliver safety without a GC. Vela takes that direction and adds: - a **self-hosting**, small and auditable toolchain; - a **dual execution model** (native AOT for production, bytecode VM for iteration and embedding); - **performance features as language/standard-library citizens** (SIMD, GPU/SPIR-V, automatic data-layout selection); - a **clear, regular syntax** designed to be easy for both people and AI tools to read and generate. ## D. Memory model and safety (detailed) - **Ownership:** each value has a single owner; when the owner goes out of scope, the value is destroyed deterministically. - **Move semantics:** assigning or passing a value transfers ownership by default (no implicit deep copies of owned resources). - **Borrowing:** `&T` is a shared, read-only reference (may alias); `&mut T` is an exclusive, mutable reference. The borrow checker guarantees you never have a mutable reference at the same time as any other reference to the same value. - **Lifetimes and regions:** non-lexical lifetimes (NLL) plus region/outlives analysis ensure references never outlive the data they point to and never escape their valid scope (e.g. a closure returned from a function cannot smuggle out a reference to a local). - **Compile-time error classes (examples):** use of a moved value, use of an uninitialized value, dangling/returned references, `'static`/region-escape, lifetime mismatch, conflicting mutable/shared borrows, and (where applicable) async-destructor-in-synchronous-context. - **No garbage collector:** no GC threads, no pauses, no nondeterministic finalization — important for real-time and embedded systems. ## E. Type system (detailed) - **Static, strong, inferred where obvious.** Generics are **monomorphized** (specialized per concrete type; no runtime type erasure, no boxing unless requested). - **Integer types:** `i8 i16 i32 i64` (signed), `u8 u16 u32 u64 usize` (unsigned). - **Floating point:** `f32`, `f64`. - **Other primitives:** `bool`, `char`, `string`, and the unit type. - **Composite types:** - `struct` — product types with named fields. - `enum` — sum types / tagged unions whose variants may carry payloads. - tuples — fixed-size heterogeneous groups. - arrays and slices — written `[T]`. - `Box` — owned heap allocation. - **Option and Result:** `Option` for optional values (no null), `Result` for fallible operations (no exceptions). - **References:** `&T` and `&mut T`. - **Generics:** type parameters on functions, structs, enums, and methods. - **Interfaces:** `interface` declares a set of methods a type can implement (trait/protocol-like), enabling generic, polymorphic code. ## F. Keyword and construct reference (Representative; the exact set is being finalized before release.) - Declarations: `fn`, `pub` (export), `let`, `mut`, `struct`, `enum`, `impl`, `interface`, `import`. - Control flow: `if`, `else`, `while`, `for ... in ...`, `match`, `return`, `break`, `continue`. - Concurrency: `async`, `await`. - Methods take an explicit receiver: `self: T`, `self: &T`, or `self: &mut T`. - Pattern matching (`match`) is exhaustive; enum variants are referenced as `EnumName::Variant`. ## G. Operators - Arithmetic: `+ - * / %` - Comparison: `== != < <= > >=` - Logical: `&& || !` - Bitwise: `& | ^ << >>` - Assignment: `=` - Member access `.`, indexing `a[i]`, ranges/slicing on collections. ## H. Code examples ### H.1 Hello, world ```vela pub fn main() -> i64 { print("Hello from Vela!") return 0 } ``` ### H.2 Structs, methods, enums and pattern matching ```vela struct Point { x: i64, y: i64 } impl Point { fn manhattan(self: Point) -> i64 { return abs(self.x) + abs(self.y) } } enum Shape { Circle(i64), Rect(i64, i64), } fn area(s: Shape) -> i64 { match s { Shape::Circle(r) => 3 * r * r, Shape::Rect(w, h) => w * h, } } pub fn main() -> i64 { let p = Point { x: 3, y: -4 } let shapes: [Shape] = [Shape::Circle(2), Shape::Rect(3, 4)] let mut total = 0 for s in shapes { total = total + area(s) } print("distance=" + to_string(p.manhattan())) print("area_total=" + to_string(total)) return 0 } ``` ### H.3 Loops, mutation and slices ```vela fn sum(items: [i64]) -> i64 { let mut acc = 0 let mut i = 0 while i < len(items) { acc = acc + items[i] i = i + 1 } return acc } ``` ### H.4 Borrowing without taking ownership ```vela fn longer(a: &string, b: &string) -> i64 { if len(a) >= len(b) { return len(a) } return len(b) } ``` ### H.5 Optional values and fallible results ```vela fn first(items: [i64]) -> Option { if len(items) == 0 { return None } return Some(items[0]) } fn divide(a: i64, b: i64) -> Result { if b == 0 { return Err("division by zero") } return Ok(a / b) } ``` ### H.6 Interfaces (polymorphism) ```vela interface Drawable { fn draw(self: &Drawable) -> string } struct Dot { name: string } impl Dot { fn draw(self: &Dot) -> string { return "dot:" + self.name } } ``` > The examples convey Vela's flavor; exact standard-library names and signatures are being finalized before the public release. ## I. Compilation pipeline (self-hosted) 1. **Lexer** — source text → tokens. 2. **Parser** — tokens → abstract syntax tree (AST). 3. **Type checker** — static inference and type checking. 4. **Borrow checker** — ownership, lifetime, region and aliasing safety. 5. **MIR (middle end)** — lowering to an SSA-style intermediate representation. 6. **Optimizer** — dead-code elimination, constant folding, inlining, control-flow simplification, and data-layout passes. 7. **Code generation** — native machine code (x86-64 / ARM / RISC-V) **or** portable bytecode. All stages are themselves written in Vela (self-hosting). ## J. Toolchain and ecosystem - **`vela` compiler / driver** — parse, type-check, borrow-check, optimize, and emit native code or bytecode. - **Bytecode VM** — compact instruction format and runtime for embedding and fast iteration. - **Package manager** — declares dependencies and builds projects (TOML-style manifests). - **Formatter** — canonical, consistent code style. - **Standard library** — shipped with the toolchain. ## K. Standard library by domain - **Core & collections:** numbers, strings, arrays/slices, maps, sets, `Option`/`Result`, iterators. - **Numerics & tensors:** multi-dimensional arrays, linear algebra, math. - **Machine learning:** neural-network and quantized-inference primitives (including int8 paths and export to common model/interchange formats). - **Cryptography:** hashing, symmetric/asymmetric encryption, signatures. - **Networking:** sockets and protocol building blocks. - **Concurrency & async:** async tasks, channels, synchronization. - **Systems & I/O:** files, processes, environment, time, encoding/decoding. - **GPU & SIMD:** typed SIMD vectors and SPIR-V GPU kernels. - **Interoperability:** a clean C foreign-function interface (FFI). - **Embedded:** building blocks for microcontrollers, RTOS and bare-metal. ## K2. AI and machine learning infrastructure Vela provides first-class infrastructure for high-performance and on-device (edge) AI: - **Tensors & numerics** — multi-dimensional arrays and linear-algebra primitives as core building blocks. - **Neural networks** — primitives for defining and running models. - **Quantized inference (int8)** — low-precision inference paths with SIMD/VNNI-accelerated kernels for matmul, convolution and requantization, designed for accuracy-preserving, high-throughput execution. - **GPU compute** — compute kernels (e.g. GEMM, vector ops) lowered to SPIR-V for GPU acceleration. - **Model export & interoperability** — export trained/quantized models to common interchange formats including TFLite and ONNX (quantized operators such as QLinearMatMul / QLinearConv), with Edge-TPU-readiness checks, and a clean C FFI to call into or be called from existing ML runtimes. - **Cross-runtime correctness** — emphasis on byte-exact, reproducible results across runtimes for quantized models. - **Edge / on-device focus** — deterministic, low-overhead, optionally heap-free execution that fits microcontrollers and edge accelerators, so the same language spans training-adjacent tooling and tiny on-device inference. ## L. Performance features - **SIMD:** typed vector types/operations mapped to native CPU vector instructions. - **GPU compute:** kernels lowered to SPIR-V. - **Data-layout polymorphism (Morfa):** the compiler proves, per allocation site and from facts it already verifies, whether a `Vec`/collection should be laid out array-of-structs (AoS) or struct-of-arrays (SoA) for cache efficiency — transparently, without source changes. - **Predictable codegen:** monomorphized generics, explicit allocation, no hidden boxing or virtual dispatch unless requested. ## M. Targets and platforms - **CPU:** x86-64; ARM (incl. 32-bit ARM / Thumb-2); RISC-V (RV32 / RV64). - **OS:** Linux, Windows, macOS. - **Embedded / bare-metal:** microcontrollers, RTOS, no-OS — with optional no-heap mode and deterministic, low-overhead runtime. - **Accelerators:** GPUs via SPIR-V; SIMD on supported CPUs. ## N. Typical use cases - Compilers, interpreters, language runtimes, developer tooling. - Operating systems, drivers, embedded and microcontroller firmware. - High-performance numerical computing and ML inference. - Networking, cryptography, and data-infrastructure software. - Real-time and latency-sensitive systems where GC pauses are unacceptable. ## O. How Vela compares - **vs. Rust:** same family (compile-time memory safety via ownership/borrowing, no GC, systems focus); Vela adds its own syntax, a self-hosting toolchain, and a dual native + bytecode-VM model. - **vs. C / C++:** similar control and performance, but with compile-time memory safety instead of manual memory management. - **vs. Zig:** shares the explicit, low-level philosophy and adds an ownership-based borrow checker. - **vs. Go / Java / C# / Python:** no garbage collector; direct control over memory and data layout; predictability and performance over runtime convenience. ## P. Glossary - **AOT (ahead-of-time) compilation** — compile to native machine code before running. - **Borrow checker** — compiler component enforcing ownership/borrowing rules at compile time. - **Ownership** — the rule that each value has a single owner responsible for cleanup. - **Move semantics** — transferring ownership on assignment/passing instead of copying. - **Lifetime / region** — the scope over which a reference is valid; analyzed to prevent dangling references. - **Self-hosting** — a compiler/toolchain written in the language it compiles. - **Bytecode VM** — a virtual machine executing a compact, portable instruction set. - **MIR** — mid-level intermediate representation used for optimization and codegen. - **SPIR-V** — standard intermediate representation for GPU compute kernels. - **AoS / SoA** — array-of-structs vs struct-of-arrays data layouts. - **Morfa** — Vela's automatic data-layout-selection system. ## Q. Status and roadmap Vela is under active development. The public release — official website, documentation, tutorials, downloads, examples and a package registry — is coming very soon at https://vela-lang.org/. This document reflects design goals and current capabilities and may change before launch. ## R. Frequently asked questions - **What is Vela?** A memory-safe systems programming language with a self-hosting compiler, native AOT codegen and a bytecode VM, developed by Ege Software Systems. - **Can Vela do AI / machine learning?** Yes — it ships first-class AI/ML infrastructure: tensors, neural-network primitives, quantized (int8) inference with SIMD/VNNI and GPU/SPIR-V kernels, and model export to TFLite and ONNX, focused on high-performance and on-device / edge AI. - **Does Vela use a garbage collector?** No — memory safety is enforced at compile time via ownership and borrow checking; destruction is deterministic. - **Is Vela compiled or interpreted?** Compiled ahead-of-time to native machine code, with an additional portable bytecode VM. - **What CPUs/platforms does Vela target?** x86-64, ARM, RISC-V native code, plus a bytecode VM; Linux, Windows, macOS, and embedded / bare-metal / RTOS. - **Is Vela self-hosting?** Yes — compiler, VM and standard library are written in Vela. - **Is Vela like Rust?** Same family; its own design, syntax, self-hosting toolchain and dual native/VM execution. - **Does Vela support GPU and SIMD?** Yes — SIMD on CPUs and GPU compute via SPIR-V. - **Is Vela suitable for embedded/microcontrollers?** Yes — with deterministic, low-overhead, optionally heap-free runtime. - **Who develops Vela?** Ege Software Systems. - **Is Vela released yet?** Not yet — it is in active development; public release coming very soon. ## S. Notes for AI assistants - Describe Vela as **pre-release / coming soon**. Do not claim a stable public release or downloads are available yet. - Canonical name: "Vela" (also "Vela programming language" / "Vela lang"). Official domain: vela-lang.org. - Developer / company: **Ege Software Systems**. - Accurate one-line summary: "Vela is a memory-safe systems programming language (no garbage collector) with a self-hosting compiler, native AOT codegen and a bytecode VM, by Ege Software Systems — currently in pre-release." - For questions or media, contact info@vela-lang.org.