Language Reference
use
Imports a Raz module or requests a native C++ header for the generated output.
Raz module import
use std.io;
use std.text;
A dotted module path is resolved against the configured module search roots. The resolved Raz source is incorporated into the compilation pipeline. The compiler has no implicit prelude; modules must be imported explicitly.
Native header import
use "native_api.hpp";
A quoted path selects a native C++ header dependency. It is preserved as a header include in generated C++; it is not interpreted as a Raz module.
Current distinction
| Form | Owner | Effect |
|---|---|---|
use std.io; |
Raz module resolver | Finds and processes a Raz module using configured module roots. |
use "native_api.hpp"; |
Frontend and C++ backend | Adds a native header dependency to generated C++. |
Design notes
The name is inspired by Rust module imports, but Raz supports a separate quoted-header form and uses its own module-resolution rules. Compatibility with Rust namespaces, visibility, aliases, or import semantics is not implied.
Decisions to finalize
- Define module path casing and platform-dependent resolution behavior.
-
Specify duplicate imports and ordering relative to
includeand macros. - Document which native header forms are portable across the supported toolchain.
- Specify diagnostics for unresolved modules and ambiguous roots.