Everything is rewriting.
Functions, conditionals, and familiar operators share one computational model. Outermost reduction makes conditionals lazy; call-by-need shares repeated work.
fn square(?x) -> ?x * ?x;SANSKRIT-FIRST. OPEN SOURCE.
A programming language inspired by Pāṇini.
Write simple rules. Let computation unfold.
Sanskrit or Latin. The same expressive core.
सूत्र वर्ग(?x) -> ?x * ?x।02 — apply & compose[1, 2, 3, 4, 5]
|> प्रति(वर्ग) |> समष्टि01 / THE LANGUAGE
In Sūtra, programs are sets of rewrite rules. An expression runs by transforming, step by step, until no rule applies.
Functions, conditionals, and familiar operators share one computational model. Outermost reduction makes conditionals lazy; call-by-need shares repeated work.
fn square(?x) -> ?x * ?x;Start with a general rule, then add a specific exception. Sūtra resolves competing matches through paratva, inspired by Pāṇini’s grammar.
fn kind(?x) -> Other;
fn kind(a) -> Vowel;Rewrite sequences with sound classes, context, anchors, and segment captures. The standard library includes the fourteen śivasūtras and derived sound classes.
[?i:इक्, ?a:अच्]
-> [यणादेश(?i), ?a]।TWO SCRIPTS. ONE LANGUAGE.
Devanagari names are canonical. Latin aliases let you explore the same language from any keyboard.
प्रयोग [1, 2, 3] |> प्रति((?x) => ?x * ?x) |> समष्टि।eval [1, 2, 3] |> map((?x) => ?x * ?x) |> sum;Both evaluate to 14.
02 / PLAYGROUND
Edit an example. Run it. See the normal form.
The real Rust interpreter, running in your browser.
Run the example to see the result.
Square each number, then reduce the list to a sum. Pipes compose ordinary functions.
Pure evaluation · No installation needed
The playground evaluates expressions and eval / प्रयोग statements. Files, imports, and interactive I/O are available in the CLI.
03 / AN OPEN EXPERIMENT
Sūtra is a founder-led research project exploring the benefits of Sanskrit’s rich grammar as a programming model. Pāṇini’s Aṣṭādhyāyī inspires its rule-based design; the goal is a practical, general-purpose language.
Our starting point is an open-source interpreter: a concrete way to test ideas about rewriting, linguistic structure, and computation.
Follow the roadmapArbitrary-precision integers, lists, maps, records, higher-order functions, guards, pure effect-as-data I/O, modules, a static checker, and a formatter.
A language server, richer REPL editing and completion, and optional static type checking beyond the current checker.
An experimental language in active development.
Explore it, question it, help shape it.
04 / MAKE SOMETHING
Clone the repository and run Sūtra locally.
You’ll need the Rust toolchain.
# Get the language git clone https://github.com/sk-chandra/sanskrit-lang.git cd sanskrit-lang cargo build --release # Evaluate your first expression cargo run -q -- eval "sum([1, 2, 3])" --ascii → 6