Edit source

Rust language support

The Rust target supports TypeScript when the checked source semantics can be represented faithfully by the approved static Rust architecture.

AreaSupported contracts
ModulesESM imports/exports, side-effect imports, source packages, source-ordered module initialization, default exports
DeclarationsFunctions, classes, interfaces, enums, aliases, generics, overload implementations, inheritance, constructors, statics, static blocks
ValuesPrimitives, arrays, fixed arrays, tuples, structural records, string-literal enums, discriminated unions, nullable values, and producer-owned finite broad values
CallsSource/provider overloads, generics, optional/rest parameters, callbacks, constructors, parameter modes, conversions
ExpressionsArithmetic, comparisons, boolean logic, optional chains, nullish coalescing, properties, elements, assignments, spreads, assertions
Control flowBlocks, branches, switch/fallthrough, loops, labels where representable, exceptions, finally, async/await
IterationArrays, strings, provider iterables, for...of, for await...of
GeneratorsSync, async, bidirectional next(value), completion, throw/return, yield*, retained-borrow protocols
Resourcesusing, await using, lexical and exceptional cleanup
TypeScript typesThe complete pinned utility family when its resolved result has a closed Rust representation
Rust ownershipInferred ordinary ownership plus explicit references, lifetimes, bounds, higher-ranked callables, trait objects, and opaque captures
Native interoprustdoc virtual declarations, direct Cargo dependencies, references, raw pointers, ABIs, safety, fallibility, associated types
JS surfaceClosed implemented JavaScript operation families
NodeInstalled Rust Node capability inventory
FoundationsIndependently verified core, alloc, and std requirement closure

Support is fact-driven. Similar-looking Rust syntax is insufficient: the target must prove source evaluation order, carrier identity, ownership, borrows, cleanup, errors, module initialization, and native API identity before planning.