One wayto say it.

Build command-line tools, transform data, and write application logic with Topaz. Run the same source on your computer or build a package for the browser.

Run this program today and get the output shown here.

TOPAZ
function greet(name: string) -> string {
    return "Hello, {name}!"
}

print(greet("Topaz"))
output
Hello, Topaz!

Names in your language

Use Korean, Russian, or English names for variables and functions.

A small, consistent grammar

Learn one form for each common task. Developers and code generators use the same rules.

A compiler written in Topaz

The compiler you install is itself a substantial working program written in Topaz. It recompiles its own source to the same generated code, byte for byte.

How the compiler checks its own build →

More programs and their output

TOPAZ
function discount(customer: { tier: string, years: int }) -> float {
    return match customer {
        case { tier: "vip", years } if years > 5 => 0.3
        case { tier: "vip" } => 0.2
        case { years } if years > 1 => 0.1
        case _ => 0.0
    }
}

print("{discount({ tier: "vip", years: 7 })}")
print("{discount({ tier: "new", years: 0 })}")
output
0.3
0.0
TOPAZ
let result = concurrent {
    answer: 6 * 7
    status: "ready"
}

defer print("cleaned up")
print("{result.answer} {result.status}")
output
42 ready
cleaned up
TOPAZ
function fibonacci(n: int) -> int {
    return match n {
        case 0 => 0
        case 1 => 1
        case _ => fibonacci(n - 1) + fibonacci(n - 2)
    }
}

let series = map(0..<10, fibonacci)
print("{series}")
output
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
TOPAZ
function clean(words: Array<string>) -> Array<string> {
    return filter(words, (w: string) => w != "")
}

function shout(words: Array<string>) -> Array<string> {
    return map(words, (w: string) => w + "!")
}

let line = ["one", "", "way", "", "to", "say", "it"]
    |> clean
    |> shout
print("{line}")
output
[one!, way!, to!, say!, it!]