VVIRALANGUAGE GUIDE / 2024GITHUB
BACK TO VIRA
THE OFFICIAL FIELD GUIDE

Build close
to the metal.

Everything in the Vira language, collected from the README and the runnable tutorials. Learn the syntax, then ship systems, AI, web services, and desktop apps.

39 tutorials 43 runnable examples Vira 0.7.2
01 / LANGUAGE FEATURES

The whole
toolbox.

Vira combines C and Rust-level control with Go-like simplicity, instant compilation, and a focused standard library.

01

Deterministic autofree memory

Static escape analysis injects LIFO destructors at scope exits. No tracing garbage collector or stop-the-world pauses.

02

4-quadrant mutability

Immutable by default, with precise default, mut:, pub:, and pub mut: field visibility and mutation controls.

03

Mandatory Result handling

The !T result type makes failures explicit. Unwrap with or { ... } or propagate with ! before code can run.

04

AI tensors and SIMD

First-class 1D–4D tensor primitives, @ matrix multiplication, AVX2/FMA, SSE2, and ARM NEON acceleration.

05

Native SafeTensors and GGUF

Load Hugging Face weights and local LLM models in pure Vira with Q4_0/Q8_0 dequantization and token sampling.

06

Supervised actor concurrency

Isolated actors communicate with <- and run across a Chase-Lev work-stealing pool with OneForOne restarts.

07

C99 compiler backend

Lower readable Vira directly to portable C99 for GCC, Clang, MinGW-w64, or TCC.

08

Native C and Python FFI

Use extern C, raw pointers, unsafe boundaries, and shared-library exports for zero-overhead interop.

09

HTTP and pure-Vira JSON

Build asynchronous HTTP/1.1 services with a pure RFC 8259 JSON parser and O(N) JsonBuilder.

10

Desktop GUI toolkit

Create Win32/X11 native windows with immediate-mode widgets, declarative layouts, navigation, and dashboards.

11

Package management

Scaffold projects, add dependencies, lock versions, vendor for air-gapped builds, and keep projects reproducible.

12

Rust/V-style diagnostics

Friendly compiler errors with source spans, notes, suggestions, and precise type-checking feedback.

02 / TUTORIAL INDEX

Start anywhere.
Go deep.

Step-by-step guides paired with runnable .vir examples. Open the source on GitHub and learn by doing.

OPEN ALL TUTORIALS
01Syntax & basicsImmutability, mut, primitives, interpolation, if/else, and the blank identifier.Beginner02OOP & encapsulationStruct access levels, embedding, promoted fields, and receivers.Intermediate03Structural interfacesImplicit interfaces, boxing, vtables, and destructor chaining.Intermediate04Result error handling!T results, or blocks, fallbacks, and compile-time safety.Intermediate05Autofree & arenasScope-exit cleanup, escape analysis, and O(1) arena teardown.Advanced06SIMD AI tensorstensor[f32], @ multiplication, AVX2/NEON, and forward passes.Intermediate07Actors & supervisorsActors, <- dispatch, futures, panic containment, and restarts.Advanced08Production pipelineA complete system combining interfaces, actors, errors, and memory safety.Advanced09Native file I/OAtomic writes, appending, reads, deletion, and Result handling.Advanced10Multicore concurrencyWork-stealing, isolation, fault boundaries, and arena wipes.Advanced11Control flow & loopsUnified for loops, branching, operators, break, and continue.Beginner12Deep dive AI tensorsAligned tensors, vectorization, and zero-allocation inference.Advanced13Hardware accelerationCUDA/ROCm, Metal DMA, PCIe alignment, and GPU fault recovery.Advanced14Neural networksMLP inference, SIMD execution, GPU actors, and CPU fallback.Advanced15Pretrained weightsZero-copy binary weights and asynchronous model serving.Advanced16Compilation & deploymentAOT builds, production flags, static linking, and containers.Beginner / Advanced17HTTP & fast JSONJSON field parsing, HTTP responses, actors, and leak-free services.Advanced18Autograd & SafeTensorsNative weights, SIMD backpropagation, and in-place SGD.Advanced19Local LLM engineGGUF parsing, quantization, RoPE, RMSNorm, SwiGLU, and sampling.Expert20Tooling, LSP & packagesvira init, manifests, fmt, test, and the language server.Beginner / Advanced