v0.1.22

The Suji Programming Language

A small, expressive language with pipes, pattern matching, shell integration, and a focus on clarity.

example.si
import std:io
import std:println

producer = || {
    println("foo")
    println("bar")
    println("baz")
}

count_lines = || {
    lines = io:stdin::read_lines()
    return lines::length()
}

format = |n| "matches: ${n}"

producer() | `grep ba` | count_lines()
    |> format
    |> println

Expressive by Design

Suji combines the best ideas from functional and scripting languages into something that feels natural.

Pipes & Pipelines

Stream data with shell-style | pipes or compose values with F#-style |> and <| operators.

data
    |> parse
    |> transform
    |> println

Pattern Matching

Powerful match expressions with literals, regex patterns, conditions, and destructuring.

match email { 
    /^admin@/ => "admin",
    /@corp\.com$/ => "employee",
    _ => "guest",
}

Shell Integration

Execute commands with backticks, pipe to shell tools, and mix closures with Unix utilities seamlessly.

files = `ls -la | grep ".txt"`

First-Class Functions

Higher-order functions, closures, and function composition with >> and << operators.

transform =
    inc >> double >> format

Rich Standard Library

Built-in support for JSON, YAML, TOML, CSV parsing, cryptographic hashing, encoding, and more.

config =
    io:open("config.yaml")
        ::read_all()
    |> yaml:parse

String Interpolation

Embed expressions directly in strings and shell commands with ${...} syntax.

"Hello, ${name}! Sum: ${1 + 2}"

See It In Action

Quicksort in 14 lines of expressive, readable code.

sort.si
import std:println

quicksort = |list| {
    match list::length() {
        0 => [],
        1 => list,
        _ => {
            pivot = list[0]
            rest = list[1;]
            left = rest::filter(|x| x < pivot)
            right = rest::filter(|x| x >= pivot)

            quicksort(left) + [pivot] + quicksort(right)
        },
    }
}

unsorted = [64, 34, 25, 12, 22, 11, 90]
quicksort(unsorted) |> println  # [11, 12, 22, 25, 34, 64, 90]