asomiya 0.2.0

Control flow

Writing in English letters

Every keyword and built-in function also has spellings in English letters, the way people type Assamese in chats. You don’t need an Assamese keyboard.

dhora naam = "Rita"
jodi (naam != "") {
    kowa("Nomoskar, " + naam)
} nohole {
    kowa("naam nai")
}
Output
Nomoskar, Rita

There is no single “correct” spelling

Assamese has no standard way of writing it in English letters. কোৱা can be kowa, kuwa, kua or koa. Many speakers write স as x (as in Oxom for অসম). So Asomiya accepts several common spellings for every word. The first one in each list is the preferred spelling.

AssameseEnglish lettersMeaning
ধৰাdhora, dharalet (variable)
কোৱাkowa, kuwa, kua, koaprint
যদিjodi, zodi, jadiif
নহ'লেnohole, noh'le, nohle, nhole …else
যেতিয়ালৈকেjetialoike, zetialoike, jetiyaloike …while
ৰখাrokha, rakhabreak
আগবাঢ়াaagbara, agbara …continue
ফাংচনfangchon, phangchon, fanchonfunction
ঘূৰাইদিয়াghuraidiya, ghuraidiareturn
সঁচা / মিছাxosa, hosa, sosa … / misa, micha …true / false
খালীkhali, khaalinull
আৰু / বাaru / baand / or

The complete list, including built-in functions, is in the keyword reference.

Three rules

  1. Lower-case only. jodi means যদি, but Jodi is an ordinary name you can use for a variable.
  2. Mix freely. Assamese script and English letters work in the same program.
  3. Keywords are reserved. You can’t name a variable ba or misa, because those are keywords.
mixed.asom
ধৰা ফল = xosa aru !misa
kowa(ফল)
Output
xosa

Typos get a hint

If a word is close to a keyword but not quite right, the error suggests what you meant:

dhora x = 5
jodii (x > 1) {
    kowa("dangor")
}
Output
syntax error [P007]: Expected a line break or ";" after the statement, but found "{" — did you mean jodi (যদি)?
  --> program.asom:2:15
  |
2 | jodii (x > 1) {
  |               ^

Output in English letters

A program whose keywords are in English letters also prints in English letters: numbers as 123 and true/false/null as xosa, misa, khali. Programs in Assamese script print ১২৩, সঁচা, মিছা, খালী.

কোৱা(১০ + ২০, সঁচা, খালী)
Output
৩০ সঁচা খালী
kowa(10 + 20, xosa, khali)
Output
30 xosa khali