Interop & Platform

Interop and Platform

Native C++ headers, explicit native calls, backend mappings, and target assumptions.

Raz Gen2 Manual·Interop & Platform
Feature Current behavior
Native header use "header.hpp"; adds a header dependency to generated C++.
Native call native_name!(args) emits an explicit native call without a Raz extern declaration.
Raz module use dotted.module; resolves Raz source against configured roots.
Backend target Compiler emits C++17.
Type mappings f64 to double, bool to bool, char to char, string to std::string, and List<T> to std::vector<T>.
C ABI Native headers are included in generated C++; no separate C ABI contract is recorded.
Target metadata Driver accepts OS, architecture, and compiler labels used for target constants.
extern Parser and lexer token handling are inconsistent.

Native call example

use "native_api.hpp";

let result = native_function!(42);

The example illustrates syntax only. The correct types and calling convention depend on the declarations exposed by the included native header and the current Raz validation behavior.

Platform contract to define

  • Supported GNU C++ versions and whether other C++17 compilers are guaranteed.
  • C headers, extern "C", symbol names, and ABI stability.
  • Native-call restrictions inside and outside unsafe blocks.
  • Whether target labels are descriptive metadata or validated cross-compilation targets.