The Vyne language
A C-flavored scientific numerical language with deterministic region memory, native C output, an AST interpreter for fast iteration, a CUDA device backend, and a native ESP32 and Arduino Uno firmware path. No garbage collector. No hidden allocation pauses. Numerical computing, live charts, and managed desktop graphics in one language.
What Vyne is
Vyne is a statically analyzable numerical programming language built
around one idea:
memory lifetime belongs in the source code, not in a garbage collector.
Values live in a bump arena. A region
block confines scratch allocations to a lexical scope, and the arena
rewinds at the closing brace. That contract is identical on a desktop
and on a 2 KB microcontroller.
The surface syntax is deliberately C-shaped: braces, semicolons,
fn declarations, if /
while / through
control flow, and :: type annotations. On top
of that it adds first-class functions, generics by monomorphization,
interfaces, pipeline and null-coalescing operators, string
interpolation, := declarations, bitwise
operators, Float32, executable contracts, and
source-to-source reverse-mode automatic differentiation.
Three execution models, one AST
vynec --ast script.vy runs directly for fast
iteration and REPL use. The AST interpreter is the reference
semantics for the language.
vynec --compile lowers the same AST to
one self-contained C translation unit and hands it to the host C
compiler for native binaries.
vynec build uses selected ESP32 or
Uno hardware. The arena is 64 KB on ESP32 and 1 KB on AVR;
checkpoint and rewind semantics remain explicit.
Why Vyne
What is new in this generation
-
The region policy suite
—
@bounded,@zeroed,@deterministic,@realtime,@pool,@slab,@ring,@streamed,@persistent,@speculative,@device,@layout<soa>, and the AD composition attributes, withregion.commit,region.move, anddrop. -
Source-to-source AD
—
@differentiable,@backward,grad, array-reduction VJPs, and custom<fn>_vjpadjoints. -
A CUDA device backend
—
@device<cuda>, Float32 by default, forward/backward kernels, reusable vnn training blocks, and a CPU fallback. - An Arduino Uno target — a 1 KB arena, 16 checkpoints, 110 bindings, and the same region semantics as desktop.
- ESP32 and select-once hardware — saved presets, short build/run commands, Wi-Fi, NVS, display, sprites, touch, sensors, and the measured HW-950 configuration.
-
Zero-copy slices
— borrowed
Slice<T>views and typed-array reserve/resize for reusable numerical buffers. - Universal live plotting — colorful image and ESP32 charts with bounded series and automatic live updates.
- Managed graphics and audio — raylib 6.2, App-owned resources and frames, cameras, shaders, render targets, music, and one-shot sound.
- A full numerical library stack — linear algebra, ML, FFT, statistics, optimization, sparse and dense solvers, DSP, control, CSV/JSON, plotting, imaging, buses, and domain libraries.
- A real project — the SRCNN image upscaler with dataset generation, training, CUDA inference, and PSNR/SSIM benchmarks.
- ESPCN device training — explicit forward/backward/AdamW, checkpoint reload, and reproducible bundled metrics. Explore the graphics showcases for real rendering examples.
Start here
If you want to run code immediately, read Installation and Hello, World. If you want the whole language in one pass, take the Language Tour. If you want to understand the memory model first, jump to Memory & Regions. The SRCNN showcase shows a complete project end to end: dataset generation, training, CUDA inference, and image-quality benchmarking.
CHANGELOG.md.