Getting Started with Topaz

Studio Haze engineering guide. Set up your environment and run your first Topaz program in minutes.

Welcome to Topaz! This guide takes you from Topaz environment setup to running your first program as quickly and smoothly as possible. 10 minutes is all you need! 🚀

Audience
Written for Studio Haze engineers. Some distribution channels are internal‑only.

v4

📦 Installation

Topaz distribution is provided through Studio Haze channels. Choose one of:

  • Dev Portal: Sign in with Studio Haze SSO → Tools → Topaz → Install
  • Internal Docs: Follow the “Topaz Workstation Setup” guide on the engineering wiki
  • Platform Support: If you don’t yet have access, request it via the platform ticket queue

Notes

  • Access typically requires Studio Haze SSO/VPN.
  • macOS, Linux, and Windows builds are available via the internal registry.
  • External package managers may not be available.

✅ Verify Installation

Check if the installation was successful:

topaz --version

If you see version info like Topaz 1.0.0, you're all set! 🎉

🚀 Your First Program

Let's start with the simplest Topaz program.

Create a hello.tpz file and enter the following code:

// Your first Topaz program
let greeting = "Hello, Topaz world!"
print(greeting)

Run the program:

topaz run hello.tpz

Output:

Hello, Topaz world!

Congratulations! 🎉 You've successfully run your first Topaz program.

🎯 Experiment with REPL

Topaz provides a powerful REPL (Read-Eval-Print Loop). You can execute code instantly and see results, making it perfect for learning and experimentation.

Enter this command in your terminal:

topaz repl

Once the REPL starts, try experimenting like this:

let name = "Developer"
"Developer"

let age = 25
25

"Hello, {name}! You are {age} years old!"
"Hello, Developer! You are 25 years old!"

let scores = [85, 92, 78, 96, 88]
[85, 92, 78, 96, 88]

scores.map(x => x + 5)
[90, 97, 83, 101, 93]

To exit the REPL, press Ctrl+C or type .exit.

🌟 More Interesting Examples

Now let's create more interesting examples that showcase Topaz's charm.

Create a fibonacci.tpz file:

// Fibonacci sequence calculator
function fibonacci(n: int) -> int {
    match n {
        case 0 => 0
        case 1 => 1
        case _ => fibonacci(n-1) + fibonacci(n-2)
    }
}

// Print first 10 Fibonacci numbers
let result = (0..<10).map(fibonacci)
print("Fibonacci sequence (first 10): {result}")

// Web API data fetching example
let userData = fetch("https://jsonplaceholder.typicode.com/users/1")
    |> json()
    |> (data => data.name)

print("User name from API: {userData}")

Run it:

topaz run fibonacci.tpz

📚 Next Steps

Excellent! You've now mastered the basics of Topaz. Take the next steps:

🎯 Learn Core Concepts

🛠️ Build Real Projects

📖 Complete Reference

🎉 Congratulations!

You are now a Topaz developer! 🚀

Start your journey where coding becomes poetry. With Topaz, even complex logic can be expressed as beautiful, readable code.

For help, refer to the internal engineering wiki or contact the Platform Engineering team.