Sunbird is dynamically-typed, interpreted programming language that focuses on ease of use and simplicity.
For detailed language reference, standard library docs, and guides, see the docs/ directory.
import "io"
io.println("Hello world")// Use the := operator to declare a variable
a := 1
name := ""
// to define constants use the :: operator
x :: 20
pi :: 3.141
// Defining functions
add :: fn(a, b) {
return a + b
}
add(a, b)import "io"
a := 1
b := 2
if a > b {
io.println("a is greater than b")
} else if a < b {
io.println("a is less than b")
} else {
io.println("a is equal to b")
}
for i in 0..10 {
io.println(i)
}
while a <= b {
io.println(a)
a += 1
if a == 1 {
continue
}
if a == 2 {
break
}
}
loop {
io.println("This will run forever!")
}
try {
c := 1 / 0
} catch e {
io.println(e)
} finally {
io.println("finally")
}