Write Raya. Run it here.
65 lessons, from hello world to exact maths, Riptide's maths libraries (arrays, calculus, FFT, statistics, number theory, topology, knots, orbits and more) and the CPU's matrix unit. Most run live in your browser: Raya compiled to WebAssembly, with real 64-bit integers. A few need the native Raya VM, and for those you see exactly what they printed.
Hello, Raya
Runs in your browserraya run main.ray on your machine, or press Reset to run the lesson.
A familiar language, then further.
Raya is a typed language with classes, records, patterns and null safety, plus additions for code that has to be fast and right. These are the parts worth knowing, each with a lesson above.
Sound null safety
A type without ? can never hold null, and the compiler proves it. Flow analysis promotes a value once you check it.
Sealed classes and patterns
Exhaustive switch expressions over sealed types, destructuring of lists, maps, records and objects, and guards.
Records and generics
Return several values without a class; generics keep their types at run time.
Try it →Data classes
One line gives ==, hashCode, toString, copyWith and JSON, with no code generator and no build step.
Value classes
@pragma('raya:value'): small immutable types with no identity, kept in registers by the compiler. Vectors, money, colours cost nothing in a hot loop.
Exact maths
64-bit integers that never round, BigInt at any size, and geometry tests rewritten so they only add and multiply.
Isolates and shared memory
Real threads with Isolate.run, and, on every Raya build, one shared field for the whole process with a real Mutex.
SIMD and the matrix unit
Float32x4 becomes one NEON instruction on arm64, plain loops are vectorised, and the VM drives the CPU matrix unit for exact int8 and int16 matrix multiply.
Native executables, LLVM inside
raya compile exe builds ahead of time on every core, and hands numeric loops to LLVM when that makes them faster.
Code push for iOS
Ship a fix to an iOS app built with Raya without a new App Store build: verified bytecode patches, no new machine code.
Read how →A whole maths stack
Riptide's own libraries in Raya: NumPy-style arrays and linear algebra, FFT and signal, sparse, spatial, special functions, statistics, arbitrary precision, computer algebra, topology and more.
See every library →Thousands of packages
raya add collection: packages from the registry convert to Raya as they download, so the ecosystem works on day one.
The raya command
raya run main.rayRun a program on the VM, with hot reload while you develop.raya compile exe main.rayA native executable, compiled ahead of time on every core.raya compile wasm main.rayWebAssembly for the browser: how the lessons on this page run.raya compile shared lib.rayA C shared library (.dylib / .so) other languages can call.raya add collectionAdd a package (raya get, raya pkg; raya pub still works).raya test · raya analyze · raya formatTests, the analyzer and the formatter.Browser lessons were compiled with raya compile wasm and their output checked against raya run on the VM line for line before they were published. Recorded lessons show what raya run (or a raya compile exe build) printed on an M1 Pro MacBook Pro. WebAssembly GC needs a current browser: Chrome or Edge 119+, Firefox 120+, Safari 18.2+.
Two more playgrounds.
Evelyn
Apps written in Raya, running live: state, layout, animation, gestures, painting, data classes and theming.
Open the Evelyn playground →Riptorch notebooks
import riptorch as torch: autograd, training, exact integer maths and four matmul precisions in a notebook.
Raya, in full
The language, the benchmarks against C and C++, and what we have built with it.
About Raya →