Skip to main content

Neuva — A programming language built for Machine Learning

Project description


 ███╗   ██╗███████╗██╗   ██╗██╗   ██╗ █████╗
 ████╗  ██║██╔════╝██║   ██║██║   ██║██╔══██╗
 ██╔██╗ ██║█████╗  ██║   ██║██║   ██║███████║
 ██║╚██╗██║██╔══╝  ██║   ██║╚██╗ ██╔╝██╔══██║
 ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║  ██║
 ╚═╝  ╚═══╝╚══════╝ ╚═════╝   ╚═══╝  ╚═╝  ╚═╝

A programming language built purely for Machine Learning.

Simple like Python. Clear like Rust. Made for ML.


License: AGPL v3 Python 3.10+ PyTorch Backend Status: Building PRs Welcome



What is Neuva?

Neuva (NOO-vah) is an open source programming language designed from the ground up for Machine Learning. No boilerplate. No imports. No configuration. Just describe your model and train it.

# Train a digit classifier — the entire program
let data = load("mnist.csv")
let train_data, test_data = data.split(0.8)

model DigitNet {
    layer dense(784 -> 128, relu)
    layer dense(128 -> 10,  softmax)
}

train DigitNet on train_data for 20 epochs, lr=0.001
print accuracy(DigitNet, test_data)

That is it. No import torch. No nn.Module. No training loop. Neuva handles it all.


Why Neuva?

Most ML code looks like this:

import torch
import torch.nn as nn
import torch.optim as optim

class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.fc1 = nn.Linear(784, 128)
        self.fc2 = nn.Linear(128, 10)

    def forward(self, x):
        x = torch.relu(self.fc1(x))
        return torch.softmax(self.fc2(x), dim=1)

model = Net()
optimizer = optim.Adam(model.parameters(), lr=0.001)
criterion = nn.CrossEntropyLoss()

for epoch in range(20):
    for batch_x, batch_y in train_loader:
        optimizer.zero_grad()
        output = model(batch_x)
        loss = criterion(output, batch_y)
        loss.backward()
        optimizer.step()

Neuva code looks like this:

model DigitNet {
    layer dense(784 -> 128, relu)
    layer dense(128 -> 10,  softmax)
}

train DigitNet on train_data for 20 epochs, lr=0.001

Same result. A fraction of the code.


Features

  • ML-first keywordsmodel, layer, train, predict, save are built into the language
  • No boilerplate — no imports, no class definitions, no training loops
  • PyTorch backend — compiles to PyTorch under the hood, so it is fast and compatible
  • Rust-style errors — clear error messages with line numbers and helpful hints
  • Simple typestensor, matrix, int, float, bool, string
  • Beginner friendly — if you know any programming language, you can write Neuva
  • Open source — AGPL v3 licensed, built in public, contributions welcome

Language Overview

Variables

let name   = "Neuva"        # string  (inferred)
let layers = 3              # int     (inferred)
let rate: float = 0.001     # float   (explicit)
let ready: bool = true      # bool    (explicit)

Models

model MyNet {
    layer dense(784 -> 128, relu)      # input 784, output 128, relu activation
    layer dense(128 -> 64,  relu)
    layer dense(64  -> 10,  softmax)   # output layer
}

Supported layer types: dense, conv, pool, dropout, flatten, norm

Supported activations: relu, sigmoid, softmax, tanh, linear, gelu

Loading Data

let data = load("dataset.csv")

let train_data, test_data = data.split(0.8)   # 80/20 split
data = data.normalize()                        # normalize values
data = data.shuffle()                          # shuffle rows

Training

# one-liner
train MyNet on train_data for 10 epochs, lr=0.001

# multi-line (more readable)
train MyNet
    on    train_data
    for   50 epochs
    lr    = 0.0005
    loss  = crossentropy

Supported loss functions: crossentropy, mse, mae, huber, binary_crossentropy

Predict and Evaluate

let result = predict MyNet on test_data
let acc    = accuracy(MyNet, test_data)
print "Accuracy:", acc

Save and Load

save MyNet to "my_model.nva"
let loaded = load("my_model.nva")

Functions

fn welcome(name: string) {
    print "Hello from Neuva,", name
}

fn square(x: float) -> float {
    return x * x
}

Control Flow

if acc > 0.95 {
    print "Excellent model!"
} else {
    print "Keep training."
}

for i in 0..10 {
    print i
}

Examples

File Description
examples/hello.nva Hello world
examples/iris_classifier.nva Iris flower classification
examples/digit_classifier.nva MNIST digit recognition
examples/regression.nva House price regression
examples/full_pipeline.nva End-to-end ML pipeline

Install

Neuva is currently in early development. The interpreter is being built in public.

Once released:

pip install neuva-lang

Run a .nva file:

neuva run my_model.nva

Project Status

Neuva is being built live, day by day, in public.

Phase Status Description
1 — Design ✅ Done Language syntax and keywords
2 — GitHub Setup ✅ Done Repo, license, structure
3 — Lexer 🔨 In progress Tokenizer
4 — Parser ⏳ Upcoming AST builder
5 — Interpreter ⏳ Upcoming Tree walker
6 — PyTorch backend ⏳ Upcoming ML execution
7 — PyPI release ⏳ Upcoming pip install neuva-lang

Follow the journey on LinkedIn — posting every milestone.


Contributing

Neuva is open source and we welcome all contributors — beginners and experts alike.

git clone https://github.com/Ankit-Mahadani/neuva.git
cd neuva
pip install -e ".[dev]"
pytest tests/

See CONTRIBUTING.md for the full guide.

Look for issues labelled good first issue to get started quickly: github.com/Ankit-Mahadani/neuva/issues


Built With

  • Python 3.10+ — the interpreter is written in Python
  • PyTorch — ML execution backend
  • NumPy + Pandas — data handling

Roadmap

  • Lexer + Parser (current focus)
  • Working interpreter for basic programs
  • PyTorch backend for model training
  • pip install neuva-lang on PyPI
  • VS Code syntax highlighting extension
  • GPU support
  • CNN and RNN layer types
  • Interactive REPL (neuva shell)
  • Web playground

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).

This means:

  • You can use, study, modify, and distribute Neuva freely
  • If you use Neuva in a product or service (including over a network), you must release your source code under the same license
  • Any modifications must also be open source

This keeps Neuva and everything built on top of it free and open — forever.

See the full LICENSE file for details, or read a plain-English summary at tldrlegal.com/license/gnu-affero-general-public-license-v3.

Copyright © 2026 Ankit Mahadani and Neuva Contributors


Built in public. Day by day.

Star the repo to follow the journey.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neuva_lang-0.0.1.tar.gz (46.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neuva_lang-0.0.1-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

Details for the file neuva_lang-0.0.1.tar.gz.

File metadata

  • Download URL: neuva_lang-0.0.1.tar.gz
  • Upload date:
  • Size: 46.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for neuva_lang-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8693be353d3dc0803bbb75371791fa43e0c110d6c2a981d4ec95ebb35dd31ce2
MD5 69c7645e55934234bfee50840f0b02d7
BLAKE2b-256 61a6d7be90e933d0b68c7893fe2a8c19ad84a29992c2f9ecac15f189ad5e0489

See more details on using hashes here.

File details

Details for the file neuva_lang-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: neuva_lang-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 32.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for neuva_lang-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5dfdc3927cf359919434899df97799bf35d14e10ba71b20cfe806039293d46cf
MD5 299aeae63a78e683fe8cc257040dd87a
BLAKE2b-256 96c77f9e719e9cb5cd6e7af0ed3571b6b53c163bd7e34fa462cc3671cd93dffe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page