plum

#treesitter#compiler#wasm

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

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


plum-tooling/tree-sitter-plum/test/highlight/sample.plum
0d43379 1
module std
0d43379 2
5f2f962 3
enum Cat(ToStr) =
5f2f962 4
  | Cat(name: Str, age: Int)
0d43379 5
6b5d9db 6
  fun withName(name: Str) -> Cat =
6b5d9db 7
    Cat(name: name, age: self.age)
0d43379 8
6b5d9db 9
  fun withAge(age: Int) -> Cat =
6b5d9db 10
    Cat(name: self.name, age: age)
0d43379 11
6b5d9db 12
  fun toStr() -> Str =
6b5d9db 13
    "Cat({self.name}, {self.age})"
0d43379 14
c06ddba 15
fun main() =
6b5d9db 16
  printLn("Hello world")