███╗ ██╗███████╗██╗ ██╗██╗ ██╗ █████╗ ████╗ ██║██╔════╝██║ ██║██║ ██║██╔══██╗ ██╔██╗ ██║█████╗ ██║ ██║██║ ██║███████║ ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██╔══██║ ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝
A programming language built purely for Machine Learning.
Simple like Python. Clear like Rust. Made for ML.
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("examples/data/iris.csv")
let train_data, test_data = data.split(0.8)
model DigitNet {
layer dense(4 -> 16, relu)
layer dense(16 -> 3, softmax)
}
train DigitNet on train_data for 20 epochs, lr = 0.001, loss = crossentropy
print "Accuracy:", accuracy(DigitNet, test_data)
That is it. No import torch. No nn.Module. No training loop. Neuva handles it all.
What's New in v1.0.0
Neuva started as a single .lark grammar file and a stub interpreter. Over 34 days of public development — one commit per day — it grew into a complete ML language with a real PyTorch backend.
The journey in short:
- Days 5–9: grammar, parser, and first AST tests
- Days 10–11: working interpreter; Neuva ran its first program
- Days 12–17: real PyTorch backend; neural networks actually trained
- Days 20–21: real CSV data loading, train/test splits, 93% accuracy on Iris
- Days 22–25: VS Code extension, documentation, Rust-style error messages
- Days 27–30:
else ifchains, string concatenation,--versionflag - Days 31–33: interactive REPL, GPU detection, mini-batch training
- Day 34: f-strings, lists,
and/or, dropout layers, model summary printing - v1.0.0: 54 tests, 13 runnable examples, stable release
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 keywords —
model,layer,train,predict,saveare built into the language - No boilerplate — no imports, no class definitions, no training loops
- PyTorch backend — compiles to PyTorch under the hood, fast and compatible
- GPU support — automatically detects and uses CUDA if available
- Mini-batch training — shuffled batches each epoch, averaged loss reporting
- F-string interpolation —
print "Accuracy: {acc}%"substitutes variables inline - List support —
let scores = [85, 90, 78],scores[0],len(scores) - Boolean logic —
and/orwith short-circuit evaluation - Dropout layers —
layer dropout(0.3)maps directly tonn.Dropout - Model summary —
print MyModelshows layers and total parameter count - Interactive REPL —
neuva shellfor live exploration with persistent state - Rust-style errors — line numbers, column pointers, did-you-mean suggestions
- Simple types —
tensor,matrix,int,float,bool,string - Open source — AGPL v3 licensed, built in public, contributions welcome
Install
pip install neuva-lang
Run a .nva file:
neuva my_model.nva
Start the interactive shell:
neuva shell
Check the version:
neuva --version
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)
F-String Interpolation
let acc = 93
print "Accuracy: {acc}%" # prints: Accuracy: 93%
let model_name = "DigitNet"
print "Training {model_name}..."
Lists
let scores = [85, 90, 78, 92]
print scores[0] # 85
let n = len(scores) # 4
Boolean Logic
if score > 50 and score < 100 {
print "valid score"
}
if passed or bonus {
print "you qualify"
}
Models
model MyNet {
layer dense(784 -> 128, relu)
layer dropout(0.3)
layer dense(128 -> 10, softmax)
}
print MyNet # prints layer summary and parameter count
Supported layer types: dense, conv, pool, dropout, flatten
Supported activations: relu, sigmoid, softmax, tanh, linear
Loading Data
let data = load("examples/data/iris.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, binary_crossentropy
Predict and Evaluate
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 if acc > 0.80 {
print "Good model."
} else {
print "Keep training."
}
for i in range(10) {
print "Epoch {i}"
}
let count = 0
while count < 5 {
let count = count + 1
}
Interactive REPL
$ neuva shell
Neuva 1.0.0 — interactive shell. Type 'exit' to quit.
>>> let x = 42
>>> print "The answer is {x}"
The answer is 42
>>> exit
Examples
| File | Description |
|---|---|
examples/hello.nva |
Hello world |
examples/digit_classifier.nva |
Iris classification, 93% accuracy |
examples/linear_regression.nva |
House price regression |
examples/spam_classifier.nva |
Binary spam detection |
examples/house_price.nva |
Multi-layer regression |
examples/cnn_classifier.nva |
CNN layer definitions |
examples/control_flow_demo.nva |
if, for, while, functions |
examples/elif_demo.nva |
Chained else if |
examples/fstring_demo.nva |
F-string interpolation |
examples/list_demo.nva |
Lists and indexing |
examples/logical_demo.nva |
and / or operators |
examples/dropout_demo.nva |
Dropout layer and model summary |
examples/string_concat_demo.nva |
String concatenation |
Project Status
| Phase | Status | Description |
|---|---|---|
| 1 — Design | ✅ Done | Language syntax and keywords |
| 2 — GitHub Setup | ✅ Done | Repo, license, structure |
| 3 — Lexer | ✅ Done | Tokenizer with full terminal set |
| 4 — Parser | ✅ Done | Lark Earley parser, full AST |
| 5 — Interpreter | ✅ Done | Tree-walking interpreter, 54 tests |
| 6 — PyTorch backend | ✅ Done | Mini-batch training, GPU support |
| 7 — PyPI release | ✅ Done | pip install neuva-lang |
Documentation
| Document | Description |
|---|---|
| Getting Started | Install, hello world, running .nva files, the REPL, the web playground |
| Language Reference | Every keyword with syntax and examples |
| Architecture | How source turns into a running program, and the scoping model |
| Contributing Guide | How to add a keyword, layer type, builtin, or test |
| Examples | Line-by-line walkthrough of the iris classifier |
| FAQ | Production readiness, licensing, GPU support, and more |
| Changelog | Full version history |
| Roadmap | What's planned post-1.0 |
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: github.com/Ankit-Mahadani/neuva/issues
Built With
- Python 3.10+ — the interpreter is written in Python
- PyTorch ≥ 2.0 — ML execution backend
- Lark ≥ 1.1 — grammar and parser
- NumPy + Pandas — data loading and preprocessing
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
See the full LICENSE file for details.
Copyright © 2026 Ankit Mahadani and Neuva Contributors
Built in public. Day by day. v1.0.0.
Star the repo to follow the journey.
Metadata
Release files for neuva-lang 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| neuva_lang-1.2.0.tar.gz | 97.3 kB | Without provenance | Details for neuva_lang-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| neuva_lang-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for neuva_lang-1.2.0-py3-none-any.whl |
Total release size: 168.1 kB
Release files / neuva_lang-1.2.0.tar.gz
| Download URL | neuva_lang-1.2.0.tar.gz |
|---|---|
| Size | 97.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3fbc3439ab6d3edfe2888dd1d6665b58d7f7819c24b23e6e84008a70963b4bd2
|
|
BLAKE2b-256 checksum How to use checksums |
709848565f474487d9c5ffbc59872aa4b1b177e9048d0534614a077856cda753
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Release files / neuva_lang-1.2.0-py3-none-any.whl
| Download URL | neuva_lang-1.2.0-py3-none-any.whl |
|---|---|
| Size | 70.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c51d019bce2960fb9155a82fde59f53fd3bb8d283c27ca59fa029dab39c606e6
|
|
BLAKE2b-256 checksum How to use checksums |
149e4784f9c837f74e271bee703476e02d812f82cdd37c34e3476534f4f68a92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Security for neuva-lang 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.