Explore practical code samples across AI, GPU kernels, actor concurrency, CLI binaries, and high-performance networking.
Compile-time dimension checked matrix multiplication pass.
import std.tensor;
fn forward(w: tensor<f32, 128, 64>, x: tensor<f32, 64, 32>) -> tensor<f32, 128, 32> {
return matmul(w, x);
}Direct PTX lower GPU kernel.
gpu {
let tid = thread_id();
data[tid] = data[tid] * 2.5;
}142M msg/sec concurrency runtime.
actor PingPong {
fn receive(msg: Message) {
match msg { Ping => send(Pong) }
}
}Zero dependency CLI utility.
import std.cli;
fn main() {
let args = cli::parse();
println("Command: {}", args.command);
}High throughput web service.
import std.net.http;
fn main() {
let server = http::Server::bind("127.0.0.1:8080");
server.listen(|req| -> Response { Response::ok("Blyx Server") });
}