Skip to content
项目

关于

অসমীয়া — a programming language in Assamese, with a TypeScript interpreter

学习与教育

这些数字如何统计

可以做什么

  • Assamese everywhere. Keywords, built-ins, error messages, and numbers (১০ + ২০ prints ৩০).
  • Or type in English letters. dhora, kowa, jodi, nohole … with several common spellings for each word, because romanised Assamese has no single standard spelling.
  • Helpful errors. Every error has a code, a message in Assamese or English, and points at the exact spot. Typos get a hint: kowaa → did you mean kowa (কোৱা)?
  • A real language. Variables, conditions, loops, functions, recursion, closures, lists and input. A real lexer, parser and interpreter, written in TypeScript.

实测星标增长

24小时
0
7天
+1
15天
正在收集历史
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

অসমীয়া · Asomiya

A programming language in Assamese.
Write real programs in অসমীয়া script, or in English letters the way you type Assamese in chats.

npm version npm downloads CI node license Open VSX DOI Asomiya MCP on mcprush Buy Me a Coffee

Website & Playground · Documentation · Examples · Report a bug · অসমীয়াত পঢ়ক

Assamese script

ধৰা ভাষা = "অসমীয়া"
ধৰা বয়স = ২০

কোৱা("নমস্কাৰ, পৃথিৱী!")
কোৱা("এই প্ৰগ্ৰামটোৰ ভাষা: " + ভাষা)

যদি (বয়স >= ১৮) {
    কোৱা("প্ৰাপ্তবয়স্ক")
} নহ'লে {
    কোৱা("অপ্ৰাপ্তবয়স্ক")
}

English letters

dhora bhaxa = "Oxomiya"
dhora boyox = 20

kowa("Nomoskar, prithibi!")
kowa("ei programor bhaxa: " + bhaxa)

jodi (boyox >= 18) {
    kowa("praptoboyosko")
} nohole {
    kowa("oprapto-boyosko")
}

Both are the same program. Output:

নমস্কাৰ, পৃথিৱী!
এই প্ৰগ্ৰামটোৰ ভাষা: অসমীয়া
প্ৰাপ্তবয়স্ক

You can run it without installing anything in the playground:

The Asomiya playground with the program above and its output

Try it now

No install needed: open the playground at asomiya.codes and press ▶.

Node.js 20+ is only needed to use the CLI or library locally.

Or install the command-line tool:

npm install -g asomiya
asomiya            # start the interactive REPL

Features

  • Assamese everywhere. Keywords, built-ins, error messages, and numbers (১০ + ২০ prints ৩০).
  • Or type in English letters. dhora, kowa, jodi, nohole … with several common spellings for each word, because romanised Assamese has no single standard spelling.
  • Helpful errors. Every error has a code, a message in Assamese or English, and points at the exact spot. Typos get a hint: kowaa → did you mean kowa (কোৱা)?
  • A real language. Variables, conditions, loops, functions, recursion, closures, lists and input. A real lexer, parser and interpreter, written in TypeScript.
  • Runs anywhere. A CLI and REPL for Node.js 20+, a browser playground, and a library API.
  • Safe to run other people's code. Programs can't touch files or the network, and loops, recursion and memory are limited. See SECURITY.md.
  • Well tested. Over 400 tests, run on Linux, macOS and Windows.

Installation

Requires Node.js 20 or newer.

npm install -g asomiya

This installs the asomiya command. To use Asomiya as a library in a project instead:

npm install asomiya

asomiya: command not found? You probably ran npm install asomiya without -g. Use npm install -g asomiya, or run it once with npx asomiya.

Quick start

Save this as hello.asom:

কোৱা("নমস্কাৰ, অসম!")

Run it:

asomiya run hello.asom

Start the REPL and type code line by line:

asomiya

Source files use the .asom extension.

The language in five minutes

