{"slug": "neuro-a-compiled-language-for-ai-that-matches-clang-o2", "title": "Neuro, a compiled language for AI that matches Clang -O2", "summary": "Neuro, an alpha-stage Ahead-of-Time compiled language for AI workloads, now compiles its full general-purpose language surface through an LLVM 20 backend, with planned MLIR-based tensor operations, Enzyme-based automatic differentiation, and GPU acceleration via MLIR dialects. The project's Phase 1 core language is complete, and Phase 2 (Tensors and MLIR) is open, with the language aiming to match Clang -O2 performance for high-performance AI development.", "body_md": "An AOT-compiled language for high-performance AI development.\n\n**Status:** Alpha. Phase 1 (Core Language) is complete: the full general-purpose language surface compiles and runs. Phase 2 (Tensors and MLIR) is now open. Per-phase status lives in one place: the [Quick Roadmap](#quick-roadmap).\n\nNeuro is an Ahead-of-Time (AOT) compiled language for AI workloads. Python is interpreted and leans on C libraries for anything fast; Neuro compiles to native code through an LLVM 20 backend instead. Planned on top of that backend:\n\n- MLIR-based tensor operations, for static shape-verified tensor types\n- IR-level automatic differentiation via Enzyme\n- GPU acceleration via MLIR GPU dialects (nvgpu, rocdl, Triton)\n\nA single perceptron with ReLU activation; uses structs, `impl` blocks, associated functions, instance methods, if-expressions, implicit returns, and `println`. [This file compiles and runs today.](/PanzerPeter/Neuro/blob/main/examples/structs/neuron.nr)\n\n```\nstruct Neuron {\n    weight: f64,\n    bias: f64\n}\n\nimpl Neuron {\n    func new(weight: f64, bias: f64) -> Neuron {\n        Neuron { weight: weight, bias: bias }\n    }\n\n    // ReLU activation: pass-through if positive, clamp to zero otherwise\n    func activate(&self, input: f64) -> f64 {\n        val z = (input * self.weight) + self.bias\n        if z > 0.0 { z } else { 0.0 }\n    }\n\n    func is_active(&self, input: f64) -> bool {\n        val z = (input * self.weight) + self.bias\n        z > 0.0\n    }\n}\n\nfunc main() -> i32 {\n    val neuron = Neuron::new(0.5, -0.1)\n\n    val dead = neuron.activate(0.0)         // 0.0 * 0.5 − 0.1 = −0.1 → clamped to 0.0\n    val dead_fires = neuron.is_active(0.0)\n    println(\"input 0.0 -> {dead:.2}  fires: {dead_fires}\")\n\n    val active = neuron.activate(1.0)       // 1.0 * 0.5 − 0.1 =  0.4 → passes through\n    val active_fires = neuron.is_active(1.0)\n    println(\"input 1.0 -> {active:.2}  fires: {active_fires}\")\n\n    if dead > 0.0 { return 1 }\n\n    return (active * 10.0) as i32           // 4\n}\nphp\ninput 0.0 -> 0.00  fires: false\ninput 1.0 -> 0.40  fires: true\n```\n\nEvery row below is implemented, tested, and usable today. Depth lives elsewhere: the [documentation site](https://neuro-lang.netlify.app/) and [docs/](/PanzerPeter/Neuro/blob/main/docs) for reference material, [CHANGELOG.md](/PanzerPeter/Neuro/blob/main/CHANGELOG.md) for the per-release detail, and the [Quick Roadmap](#quick-roadmap) for what is still ahead.\n\n| Feature | Summary | \n|---|---|\n| **Types & inference** | `i8` through`u64` ,`f16` /`bf16` /`f32` /`f64` ,`bool` ,`char` ,`string` ; literal suffixes, digit separators,`as` casts, type aliases,`.is_nan()` | \n| **Functions & control flow** | Recursion, forward refs, implicit returns, named arguments with external labels ( `clamp(x, min: 0.0)` );`if` /`elif` /`else` ,`while` ,`loop` , range-`for` ,`for (i, x) in xs.enumerate()` , labelled`break` /`continue` , block-as-value;`for` over any type implementing the prelude's`IntoIterator` /`Iterator` protocol, plus`.map(f)` /`.filter(p)` head adapters | \n| **Generics** | Generic functions, structs, and impls plus const generics, `where` clauses, and turbofish, all fully monomorphized at zero runtime cost | \n| **Traits & dispatch** | Required and default methods, associated types ( `type Item` /`Self::Item` ) and`Trait<Assoc = T>` bounds, operator traits,`impl Trait` (static) and`dyn Trait` (vtable) dispatch with object-safety checks | \n| **Closures & lambdas** | `\\|x: i32\\| x * x` ,`move` closures,`(T) -> R` function types, higher-order functions; compiled to`{ fn_ptr, env_ptr }` , no heap | \n| **Structs & methods** | Fields, shorthand init, functional update `..base` ,`impl` blocks with`&self` /`&mut self` methods and associated functions;`@derive(Copy, Clone, Debug, PartialEq)` for copying,`{p:?}` rendering, and structural equality | \n| **Enums & newtypes** | Unit, tuple, and struct-field variants; generic enums monomorphized per type argument; `newtype` for distinct nominal wrappers | \n| **Arrays, tuples & collections** | Fixed-size `[T; N]` and anonymous tuples over`Copy` elements; borrowed slices`&[T]` /`&mut [T]` with zero-copy`.slice(range)` over an array or a`Vec` ; heap-backed`Vec<T>` ,`HashMap<K, V>` ,`BTreeMap<K, V>` ,`String` that move on assignment and free at scope exit; statically shaped`Tensor<T, [d0, ...]>` built from an annotated nested literal or`Tensor::<T, [...]>::zeros()` /`ones()` /`identity()` /`random_normal()` /`scalar()` /`from()` , owning its buffer with`.clone()` ,`.to(device)` , and in-place`+=` /`-=` /`*=` /`/=` /`%=` | \n| **Pattern matching** | Exhaustive `match` expressions over variant / literal / or / range / wildcard patterns with`if` guards, plus`val Point { x, y } = p` and`val [a, ..rest] = arr` destructuring | \n| **`Option` / `Result`** | `Option<T>` and`Result<T, E>` from the implicit prelude. They are ordinary generic enums, available with no declaration and no import, variants included;`??` unwraps either with a lazy fallback;`?` propagates the failure to the caller;`val-else` unwraps or exits the scope;`checked_add` /`checked_sub` /`checked_mul` report integer overflow as`Option::None` | \n| **Ownership & borrows** | Move-by-default, `Copy` , deterministic`Drop` ,`&T` /`&mut T` with flow-sensitive exclusivity, lifetime elision and annotations | \n| **Strings** | Immutable fat-pointer `string` with escapes,`&string` slices,`==` ,`+` concatenation,`.len()` /`.clone()` /`.slice(a..b)` /`.char_slice(a..b)` , codepoint iteration with`.chars()` and`.char_indices()` , interpolation`\"{x:.2}\"` , triple-quoted`\"\"\"` blocks with dedent; growable`String` buffer for building text:`push_str` /`clear` /`to_string` | \n| **Modules & visibility** | Multi-file programs: every `.nr` file is a module and`mod.nr` directories nest; inline`module { }` blocks group within one file;`import math::{sqrt}` ,`import ./utils` ,`as` renames, module aliases, variant imports, and`export import` re-export facades; declarations and struct fields are private until`export` opts them in; an implicit prelude puts`Option` /`Result` and`Some` /`None` /`Ok` /`Err` in every module, with`@no_prelude` to opt out | \n| **Toolchain** | Native binaries via inkwell 0.10 / LLVM 20; `neurc check` and`neurc compile` ; buffered`print` /`println` to stdout, line-buffered on a terminal and drained on every exit path;`panic` /`assert` /`unreachable` runtime with located diagnostics, covering array bounds, string slices, a zero divisor, and debug-build integer overflow, all outlined off the hot path | \n\n**Alpha memory warning.** Stack values are reclaimed on return and string literals live in `.rodata`, so neither leaks. Move semantics, borrows, deterministic `Drop`, and the owning collections have landed, so a `Vec`, `HashMap`, `BTreeMap`, or `String` frees its buffer at scope exit. A heap `string` (the one `+` concatenation and interpolation produce) is freed too when the compiler can prove who owns it: a temporary the statement consumes, or a binding whose initializer allocated it. A loop that formats output therefore holds steady rather than growing.\n\nWhat still leaks is a heap `string` that escapes what the compiler can follow: one stored into a collection or a struct field, one returned from a function, and the prior value of a reassigned binding. The ownership test answers conservatively by design, since freeing a `.rodata` literal would be far worse than holding a buffer.\n\nThis block is removed once those results are tracked too. Until then, do not assume memory-safety semantics beyond what the table above claims.\n\nIf memory-safety semantics and compiler backend design are your thing, **[this is exactly where contributors are needed](/PanzerPeter/Neuro/blob/main/CONTRIBUTING.md)**.\n\n`neurc compile -O 3` hands the module to the same LLVM 20 optimization pipeline `clang -O2` uses, so compute-bound code lands in the same range as C++ rather than somewhere between C++ and Python.\n\nBest of nine runs on one machine, lower is better. Reproduce with `python benchmarks/run.py`, which builds all three implementations of each program and refuses to report timings if they disagree on output:\n\n| Benchmark | What it stresses | Neuro `-O 3` | `clang -O2` | Python 3.14 | \n|---|---|---|---|---|\n| `mandelbrot` | scalar `f64` in a tight loop | 166 ms | 166 ms | 5791 ms | \n| `vector_sum` | `Vec` push, indexed sweep | 25 ms | 26 ms | 10068 ms | \n| `call_overhead` | recursion, call and inline cost | 45 ms | 51 ms | 1389 ms | \n| `print_lines` | integer holes to standard output | 13 ms | 22 ms | 110 ms | \n| `format_floats` | `f64` holes at a fixed precision | 118 ms | 109 ms | 214 ms | \n| `int_divide` | guarded `/` and`%` , opaque divisor | 96 ms | 89 ms | 1318 ms | \n\nAbsolute times belong to the machine rather than to the language, and the Python column to whichever `python3` is on your PATH, which is why the version is named. Two rows are worth a word. `print_lines` beats C because an integer hole renders through a digit loop instead of `snprintf`; `int_divide` is the one place the compiler spends rather than saves, since `/` and `%` guard the operand pairs the hardware instruction leaves undefined and an opaque divisor keeps those guards in the loop.\n\nThe default is `-O 0`: checked arithmetic, no optimization pipeline. Pass `-O 3` before drawing any conclusion about speed.\n\n| Requirement | Version | Notes | \n|---|---|---|\n| **Rust** | 1.85+ | Install via [rustup](https://rustup.rs/) | \n| **LLVM 20** | 20.x with dev libs | Platform instructions below | \n| **C linker** | any | `gcc` /`clang` on Linux/macOS; MSVC on Windows | \n\nThis is the only step that differs between systems. Add the `export` to your shell\nprofile (`~/.bashrc`, `~/.zshrc`) so it survives a new terminal.\n\n**Arch Linux / CachyOS**\n\n```\nsudo pacman -S llvm20\nexport LLVM_SYS_201_PREFIX=/usr/lib/llvm20\n```\n\n**Ubuntu / Debian**\n\n```\nwget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- 20\n# or the full dev package set:\n# sudo apt-get install llvm-20 llvm-20-dev llvm-20-tools libpolly-20-dev\nexport LLVM_SYS_201_PREFIX=/usr/lib/llvm-20\n```\n\n**macOS (Homebrew)**\n\n```\nbrew install llvm@20\nexport LLVM_SYS_201_PREFIX=\"$(brew --prefix llvm@20)\"\n```\n\n**Windows 10 / 11 (x64)** needs a longer walkthrough; see below.\n\nWith LLVM in place and Rust installed from [rustup.rs](https://rustup.rs/):\n\n```\ngit clone https://github.com/PanzerPeter/Neuro.git\ncd Neuro\ncargo build --release\ncargo test --workspace\n\ncargo install --path compiler/neurc   # optional, puts neurc on your PATH\n```\n\nOn Windows the same four commands run unchanged in PowerShell, and\n`cargo install` places `neurc.exe` in `%USERPROFILE%\\.cargo\\bin`, which rustup\nhas already added to `PATH`.\n\nWindows needs the MSVC toolchain, not GNU, and LLVM does not come from a package manager. Four extra steps, after which Step 2 above runs unchanged.\n\n**Install Visual Studio Build Tools.** Download from\n[visualstudio.microsoft.com/downloads](https://visualstudio.microsoft.com/downloads/)\nunder *Tools for Visual Studio* → *Build Tools for Visual Studio 2022*, and select the\n**Desktop development with C++** workload. 2019 or later works.\n\n**Install Rust.** Run `rustup-init.exe` from [rustup.rs](https://rustup.rs/) and choose\n*1) Proceed with standard installation*, which selects the\n`stable-x86_64-pc-windows-msvc` toolchain. Open a new PowerShell window afterwards so\n`cargo` and `rustc` are on `PATH`.\n\n**Install LLVM 20** to a path without spaces (the NSIS installer enforces this):\n\n``` php\n$version = \"20.1.8\"\n$url = \"https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/LLVM-$version-win64.exe\"\ncurl.exe -fsSL -o \"$env:TEMP\\llvm-installer.exe\" $url\nStart-Process \"$env:TEMP\\llvm-installer.exe\" -ArgumentList \"/S /D=C:\\LLVM\" -Wait -PassThru | Out-Null\n```\n\nThe installer is also downloadable by hand from the\n[LLVM releases page](https://github.com/llvm/llvm-project/releases).\n\n**Point the build at it.** No admin rights needed:\n\n```\n[Environment]::SetEnvironmentVariable(\n    \"LLVM_SYS_201_PREFIX\", \"C:\\LLVM\",\n    [EnvironmentVariableTarget]::User\n)\n$current = [Environment]::GetEnvironmentVariable(\"Path\", \"User\")\n[Environment]::SetEnvironmentVariable(\"Path\", \"$current;C:\\LLVM\\bin\", \"User\")\n```\n\nClose and reopen PowerShell, then check with `llvm-config --version`, which should\nprint `20.x.y`.\n\n**Troubleshooting Windows build errors**\n\n*`llvm-sys` build script cannot find LLVM*: confirm `LLVM_SYS_201_PREFIX`\nis set in the **current** shell session (`echo $env:LLVM_SYS_201_PREFIX`)\nand points to a directory that contains `bin\\llvm-config.exe`.\n*`link.exe` not found*: the MSVC Build Tools are not on `PATH`. Run the\nbuild from a **Developer PowerShell** / **x64 Native Tools Command Prompt**\nor install the *C++ build tools* workload as described above.\n*Version mismatch (`llvm-sys-201` requires LLVM 20)*: an older LLVM is on\n`PATH`. Set `LLVM_SYS_201_PREFIX` explicitly to the LLVM 20 prefix and\nensure `C:\\LLVM\\bin` precedes any other LLVM entries in `PATH`.\n\n```\n# Type-check a source file (no binary produced)\ncargo run -p neurc -- check examples/basics/hello.nr\n\n# Compile to a native executable\ncargo run -p neurc -- compile examples/basics/factorial.nr\n\n# Run the compiled binary (emitted next to the source file)\n./examples/basics/factorial\n\n# After cargo install --path compiler/neurc:\nneurc compile examples/basics/factorial.nr\n// Immutable by default\nval x: i32 = 42\nval name: string = \"Neuro\"\n\n// Mutable with reassignment\nmut counter: i32 = 0\ncounter = counter + 1\n\n// Type inference works for both val and mut\nval pi = 3.14159   // inferred f64\nval n  = 100       // inferred i32\nmut count = 0      // inferred i32; type annotation optional\nphp\n// Explicit return\nfunc add(a: i32, b: i32) -> i32 {\n    return a + b\n}\n\n// Expression-based implicit return (trailing expression)\nfunc multiply(a: i32, b: i32) -> i32 {\n    a * b\n}\nphp\nfunc fizzbuzz(n: i32) -> i32 {\n    mut i: i32 = 1\n    while i <= n {\n        i = i + 1\n    }\n    i\n}\n\nfunc sum(n: i32) -> i32 {\n    mut total: i32 = 0\n    for i in 0..n {\n        total = total + i\n    }\n    total\n}\nphp\nstruct Point {\n    x: f64,\n    y: f64\n}\n\nfunc distance(p: Point) -> f64 {\n    // field read\n    val dx = p.x\n    val dy = p.y\n    dx * dx + dy * dy   // placeholder (no sqrt yet)\n}\n\nfunc main() -> i32 {\n    val origin = Point { x: 0.0, y: 0.0 }\n\n    // field mutation requires mut binding\n    mut cursor = Point { x: 3.0, y: 4.0 }\n    cursor.x = 1.0\n\n    return 0\n}\n```\n\nVerbatim from [examples/showcase/closures.nr](/PanzerPeter/Neuro/blob/main/examples/showcase/closures.nr). It compiles, links, prints the three results below, and exits with code 90.\n\n```\n// Apply `f` to each element of a 4-element array and sum the results.\nfunc map_sum(xs: [i32; 4], f: (i32) -> i32) -> i32 {\n    mut total: i32 = 0\n    mut i: i32 = 0\n    while i < 4 {\n        total += f(xs[i])\n        i += 1\n    }\n    return total\n}\n\nstruct Scaler {\n    factor: i32\n}\n\nimpl Scaler {\n    func apply(&self, x: i32) -> i32 {\n        x * self.factor\n    }\n}\n\nfunc main() -> i32 {\n    val data: [i32; 4] = [1, 2, 3, 4]\n\n    // A closure capturing a Copy local (`bias`) by value.\n    val bias = 10\n    val biased = map_sum(data, |x: i32| x + bias)   // 11+12+13+14 = 50\n\n    // A `move` closure with a block body and early return.\n    val scale = 3\n    val scaled = map_sum(data, move |x: i32| -> i32 {\n        val y = x * scale\n        return y\n    })                                              // 3+6+9+12 = 30\n\n    // A struct method still resolves alongside closures.\n    val s = Scaler { factor: 2 }\n    val doubled = s.apply(5)                         // 10\n\n    println(\"capture by value  |x| x + bias      = {biased}\")\n    println(\"move closure      move |x| x * scale = {scaled}\")\n    println(\"struct method     s.apply(5)         = {doubled}\")\n\n    val total = biased + scaled + doubled\n    println(\"total                                = {total}\")\n    total                                            // 50 + 30 + 10 = 90\n}\n```\n\nEvery runnable program in [examples/showcase/](/PanzerPeter/Neuro/blob/main/examples/showcase) combines several features at once and is pinned twice: to an expected exit code in [examples/expected.txt](/PanzerPeter/Neuro/blob/main/examples/expected.txt), and to the exact text it prints in a sibling `.out` file. By-value tensor arithmetic, `@grad`, and GPU kernels are not shown here because they do not exist yet; tensor *construction* does, in [`showcase/model_shapes.nr`](/PanzerPeter/Neuro/blob/main/examples/showcase/model_shapes.nr), and the in-place update in [`showcase/optimizer_step.nr`](/PanzerPeter/Neuro/blob/main/examples/showcase/optimizer_step.nr). See the [Quick Roadmap](#quick-roadmap).\n\nNeuro follows Vertical Slice Architecture (VSA): the code is organized by language feature, not by technical layer.\n\n```\ncompiler/\n├── infrastructure/          # Shared, zero-business-logic crates\n│   ├── ast-types/           #   AST node definitions\n│   ├── diagnostics/         #   Error / warning types + rendering\n│   ├── project-config/      #   Project / manifest configuration\n│   ├── shared-types/        #   Primitives shared across slices\n│   ├── source-location/     #   Spans, positions, source files\n│   └── neuro-hir/           #   Typed High-Level IR (frontend ↔ backend contract)\n├── lexical-analysis/        # Tokenizer (logos, Unicode XID)\n├── syntax-parsing/          # Pratt + statement parser → AST\n├── semantic-analysis/       # Type checker, scope analysis\n├── control-flow/            # CFG data structures; no caller yet\n├── hir-lowering/            # Type-checked AST → typed HIR\n├── llvm-backend/            # HIR → object code (inkwell 0.10 / LLVM 20)\n├── mlir-backend/            # HIR → MLIR scaffold (off-by-default `mlir` feature)\n└── neurc/                   # CLI compiler driver (pipeline orchestration)\n```\n\n**Today:**\n\n```\nSource (.nr)\n  → Lexical Analysis   (tokens)\n  → Syntax Parsing     (AST)\n  → Semantic Analysis  (type-checked AST)\n  → HIR Lowering       (typed High-Level IR, neuro-hir)\n  → LLVM Backend       (object code via inkwell / LLVM 20)\n  → System Linker      (native executable)\n```\n\n**Planned extension (Phase 2+):**\n\n```\nTensor/AI path: typed High-Level IR (neuro-hir)\n  → MLIR (linalg/tensor/func/arith, LLVM 20 / MLIR 20)\n  → Enzyme MLIR AD pass (@grad)\n  → GPU dialects (nvgpu/rocdl/Triton) or llvm dialect\n  → inkwell → native code\n```\n\nEach numbered phase is a MAJOR-version milestone: completing **Phase N** ships **v(N+1).0.0**. Phase 1 is complete and we are now in **Phase 2**. A phase is divided into lettered sub-phases.\n\n| Phase | Goal | Status | \n|---|---|---|\n| **1** | **Core Language** : types, control flow, LLVM backend, ownership and borrow checking, generics, traits and dispatch, closures, enums and pattern matching, error handling, modules and prelude, string interpolation | Complete | \n| **2** | **Tensors and MLIR** : first-class tensor types lowered through MLIR Linalg, plus the pool allocator. Finishing it ships**v3.0.0** | In progress | \n| 2A | Standard I/O and spec stragglers: `print` /`println` ,`.is_nan()` , codepoint string APIs,`.enumerate()` , borrowed slices`&[T]` , the iterator protocol,`@derive(Debug, PartialEq)` | Complete | \n| 2B | Tensor core: `Tensor<T, [...]>` , literal coercion, move semantics, DLPack, slicing, shape generics, named dims, dynamic shapes, reductions | In progress | \n| 2C | MLIR lowering: tensor arithmetic to Linalg, broadcasting, matmul behind `@` , end-to-end HIR → MLIR → LLVM | Planned | \n| 2D | Pool allocator: `pool` blocks,`PoolAware` , LIFO release at scope exit | Planned | \n| 2E | Functional sugar: pipeline `\\|>` , composition`>>` , einstein notation, functional tensor ops | Planned | \n| **3** | Automatic differentiation: Enzyme MLIR pass, `@grad(wrt: ...)` ,`.backward()` /`.zero_grad()` , higher-order derivatives, SGD | Planned | \n| **4** | GPU acceleration: MLIR GPU dialects (nvgpu / rocdl / Triton), `@gpu` ,`KernelOut<T>` aliasing model, device memory pool, CPU fallback | Planned | \n| **5** | Neural network standard library: `TrainableTensor` ,`ParameterList` , optimizers,`@model` , Dense / Conv2d / Attention,`.nrm` serialization | Planned | \n| **6** | Async runtime: `async func` ,`Future<T>` ,`spawn` ,`JoinHandle` ,`join` /`race` , executor for data-loader / I/O overlap | Planned | \n| **7** | Interop and advanced features: Python FFI via DLPack, spread operator, advanced pattern matching, custom attributes, `defer` | Planned | \n| **8** | Developer experience: Language Server Protocol, diagnostics polish, formatter, `@test` runner | Planned | \n| **9** | Package manager and distribution: `neurpm` , cross-OS installer / uninstaller / self-updater, signed release binaries, optimization passes (loop unrolling, AD-aware inlining, LTO) | Planned | \n\nSet `LLVM_SYS_201_PREFIX` for your platform before running any Cargo command\n(see [Installation](#installation) for the correct path per OS).\n\n```\n# Build the full workspace\ncargo build --workspace\n\n# Run all tests\ncargo test --workspace\n\n# Lint\ncargo clippy --workspace --all-targets -- -D warnings\n\n# Format check\ncargo fmt --all -- --check\n\n# Apply formatting\ncargo fmt --all\n```\n\nOn Windows, use PowerShell or a Developer Command Prompt. The env var must be set in the current session; prefix it inline if needed:\n\n```\n$env:LLVM_SYS_201_PREFIX = \"C:\\LLVM\"\ncargo build --workspace\n```\n\nSyntax highlighting for `.nr` files is included in `neuro-language-support/`.\n\n```\ncd neuro-language-support\nnpm install -g @vscode/vsce      # once\nvsce package                     # -> neuro-language-support-<version>.vsix\ncode --install-extension neuro-language-support-*.vsix --force\n```\n\nReload the VS Code window afterwards (`Developer: Reload Window`). A grammar change\ndoes not apply to already-open editors. During grammar work, symlinking the folder into\n`~/.vscode/extensions/` avoids repackaging: a window reload then picks up every edit.\n\n| Extension | Purpose | \n|---|---|\n| `.nr` | Neuro source files | \n| `.nrl` | Compiled library modules | \n| `.nrm` | Serialized model/matrix data | \n| `.nrp` | Package definitions | \n\nSee [CONTRIBUTING.md](/PanzerPeter/Neuro/blob/main/CONTRIBUTING.md) for architecture guidelines, coding standards, and the pull request process. Confirmed open defects live in [docs/BUGS.md](/PanzerPeter/Neuro/blob/main/docs/BUGS.md). Fixing one is the best way to start.\n\nThe project is in early alpha, so breaking changes are expected. Contributions should focus on **Phase 2 (Tensors and MLIR)**; the [Quick Roadmap](#quick-roadmap) marks which phase is currently open.\n\nAI development is stuck in a fragmented paradigm: developers iterate in an interpreted glue language (Python), while underlying libraries are written in unmanaged, safety-critical systems languages (C++/CUDA).\n\nNeuro is built to unify this stack:\n\n1. **True native performance.** Compiled AOT via LLVM 20, with no heavy runtime interpreter and no global interpreter lock (GIL).[Measured against C++ and Python](#performance) on compute-bound programs.\n2. **AI-First Type System:** Native compile-time shape verification for tensors using MLIR (Phase 2), preventing runtime dimension mismatches before a single line of training executes.\n3. **Immutability by Default:** A modern`val` /`mut` paradigm to ensure highly parallelized tensor computations are thread-safe by design.\n\nLicensed under the [Neuro Shared Source License v2.1](/PanzerPeter/Neuro/blob/main/LICENSE).\n\n**Why not MIT/Apache 2.0 right now?** Neuro is in a critical pre-stabilization phase. The license protects against three specific risks: commercial re-packaging of the compiler before the language spec is stable, AI-assisted reproduction of the compiler for a competing product, and misleading forks that fragment the early ecosystem. None of these restrictions affect normal use.\n\n**What you can do freely:**\n\n- Use, study, and modify the compiler for any personal or internal purpose\n- Write Neuro programs and distribute or sell the compiled output under **any** terms you choose. programs you compile are wholly exempt from this license\n- Build tools, plugins, and editor integrations that call into the compiler\n- Contribute code back to the project\n\n**What requires a commercial license:**\n\n- Redistributing the Neuro compiler itself (or a fork of it) as part of a commercial product\n\nSee [LICENSE](/PanzerPeter/Neuro/blob/main/LICENSE) for full terms.\n\nInspired by Rust (ownership, type system), Python (AI ecosystem simplicity), Swift (language ergonomics), and Mojo (AI-first design). Built with [inkwell](https://github.com/TheDan64/inkwell), [logos](https://github.com/maciejhirsz/logos), and the [LLVM](https://llvm.org/) infrastructure.", "url": "https://wpnews.pro/news/neuro-a-compiled-language-for-ai-that-matches-clang-o2", "canonical_source": "https://github.com/PanzerPeter/Neuro", "published_at": "2026-09-07 13:05:06+00:00", "updated_at": "2026-09-07 13:28:11.667610+00:00", "lang": "en", "topics": ["artificial-intelligence", "developer-tools", "ai-infrastructure"], "entities": ["Neuro", "LLVM 20", "MLIR", "Enzyme", "Triton"], "alternates": {"html": "https://wpnews.pro/news/neuro-a-compiled-language-for-ai-that-matches-clang-o2", "markdown": "https://wpnews.pro/news/neuro-a-compiled-language-for-ai-that-matches-clang-o2.md", "text": "https://wpnews.pro/news/neuro-a-compiled-language-for-ai-that-matches-clang-o2.txt", "jsonld": "https://wpnews.pro/news/neuro-a-compiled-language-for-ai-that-matches-clang-o2.jsonld"}}