The Blyx Book
The Blyx Programming Language
A complete guide to Blyx — from your first program to writing GPU kernels, actor systems, and high-performance AI workloads. Written by Rahul Chaube.
01Getting Started
Install Blyx, write your first program, understand project structure.
A Guessing Game
Build a complete program — user input, random numbers, loops, error handling.
Common Concepts
Variables, mutability, data types, functions, comments, control flow.
Functions & Closures
Function syntax, parameters, return types, closures and higher-order functions.
Ownership & Memory
Blyx's memory model — ownership rules, references, borrowing, slices.
Structs & Enums
Custom data types with structs, methods via impl, enums and Option.
Pattern Matching
match expressions, if let, while let, destructuring all Blyx types.
Traits & Generics
Polymorphism in Blyx — define traits, implement them, use generic bounds.
Error Handling
Result<T,E>, the ? operator, custom error types, when to panic.
Collections & Iterators
Arrays, vectors, hashmaps, iterator chains, map/filter/fold.
Actors & Concurrency
The Blyx actor model, spawn, send, join, work-stealing thread pools.
Tensors & AI
Native tensor<T,D1,D2> types, static dimension checking, neural networks.
GPU & Heterogeneous Compute
gpu {} blocks, SPIR-V and NVPTX targets, GPU memory management.
Async & Await
Futures in Blyx, async functions, await, async actors, async I/O.
Modules & Packages
The mod system, use paths, Blyx.toml manifest, blyxpkg, publishing.
Testing
Unit tests, integration tests, benchmark tests, test output.
Compiler Architecture
How blyxc works — lexer, parser, BIR, optimization passes, codegen.
Advanced Features
Unsafe Blyx, FFI, macros, custom allocators, compiler intrinsics.