Skip to main content

Neuva — A working ML programming language with lexer, parser, AST and interpreter

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.2.0.tar.gz (55.3 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.2.0-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: neuva_lang-0.2.0.tar.gz
  • Upload date:
  • Size: 55.3 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.2.0.tar.gz
Algorithm Hash digest
SHA256 78e51c13d7df4240af89c0649bede27c687a6474df197e2a740200d1e09c3d5e
MD5 37ff25bef089862307286f3e18c490b2
BLAKE2b-256 1d13f11cd3ae2e03fa8cf746a144dc3a783f07edf7906b032f29d729c9f0e484

See more details on using hashes here.

File details

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

File metadata

  • Download URL: neuva_lang-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 41.5 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 229d1f24ae295c52d5c9d415df82f24346e08368b20f03c7e5ad72c9203b480d
MD5 164b1d23d970ee43c5f001ed3460512f
BLAKE2b-256 eba5588a320437ff4abdd8c7d9db138eda5c9a27ac520165d55c929f7cbff71f

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