Concept Assamese script English letters
variable ধৰা ক = ৫ dhora k = 5
print কোৱা("মান:", ক) kowa("man:", k)
if / else যদি (ক > ১) { … } নহ'লে { … } jodi (k > 1) { … } nohole { … }
while loop যেতিয়ালৈকে (ক < ১০) { … } jetialoike (k < 10) { … }
for-each loop প্ৰতিটো ফল ফলবোৰ মাজত { … } protito fol folbor majot { … }
break ৰখা rokha
continue আগবাঢ়া aagbara
function ফাংচন যোগ(ক, খ) { ঘূৰাইদিয়া ক + খ } fangchon jog(k, kh) { ghuraidiya k + kh }
true/false/null সঁচা মিছা খালী xosa misa khali
and / or / not আৰু / বা / নহয় (or !) aru / ba / nohoy
list ধৰা ল = [১, ২, ৩], ল[০] dhora l = [1, 2, 3], l[0]
comment // line and /* block */ same
  • Numbers can be written with Assamese (২৪) or ASCII (24) digits. Programs in Assamese script print ২৪; programs in English letters print 24.
  • Text uses double quotes. + joins text with any value. Length and indexing count whole characters, so দৈৰ্ঘ্য("নাম") is ২.
  • Conditions must be true or false (সঁচা/মিছা). There is no "truthiness".
  • Statements end at a newline, ;, or the danda ।.

Built-in functions

