KanlaLang

GuruLang

A fun programming language forked from Gurulang :)

Which is similar to Hassan, Mandya accent

Playground

Run aythu kanla 🎉

Documentation

Kanla lang is a fun programming language, forked from Gurulang. Which is similar to Hassan, Mandya accent

General
enla is the entrypoint for the program and all program must end with aythu kanla. Anything outside of it will be ignored.
This will be ignored
enla
// Write code here
aythu kanla
This too
Variables
Variables can be declared using nod la.
enla
nod la a = 10;
nod la b = "two";
nod la c = 15;
a = a + 1;
b = 21;
c *= 2;
aythu kanla
Types
Numbers and strings are like other languages. Null values can be denoted using kaali. nija and sullu are the boolean values.
enla
nod la a = 10;
nod la b = 10 + (15*20);
nod la c = "two";
nod la d = 'ok';
nod la e = kaali;
nod la f = nija;
nod la g = sullu;
aythu kanla
Built-ins
Use hel la to print anything to console.
enla
hel la "Hello World";
nod la a = 10;
{
nod la b = 20;
hel la a + b;
}
hel la 5, 'ok', kaali , nija , sullu;
aythu kanla
Conditionals
Kanlalang supports simple if else construct , nodla eega block will execute if condition is nija and illandre nodla block will execute if condition is sullu.
enla
nod la a = 10;
nodla eega (a < 25) aadre{
hel la "a is less than 25";
} illandre nodla {
hel la "a is greater than or equal to 25";
}
aythu kanla
Loops
Statements inside madla ellivargu blocks are executed as long as a specified condition evaluates to nija. If the condition becomes sullu, statement within the loop stops executing and control passes to the statement following the loop. Use saak bidla to break the loop and mundhe madla to continue within loop.
enla
nod la a = 0;
madla ellivargu (a < 10) {
a += 1;
nodla eega (a == 5) aadre{
hel la "olgade aithe kanla ", a;
mundhe nodla;
}
nodla eega (a == 6) aadre{
saak bidla;
}
hel la a;
}
hel la "done";
aythu kanla