Topaz Language

A modern programming language specifically designed for the Core Syntax Kernel.

Design Philosophy

Topaz achieves the unambiguity and extreme efficiency required for AI and robotic systems. Built for the Core Syntax Kernel, it provides zero-overhead abstractions for real-time applications.

🤖 AI & Robot Optimized

S-expression syntax is ideal for AI analysis and code generation.

⚡️ High Performance

High-level abstractions with zero-overhead, compiled to efficient code.

💎 Unambiguous & Safe

Static typing and explicit error handling ensure robust programs.

Core Language Features

Definitions: $

($ IDENTIFIER EXPRESSION)

Examples:

($ pi 3.14159) ($ greeting "Hello, Topaz!") ($ sum (+ pi 10))

Operations

(OPERATOR ARG1 ARG2 ...)

Examples:

(+ 10 20 30) (string:concat greeting " 👋") (> (vector:length [ 1 2 ]) 0) ;; -> #true

Conditionals: IF

(IF CONDITION THEN ELSE)

Examples:

(IF (> temperature 20) "It's warm" "It's cool")

Processes: λ

(λ (PARAMS...) BODY...)

Examples:

($ square (λ (n) (* n n))) ($ add5 (λ (n) (+ n 5)))

Data Structures

[vector] and (# map)

Examples:

($ vec [1 "two" #true]) ($ map (# :name "Alice" :age 30))

User-Defined Types

(DEFINE-TYPE Point (# :x Float :y Float))

Examples:

(DEFINE-ENUM Status :pending :done) ($ p1 (# :x 1.0 :y 2.5))

Module System

(MODULE name (EXPORT ...))
(IMPORT module :as alias)

Examples:

(;; In math.tpz (MODULE math (EXPORT add)) ($ add (λ (a b) (+ a b))) (;; In main.tpz (IMPORT math :as m) (m:add 2 3)

Macro System

(DEFMACRO name (params) body)

Examples:

(DEFMACRO unless (cond body...) `(IF ,cond NULL_SIG (BEGIN ,@body...)) ) (unless (< 5 10) (io:print "5 is not > 10"))

This was a brief overview. For the complete specification and guides, please visit the Topaz Official Documentation.

View Topaz Official Docs →