Assamese English letters What it does
দৈৰ্ঘ্য(x) doirghyo(x) length of text or a list
প্ৰকাৰ(x) prokar(x) the type of a value, as text
সংখ্যা(x) xonkhya(x) text → number (খালী if it isn't a number)
পাঠ(x) path(x) any value → text
পূৰ্ণাংক(x) purnanko(x) drop the decimal part
সংযোজন(l, x) xonjojon(l, x) add x to the end of list l
সোধা(q) xudha(q) ask a question and read one line of input

English letters: how spelling works

Everyone types Assamese differently, so Asomiya accepts several spellings for each word: kowa, kuwa, kua and koa all mean কোৱা; xosa, hosa and sosa all mean সঁচা. Roman keywords are lower-case only, so Jodi or Misha can still be names. The full list is in the Roman spelling guide.

Examples

A leap-year checker, in English letters:

fangchon adhibarxa(boxor) {
    jodi (boxor % 400 == 0) { ghuraidiya xosa }
    nohole jodi (boxor % 100 == 0) { ghuraidiya misa }
    ghuraidiya boxor % 4 == 0
}

dhora boxor = xonkhya(xudha("Boxor likhok: "))
jodi (adhibarxa(boxor)) { kowa(boxor, "adhibarxa") } nohole { kowa(boxor, "adhibarxa nohoy") }

More in the examples/ folder (also built into the playground):

File Shows
hello.asom variables, joining text, if/else
variables.asom types, reassignment, scope, separators
arithmetic.asom precedence, decimals, conversions
conditionals.asom else-if chains, logic words, nesting
loops.asom while, for-each, break, nested loops
functions.asom functions, recursion, higher-order, closures
lists.asom lists, Assamese-aware text indexing
greet.asom reading input with সোধা
roman.asom the same language in English letters

Command-line usage

asomiya run <file> [options]      run a program
asomiya python <file> [options]   print the same program in Python
asomiya [repl] [options]          start the REPL (default)
asomiya --version | --help

Options:
  -l, --lang <as|en>   language for error messages (default: as)
  --ascii-digits       always print numbers with 0-9
  --assamese-digits    always print numbers with ০-৯
  --max-steps <n>      execution step budget, 0 = unlimited (default: 10000000)
  --max-depth <n>      maximum function call depth (default: 500)

Exit codes: 0 success, 1 the program had an error, 2 usage error or unreadable file.

Errors show a code, a message, the location and the line:

চলোৱাৰ সময়ৰ ভুল [R001]: "খ" নামৰ কোনো চলক ঘোষণা কৰা হোৱা নাই (প্ৰথমে "ধৰা খ = …" লিখক)
  --> program.asom:2:10
  |
2 | কোৱা(ক + খ)
  |        ^

REPL

A complete statement runs when you press Enter. An open { or ( waits for more lines, and সোধা reads the next line you type.

Command Effect
.সহায় / .help show help
.বাতিল / .cancel discard an unfinished multi-line input
.প্ৰস্থান / .exit, Ctrl+D quit
Ctrl+C quit immediately, even mid-program

The REPL has no arrow-key history on purpose: line editors redraw the line with column arithmetic that doesn't match how terminals draw Assamese, which garbled the screen.

Playground

asomiya.codes runs the real interpreter in your browser. Nothing is sent to a server. It has the examples built in, an input box for সোধা, Assamese or English errors, a digit-style switch, and share links that carry your program in the URL.

The Python button shows your program in Python, side by side, updating as you type. It is a real translation, not an approximation: the Python program prints exactly what the Asomiya program prints, byte for byte, and stops with an error where Asomiya would. Where Python behaves differently (Python prints 3.0 where Asomiya prints ৩, -7 % 3 is 2 in Python but -১ in Asomiya, Python counts ক্ষ as three characters …) the code calls a small helper function, so learners see plain Python everywhere else. asomiya python file.asom does the same in the terminal. The test suite checks this by running thousands of programs in both languages and comparing the output.

VS Code extension

Asomiya for VS Code (also Cursor, Windsurf and VSCodium): syntax colours in both scripts, errors as you type, hover help, a ▶ Run button whose output (with proper Assamese text) appears in an Asomiya panel, and a live Show in Python view.

Asomiya in VS Code

More on the extension page; the source is in editors/vscode.

Use with AI

asomiya-mcp is an MCP server that lets Claude, ChatGPT, VS Code Copilot, Cursor and other AI apps write, check, run and explain Asomiya, with a playground right in the chat. Add it to your AI app:

claude mcp add asomiya -- npx -y asomiya-mcp

Other apps, and the one-click Claude Desktop extension: asomiya.codes/ai.

Use as a library

import { runSource } from 'asomiya';

const { output, error } = runSource('কোৱা(১০ + ২০)');
console.log(output); // ৩০

runSource('kowa(10 + 20)').output; // "30\n"

import { parse, toPython } from 'asomiya';

toPython(parse('কোৱা(১০ + ২০)')); // a Python program that prints ৩০

See Architecture → Embedding.

Documentation

Guide What's in it
Language specification types, operators, scoping, semantics
Grammar EBNF, precedence table, lexical rules
Keyword glossary what every word means and why it was chosen
Roman spelling guide writing Asomiya in English letters
Error reference every error code, in Assamese and English
Architecture how the interpreter is built
Changelog what changed in each version

Why Asomiya?

Programming languages almost always borrow English for their keywords. Asomiya shows that nothing about lexing, parsing or running code depends on that. Variables can be called বয়স, loops can be written with যেতিয়ালৈকে, and ১০ + ২০ prints ৩০. It's made for teaching programming to Assamese speakers in their own language, and for showing how a programming language works inside.

It's a small, educational language: readable and well tested, not fast or feature-complete.

Contributing

Contributions are welcome, especially from native Assamese speakers: if a keyword, spelling or error message sounds unnatural, please open an issue. Several keywords are still marked provisional in the glossary. See CONTRIBUTING.md.

Running tests

git clone https://github.com/d43ash1sh/asomiya.git
cd asomiya
npm install
npm test            # unit + integration tests
npm run check       # typecheck, lint, format and tests

Security

To report a security problem, please use GitHub's private vulnerability reporting instead of a public issue. See SECURITY.md.

People

Created by Debashish Bordoloi (@d43ash1sh, ORCID 0009-0006-0473-0774). Everyone who has helped, including people who reviewed words or wrote lessons (emoji key):

Debashish Bordoloi
Debashish Bordoloi

💻 📖 🎨 🤔 🚧 🚇
Arnab Sharmah
Arnab Sharmah

📖
Siddhartha Borah
Siddhartha Borah

💻 🐛 ⚠️ 📖
Bigratom Saikia
Bigratom Saikia

📖
Nitish
Nitish

💻 ⚠️

To add someone, comment on any issue or pull request: @all-contributors please add @username for code, doc

See all contributors on GitHub.

Support

Asomiya is free and always will be. If it helps you or your students, you can buy the maintainer a coffee ☕. It pays for the domain and hosting, and for time spent on lessons and tools for learners.

Acknowledgements

The idea of a playful language with native-language keywords was inspired by BhaiLang. Asomiya has its own grammar, semantics and implementation.

License

MIT © Debashish Bordoloi and contributors

探索相关项目

加载中…