plum

#treesitter#compiler#wasm

git clone https://git.pyrossh.dev/plum

A statically typed, imperative programming language inspired by rust, python


examples/functions.plum
fun addInts(a: Int, b: Int) -> Int =
  a + b

fun greet() =
  todo

fun withDefault(a: Int, step: Int = 1) -> Int =
  a + step

fun sumAll(nums: ...Int) -> Int =
  total := 0
  for v := range nums
    total = total + v
  total

fun wrap(value: T) -> Bool =
  True

fun pair(first: T, second: U) -> Bool =
  True

fun useWrap() -> Bool =
  wrap(5)

fun usePair() -> Bool =
  pair(1, "x")