⚠ Experimental: NNLang is still in an experimental phase and is not ready for production use. Use at your sole discretion.
NEURAL COMPILER

Neural Networks, Stripped to the Binary

A declarative language that compiles ML models to standalone, zero-dependency native binaries.

Input — model.nnl
model my_model {
  layer input = Input(shape: [4]);
  layer fc1   = Dense(units: 3);
  layer out   = Dense(units: 2);
}
nnc compile
Output
$ cat input.bin | ./my_model > output.bin
$ python3 -c "import numpy as np; print(np.fromfile('output.bin', np.float32))"
[0.87 0.13]

$ file my_model
my_model: ELF 64-bit, statically linked

Key Features

No Runtime Dependencies

Compiled models are self-contained static binaries.

No Heap Allocation

All memory is statically allocated at compile time.

Human-Readable Source

Model architectures defined in plain-text .nnl files.

Systems-First

Targets bare-metal-capable output.

From Training to Deployment

NNLang fits into your existing ML workflow — train anywhere, deploy a single binary.

1

Train

Train your model with any framework — PyTorch, TensorFlow, JAX, etc.

2

Export

Export weights as ONNX or NumPy (.npy) files.

3

Describe

Write a .nnl model definition — or import directly from ONNX.

4

Compile & Deploy

Build a single static binary. No runtime, no dependencies.

One Binary. Zero Baggage.

Traditional ML Deployment

  • Python runtime
  • PyTorch / TensorFlow
  • CUDA / cuDNN
  • NumPy, SciPy, …
  • Model server (Flask, FastAPI)
  • Docker container
vs

NNLang Deployment

  • Single static binary

Installation

cargo install nnlang

Requires Rust toolchain and a C compiler (gcc, clang, or cc).

Or download pre-built binaries from GitHub Releases.

Quick Start

  1. Write a model
    version 0.2; model my_model { config { weights: "./weights"; io: "stdio"; } layer input = Input(shape: [4]); layer fc1 = Dense(units: 3, activation: "relu"); layer fc2 = Dense(units: 2); }
  2. Compile
    nnc compile model.nnl --emit exe -o model
  3. Run
    cat input.bin | ./model > output.bin

Weight files go in weights/ directory. See docs for details.

Examples

Complete models with pre-generated weights in the examples/ folder.

  • Simple MLP — Minimal feedforward network
  • MNIST CNN — Convolutional neural network for digit classification
  • ResNet Block — Residual block with skip connections
  • ONNX Import — Convert ONNX models to NNLang