Source in, bytecode out.

Rain compiles .rn files to bytecode in one pass and runs them on a C stack VM: closures, classes, mark-and-sweep GC. Modules load with benutzen and ::; HTTP, SQLite, JSON, CSV, and BLAS-backed matrices all live on the same runtime.

curl … | sh · rain script.rn · REPL with no args

predict.rn
benutzen "csv";
benutzen "math";

var data = csv::read("mnist_test.csv");
var X = math::mscale(
  math::transpose(math::fromArray(csv::sliceCols(data, 1, 785))),
  1.0 / 255.0
);

var W1 = math::loadMatrix("weights/w1.bin");
var b1 = math::loadMatrix("weights/b1.bin");
var A1 = math::relu(math::madd(math::matmul(W1, X), b1));