Skip to content

NymphProgramming Language

A simple language that gets out of your way.

Core APIs such as Option, Result, operators, and iteration are ambient. Other standard-library modules are opt-in through std/...; project modules use source-rooted @/... or relative ./... and ../... imports.

nym
import std/io

func main() = {
  io.println("Hello world!")
}
nym
func factorial(n: int): int = match (n) {
  ..=1 -> 1,
  _ -> n * factorial(n - 1),
}
nym
enum BinaryTree<T> {
  Leaf(value: T),
  Node(left: BinaryTree<T>, right: BinaryTree<T>),
}
nym
func odd_squares(nums: #[int]): #[int] = nums
  .iter()
  .filter((value: int) -> value % 2 == 1)
  .map((value: int) -> value ** 2u)
  .to_list()