Command-Line Interface
NSL is a single executable with multiple modes:
nsl program.nsl # run a program
nsl --compile program.nsl # compile to bytecode (.nslc)
nsl --vm program.nslc # execute bytecode
nsl --repl # interactive REPL
nsl --mcp # start MCP server (for AI tools)
Built-in Test Framework
No test library needed. Test blocks are part of the language:
test "math operations"
expect 1 + 1 == 2
expect 2 * 3 == 6, "multiplication"
expect abs(-5) == 5
test "string operations"
let s = "hello"
expect len(s) == 5
expect upper(s) == "HELLO"
expect contains(s, "ell")
Tests run automatically with summary output:
PASSED: math operations (3/3)
PASSED: string operations (3/3)
-- 2 tests, 6 assertions, 0 failures --
NSL itself is tested with 1,983 tests across 14 test files.
MCP Server
NSL includes a Model Context Protocol (MCP) server that exposes NSL's capabilities to AI tools like Claude Code:
mcp__nsl__file-- Read, write, edit, glob, diff, search filesmcp__nsl__find-- Grep, symbols, semantic search, fuzzy findmcp__nsl__do-- Run shell commands, evaluate NSL codemcp__nsl__gpu-- Create tensors, matmul, activations, kernel launchmcp__nsl__ai-- Embeddings, similarity, tokenizemcp__nsl__net-- HTTP requests, web search, content extractionmcp__nsl__browser-- Browser automation, screenshots, DevToolsmcp__nsl__data-- Parse/query JSON, CSV, YAML, XMLmcp__nsl__transform-- Batch find-and-replace across filesmcp__nsl__system-- System info, env vars, pathsmcp__nsl__benchmark-- Performance measurementmcp__nsl__memory-- CPU/GPU memory management- Full interpreter with all 177 keywords
- All built-in functions
- Cognitive primitives and knowledge graph
- Pattern matching and concurrency
- Selected stdlib modules
Each tool supports parallel operations and auto-corrects typos in op names.
WASM Playground
NSL compiles to WebAssembly for browser execution. The playground on neuralsymboliclanguage.com lets you write and run NSL programs with zero installation.
The WASM build includes:
File Formats
| Extension | Format | Purpose |
|-----------|--------|--------|
| .nsl | Source code | NSL programs |
| .nslc | Bytecode | Compiled VM programs |
| .nsd | NSD text | Human-friendly structured data |
| .nsdb | NSD binary | Machine-friendly structured data |
| .ncf | NCF binary | Compressed serialization with signing |
| .npme | NPME binary | Prediction engine state |
40 Stdlib Modules
All built in, no package manager:
math string file dir path json xml yaml csv http crypto regex time db sys os net html color uuid base64 url shell log async buffer event signal test debug tensor grad optim tokenizer train prediction py memory nsd ncf