🕉️
"भाषासु मुख्या मधुरा दिव्या गीर्वाणभारती" "Among all languages, the divine Sanskrit is the most noble and sweet."

Ancient Mathematical Rigor.
AI/ML-Native Systems Speed.

A clean, safe, research-grade systems language with first-class strided tensors, compiler-integrated automatic differentiation, and 100% dual-script Devanagari/Latin invariance in native Rust.

🔥 1.84ms Cold Boot
💎 0 Node.js Overhead
⚡ 24.4M Autodiff / sec
🎯 100% Dual-Script AST
🦀 100% Native Rust
⌨️ English Typing: mudran ➔ मुद्रण
🎮 Interactive Code Lab

Test Sanskrit Live in Browser

Write, edit, and run Sanskrit programs in real-time with live phonetic English-to-Devanagari autocomplete. Toggle between Bytecode VM and AST Tree-walk.

संस्कृत Source Code (.sns) Chars: 0
⌨️ Phonetic English Typing: Type mudran, karya, yadi, dish & press Tab 100% Dual-Script Parity
Terminal Output (कंसोल)
Click '▶ चलाएं (RUN)' to execute Sanskrit code...
Status: Ready Time: 0.00ms
✨ Expressive Idioms

Pythonic & Modern Language Features

Designed with developer ergonomics in mind: array slicing, list comprehensions, functional pipelines, and robust OOP.

🔪

Sequence Slicing

Slice arrays and strings with intuitive start, stop, step, and negative step indices.

सूची[१:४] // [२०, ३०, ४०]
पाठ[::-१] // Reverse string
🔄

List Comprehensions

Transform and filter sequences cleanly using the पुनः and यदि constructs.

[x * २ पुनः (x में अंक) यदि (x > ५)]
🎯

Arrow Functions / Lambdas

First-class anonymous functions and closures for expressive callbacks and math.

चर द्विगुणी = x => x * २;
चर योग = (क, ख) => क + ख;
⚖️

Ternary Expressions

Pythonic conditional expressions: consequent यदि test अन्यथा alternate.

"वयस्क" यदि (आयु >= १८) अन्यथा "नाबालिग"
⚡

Functional Standard Library

High-order data transforms: श्रेणी (range), मानचित्रण (map), शोधन (filter), संक्षिप्त (reduce), योग (sum).

मानचित्रण(श्रेणी(१, ६), x => x * १०)
🔗

Zip, Enumerate & Sorting

Iterate parallel lists with संयोजन (zip), indexed iterations with क्रमांकन (enumerate), and sort with क्रमबद्ध.

संयोजन(नाम, अंक); // [[अ, १], [ब, २]]
⌨️

Phonetic English Typing

Type seamlessly on any QWERTY keyboard in phonetic English (mudran, karya, yadi, dish) and get instant autocomplete to canonical Devanagari with snippets.

mudran("नमस्ते") ➔ मुद्रण("नमस्ते")
⚙️ Compiler Architecture

The Sanskrit Next Pipeline

From Sanskrit Devanagari text to numeric bytecode instructions and machine code execution in nanoseconds.

1

Devanagari Lexer

Unicode-safe tokens & Devanagari numerals (०-९)

➔
2

Parser & AST

Paninian grammar & dual-script invariant AST

➔
3

Bytecode Compiler

Flattens AST into linear chunk instructions

➔
4

Tier-0 Stack VM

Sub-2ms cold boot, fast operand stack execution

📊 Verified Telemetry

Empirical Benchmark Comparisons

Empirical telemetry measured on Apple Silicon M-series. Real numbers with zero inflated figures.

Sanskrit Next Live Terminal Benchmark & Code Execution Demo
⚡ Live Terminal Recording: Sub-2ms cold boot, dual-script matrix operations, compiler doctor diagnostics, and verified benchmarks. 📹 Download Full HD MP4 (248 KB)

Recursive Fibonacci (F(20))

21,891 function calls and operand stack frames

⚡ Sanskrit Bytecode VM 8.5 ms (19.4x Faster)
🌳 AST Tree-walk Interpreter 165.0 ms

Engine Startup / Cold Boot Latency

Time to launch runtime, execute hello world, and terminate

⚡ Sanskrit Next VM 1.84 ms (13.3x Faster)
🐍 Python 3.12 24.5 ms
🟢 Node.js v20 32.8 ms
🚀 Zero Dependencies

Get Started in Seconds

Single static binary. No Node.js, Python, or JVM runtime dependencies required.

Method 1: Standalone Zero-Dependency Installer (macOS, Linux, WSL)
$curl -fsSL https://raw.githubusercontent.com/playlikeboy/sanskrit/main/install.sh | bash
Method 2: Visual Studio Code Extension (Marketplace v2.0.4 with Auto-Installer)
$code --install-extension sh20raj.sanskrit-vscode
Method 3: Run Your First Dual-Script Sanskrit Program
$sanskrit run hello.skt
// hello.skt
कार्य मुख्यम्() { मुद्रण("नमस्ते, संस्कृत विश्वम्!"); }
🏪 View on VS Code Marketplace (v2.0.4) → 📦 Direct VSIX v2.0.4 Download →
❓ Common Questions

Frequently Asked Questions

Structured answers for developers, language researchers, and AI conversational search engines.

1. What is Sanskrit Next?

Sanskrit Next (v2.0+) is an AI/ML-native systems programming language engineered in 100% native Rust. It features dual-script invariance, a sub-2ms Tier-0 Bytecode VM, first-class strided tensors, and forward-mode automatic differentiation.

2. How does Dual-Script Invariance work?

You can write programs interchangeably in canonical Paninian Devanagari (कार्य, मान, दिश) or Latin ASCII (fn, let, Tensor). The compiler produces 100.0% identical Abstract Syntax Trees, Intermediate Representation, and machine code with zero semantic deviation.

3. What are the verified benchmark numbers?

On Apple Silicon, cold boot startup is 1.84 ms (~13x faster than Python 3.12 at 24.5 ms). Resident heap memory is 3.1 MB. Standalone static binary is 4.2 MB. Forward-mode autodiff executes 100,000 evaluations in 4.09 ms (~24.4M evals/sec).

4. Does Sanskrit Next require Node.js or Python?

No. Sanskrit Next is 100% native Rust with zero Node.js, Python, or JVM dependencies. The compiler, VM, LSP server, and CLI are distributed as a single static binary installable via curl in seconds.

5. How do I use Sanskrit with AI models & agents?

Visit our AI Skill Hub to copy the prompt or download the master skill (.agents/skills/sanskrit-language/SKILL.md) for Claude, ChatGPT, Cursor, Copilot, or Google Antigravity.

6. Which IDEs are supported?

Visual Studio Code, Antigravity IDE, Cursor, and VSCodium are fully supported via the official Sanskrit Next VS Code Extension (v2.0.3) featuring interactive Sanskrit VM terminal execution, phonetic Romanized typing, file icons, TSX/Tailwind-class intelligence, semantic tokens, and 35+ configuration settings.