Expand description
Multi-target code generation
This module provides code generation for multiple targets:
- Rust (default)
- JavaScript (ES2020+)
- WebAssembly
§Architecture
The code generation is split into:
- Backend trait - Common interface for all targets
- Target-specific backends - Rust, JavaScript, WASM
- Idiomatic formatters - Ensure output is idiomatic for each language
§Backward Compatibility
The existing CodeGenerator is preserved and re-exported for backward compatibility.
New code should use the CodegenBackend trait interface.
Re-exports§
pub use rust::CodeGenerator;
Modules§
- backend
- Code generation backend trait for multi-target compilation
- javascript
- JavaScript code generation backend (ES2020+)
- rust
- Rust code generation modules
- wasm
- WebAssembly code generation backend
- wasm_
component_ generator
Functions§
- generate
- High-level code generation function that dispatches to the appropriate backend
- generate_
javascript - Generate JavaScript code
- generate_
rust - Generate Rust code (backward compatible function)
- generate_
wasm - Generate WebAssembly code