plum
git clone https://git.pyrossh.dev/plum
A statically typed, imperative programming language inspired by rust, python
plum-examples/io.plum
| b7071c9 | 1 | import std/Str |
| 73b5e55 | 2 | import std/Bool |
| b7071c9 | 3 | |
| 98bcd99 | 4 | # `printLn` mirrors `libs/std/os.plum`'s declaration; redeclared locally |
| 98bcd99 | 5 | # (rather than `import std/os`) so this stays the SMALLEST possible example |
| 98bcd99 | 6 | # — `import std/os` pulls in every other filesystem extern os.plum declares |
| 98bcd99 | 7 | # too, which the Rust-level `ioExampleCompilesAndRunsCorrectly` test (which |
| 98bcd99 | 8 | # actually RUNS this module under wasmtime, providing real host imports) |
| 98bcd99 | 9 | # would then all need stubs for. |
| a271f34 | 10 | extern fun printLn(s: Str) |
| a271f34 | 11 | |
| a271f34 | 12 | fun main() = |
| a271f34 | 13 | printLn("hello from plum") |
| a271f34 | 14 | name := "world" |
| a271f34 | 15 | printLn("hello, {name}!") |