Ursa

A friendly, stable, general-purpose programming-language
Ursa helps you write code that will last a long time: a simple, general-purpose programming language that is easy to pick up and will work the same way long into the future.
Latest release: vx.y.z (Date)
Latest news (18 March 2024)
Examples and Demo
Code
print("hello woods!")
Result
Output
Code
let fac = fn(x: Int): Int {
  if x == 0 {1} else {x * fac(x - 1)}
}
fac(6)
Result
Output
Code
let sum = fn(l: List<Int>): Int {
  let tot = 0
  let i = 0
  loop {
    if i == l.len() { return tot }
    tot := tot + l.get(i)
    i := i + 1
  }
}
sum([10, 30, 50, 5, 5])
Result
Output
Code
let newAccums = fn(): List<fn(x: Int): Void> {
  let tot = 0
  let l = [
    fn(x: Int): Void {
      tot := tot + x
    },
    fn(x: Int): Void {
      tot := tot + x
    },
  ]
  tot := 2
  l
}
let accums = newAccums() and
let accums2 = newAccums()
[
  [accums.get(0)(1), accums.get(0)(1), accums2.get(0)(1)],
  [accums.get(1)(1), accums.get(1)(1), accums2.get(1)(1)],
]
Result
Output
Result
Output
Rosetta Code
Discuss and learn Ursa