Topaz
Topaz is an independent programming language designed separately by STUDIO HAZE. Core Semantic Kernel adopts a two-layer architecture: the performance-critical core is implemented in Rust, while the higher-level control and specification layer is written in Topaz. Because Topaz is designed around tight FFI integration with Rust, the two layers operate as a single cohesive system.
This page is a case study showing how Topaz is used within Core Semantic Kernel. It is not the canonical grammar reference; the full language definition lives at topaz.ooo.
Design Philosophy
Core values and language design principles of Topaz
Write Less, Express More
Achieve maximum expressiveness with minimal code. Eliminate unnecessary boilerplate and provide concise syntax that clearly expresses developer intent.
"A language where code becomes poetry"
Global Grammar, Local Expression
Keywords are unified in English, but identifiers can freely use any language in the world. Developers can code naturally in their native language.
Implementation Alignment
The Topaz examples on this page show expression patterns from the control and specification layer of Core Semantic Kernel.
Examples
A short collection showing how Topaz appears inside Core Semantic Kernel.
Multilingual Identifiers
Keywords stay English; identifiers may be any language, including Korean and emoji.
1function 인사하기(이름: string) -> string {
2 return "안녕하세요, {이름}님!"
3}
4
5print(인사하기("토파즈"))Result with defer
Failure is explicit via Result; defer guarantees cleanup when the scope exits.
1function writeLog(message: string) -> Result<(), string> {
2 let file = open("app.log")?
3 defer { file.close() }
4
5 file.write(message)?
6 return Ok(())
7}Concurrent Execution
A concurrent block expresses parallel work with an explicit timeout and else fallback. The else branch runs only on timeout.
Assumes: userId: int, loadUser: (int) -> Option<{ name: string }>, loadPosts: (int) -> Array<string>
1let dashboard = concurrent(timeout: 3s) {
2 user: loadUser(userId)
3 posts: loadPosts(userId)
4} else {
5 {
6 user: None,
7 posts: []
8 }
9}Record Update
Produces a new record with the listed fields changed; the original record is unmodified.
1let user = { name: "Alice", age: 30 }
2let older = user{ age: 31 }Optional Chaining
Optional chaining and null coalescing handle absent values safely.
1let maybeUser: Option<{ name: string }> = Some({ name: "Alice" })
2let displayName = maybeUser?.name ?? "guest"Related Information
Related Core Semantic Kernel docs that accompany Topaz-based implementation work
The canonical Topaz grammar and semantics are at topaz.ooo.
Topaz Docs