~repos /plum

#treesitter#compiler#wasm

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

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



tooling/tree-sitter-plum/test/aa.plum



module std
import std/int
import std/str
PI = 3.14
MSG = "Hello World"
SUM = 1 + {{2 * 3} / 4}
ENABLED = !False
# Animal is a set of behavior of every animal species
trait IAnimal =
speak() -> Str
# Cat is an animal that meows always
type Cat(IAnimal, IToStr) =
name: Str
age: Int
withName<Cat>(name: Str) -> Cat =
Cat(name: name, age: self.age)
withAge<Cat>(age: Int) -> Cat =
Cat(name: self.name, age: age)
speak<Cat>() -> Str =
"meow"
toStr<Cat>() -> Str =
for i in 0..10
printLn("delta")
if dog > 1
printLn("Hellow")
else
printLn("New")
"Cat({self.name}, {self.age})"
main() =
printLn("Hello world")