--
Neural Symbolic Language

A programming language where code thinks

NSL combines Python-like simplicity with cognitive primitives, GPU-native tensor ops, a bytecode VM with JIT, and 40 stdlib modules. Beliefs, observations, causal reasoning, and knowledge graphs -- as first-class language features. 1,983 tests passing.

example.nsl
// Beliefs are first-class values belief weather_is_sunny = 0.8 belief will_rain_today = 0.2 // Observe evidence, update beliefs observe "dark clouds forming" revise will_rain_today to 0.7 // Causal reasoning causes will_rain_today increases need_umbrella // GPU-native tensor computation let weights = tensor.create([128, 64], "random") let result = tensor.matmul(input, weights) print("Belief updated: rain = {will_rain_today}")
1,983
Tests passing
8,797
GFLOPS TF32
40
Stdlib modules
177
Keywords
14K
GFLOPS FP16
158
VM opcodes

Why NSL?

Performance

GPU-native tensor operations hitting 8,797 GFLOPS on TF32 and 14,015 GFLOPS on FP16. Hand-tuned PTX kernels for NVIDIA GPUs. AVX-512 CPU SGEMM at 1,648 GFLOPS. Register-based bytecode VM with threaded dispatch, NaN boxing, and x64 JIT compilation.

Intelligence

Beliefs, observations, and causal reasoning as native language constructs. A built-in prediction engine with Bayesian confidence updates. Knowledge graphs with 15 node types and 17 edge types, monitors, goals, hypotheticals, and a 74-function memory module -- not libraries, language features.

Simplicity

Python-like syntax with 177 keywords that reads like pseudocode. No semicolons, no type annotations required, indent-based blocks. Pattern matching, entities, contracts, concurrency, and a CPython bridge. If you can read Python, you can read NSL.

What you get

40 Stdlib modules
tensor, grad, optim, tokenizer, train, memory, py, http, crypto, json, nsd, ncf, and 28 more
GPU + CPU compute
CUDA TF32/FP16 PTX kernels, AVX-512 CPU SGEMM, batched matmul, game compute kernels
Autograd + training
Tape-based reverse-mode AD, Adam/SGD optimizers, BPE tokenizer, data loaders, LR schedulers
Cognitive primitives
belief, observe, revise, crystallize, capability, monitor -- with confidence tracking and knowledge graphs
Bytecode VM + JIT
158-opcode register VM with threaded dispatch, NaN boxing, and x64 JIT compilation
NSD + NCF formats
Human-readable NSD (3-8x fewer tokens than JSON) and binary NCF with LZ77+Huffman compression
CPython bridge
Call any Python library from NSL via py.eval, py.import, py.call -- types auto-convert
WASM Playground
Run NSL in your browser with no install, or chat with Qel'zyn VI AI assistant

Cognitive reasoning in action

diagnosis.nsl
// Medical symptom reasoning belief has_flu = 0.1 confidence 0.5 belief has_cold = 0.3 confidence 0.6 observe "high fever" observe {source: "thermometer", temp: 39} as reading causes has_flu increases high_fever revise has_flu to 0.75 confidence 0.9 evidence "fever + aches" // Monitor with safety tier monitor temp_check safety has_flu where confidence > 0.3 let chain = kg.path(kg.find("has_flu").id, kg.find("high_fever").id) print("Causal chain: {chain}")

Start thinking in code

NSL is free and runs in your browser. No account needed, no install required. Write your first belief in 30 seconds.