Program Structure

Forbidden & Deferred Forms

Replace familiar but unsupported syntax with canonical Topaz forms.

Refer to this guide when topaz check rejects syntax originating from JavaScript, Python, Rust, or an earlier Topaz draft. Topaz does not accept familiar constructs as an alternative dialect. In most cases, a direct current form exists. Where no equivalent exists, the feature is unsupported rather than partially implemented.

Check a program that uses the current forms

Save this as forbidden-deferred.tpz:

TOPAZ
let mut count = 0
let values: Array<int> = [1, 2]
let transform: (int) -> int = value => value + 1

match values {
    case [head, ..tail] => {
        count = transform(head) + tail.length
    }
    case [] => {
        count = 0
    }
}

print("{count}")

Check and run it:

BASH
topaz check forbidden-deferred.tpz
topaz run forbidden-deferred.tpz

The output is:

Output
3

This single program demonstrates current binding order, named collection types, callable types, lambdas, and list-rest patterns.

Replace the spelling, not the meaning

If you triedUse instead
mut let count = 0let mut count = 0
count++ or count--count = count + 1 or count = count - 1
[T] in a typeArray<T>
function(T) -> U in a type(T) -> U
args: ...T...args: T
[head, ...tail][head, ..tail]
An anonymous function (...) { ... }A lambda such as value => value + 1
Backticks or ${value}Double quotes and {value} interpolation
String indexing or .lengthtext.scalars() and Array operations
async or awaitAn explicit bounded concurrent expression where that model fits

Module imports and exports follow fixed syntax rules. Use explicit member imports and inline export declarations from Modules & Visibility. Do not use use, string or template module paths, export lists, wildcard exports, re-exports, or export-site renaming.

Invalid spellings above are shown as text reference rather than valid Topaz examples. Run topaz check before selecting a backend target. The shared checker rejects these forms at the language boundary rather than asking a generated target to infer their meaning.

Unsupported is not a roadmap promise

Some rejected forms have a direct replacement. Others are deferred because their semantics fall outside the current language specification. Deferred status does not mean that a partial implementation is safe to depend on, nor does it promise a particular future release.

The unavailable feature families include grapheme-cluster and direct string-slicing syntax, HTML and user-defined template tags, broader or higher-rank generic constraints, recursive type aliases, broad protocol dispatch, package re-exports, general iterable spread, asynchronous cleanup, async/await, fault catching, panic/throw/catch keywords, and optional-property pipe syntax.

Rust ownership idioms and receiver tokens such as &self, &mut self, Vec<T>, and use crate:: belong exclusively in explicit interop specifications, not standard Topaz. JavaScript record spread and Rust-style method blocks likewise do not become Topaz syntax merely because one generated target can express them.

Start with Syntax at a Glance for current forms. Use Operators & Expressions for operator corrections and Modules & Visibility for the exact program-structure surface.