- Language mode
- 6.0
- Product
- Not released
Prepare the sample file
For commands that take main., save the source from your first program under that name. Use a working copy of 5.21 source for migrate.
Source files
topaz parse main.. Check the syntax of the file. A clean parse printstpz - - language- version 6. 0 main..tpz: parse- ok topaz dump-. Print the parser’s syntax tree for the file.ast main. tpz - - language- version 6. 0 topaz check main.. Resolve imports and check types. A clean check in human format printstpz - - language- version 6. 0 types-andok resolve-. Addok -for JSON diagnostics or- format json -for export data on standard output.- exports- json topaz run main.. Check the file, compile it to a temporary native executable and run it. This needs the installed code writer and local Rust build tools. Addtpz - - language- version 6. 0 -for the reference interpreter. See Running programs.- compiler rust topaz test diagnose-. Run the assertions in the diagnostic tour. A successful test printsand- test. tpz - - language- version 6. 0 - - compiler rust diagnose-.and- test. tpz: test- ok topaz fmt main.. Check formatting without writing the file. Differences lead to exit status 1.tpz - - language- version 6. 0 - - check
Packages and migration
topaz init -. Create a native package with- root my- package topaz.andtoml src/. Choose a directory without an existing manifest or entry.main. tpz topaz add util -. Declare a local dependency. Put a package named- path . . / util - - root my- package utilbesidemy-first. The dependency path is relative to the package root.package topaz lock -. Write- root my- package topaz.for the package inputs. Registry content must already be available if its hash is needed.lock topaz vendor -. Use an existing local registry directory to materialize declared registry dependencies and write the lock.- root my- package - - from . / registry topaz doc -. Check the package’s export module and write- root my- package - - out- dir api exports.andjson index.inmd api.topaz migrate main.. Preview edits on a working copy of 5.21 source. See the migration guide.tpz - - from 5. 21 - - to 6. 0
Native development commands
topaz emit main.. Withtpz - - target rust native-and its installed writer, emit Rust to standard output. See native commands.dev topaz build main.. Withtpz - - target native - - out- dir out native-and local tools, build into a new directory. See native commands.dev
Inspect the CLI
topaz explain TPZ5523. Read the explanation for a duplicate protocol bound and its suggested repair.topaz version -. Identify the compiler, language mode and engine.- verbose topaz license. Print the installed license terms.topaz notice. Print the installed notices.topaz help. List commands and their options for this CLI.
Commands with 5.21 examples
These commands are unavailable in the 6.0 development CLI. Their examples on the command pages apply to Topaz 5.21.3.