1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! Backend code generation and transpilation
//!
//! This module handles the conversion of Ruchy AST to Rust code, WebAssembly
//! compilation, and module system management.
//!
//! # Architecture
//!
//! The backend follows a multi-stage compilation pipeline:
//!
//! ```text
//! Ruchy AST → Type Checking → Code Generation → Output
//! ↓ ↓ ↓ ↓
//! Frontend Middleend Backend Rust/WASM
//! ```
//!
//! # Components
//!
//! ## Transpiler
//! Converts Ruchy AST nodes to equivalent Rust code:
//! - Expression transpilation with proper precedence
//! - Statement handling and control flow
//! - Pattern matching compilation
//! - Actor system code generation
//!
//! ## Module System
//! Manages Ruchy module loading and dependency resolution:
//! - Module discovery and caching
//! - Import/export resolution
//! - Circular dependency detection
//! - Module compilation ordering
//!
//! ## WebAssembly Support
//! Compiles Ruchy to WebAssembly for browser deployment:
//! - WASM module generation
//! - JavaScript interop
//! - Memory management for WASM
//! - Component model support
//!
//! ## `DataFrame` Integration
//! Optional Apache Arrow integration for data science:
//! - `DataFrame` ↔ Arrow conversion
//! - Columnar data processing
//! - Memory-efficient operations
//!
//! # Examples
//!
//! ```
//! use ruchy::backend::{Transpiler, CompileOptions};
//! use ruchy::frontend::Parser;
//!
//! // Basic transpilation
//! let mut parser = Parser::new("let x = 42");
//! let ast = parser.parse().unwrap();
//!
//! let mut transpiler = Transpiler::new();
//! let rust_code = transpiler.transpile_to_program(&ast).unwrap();
//!
//! println!("Generated Rust:\n{}", rust_code);
//! ```
//!
//! ```no_run
//! use ruchy::backend::{compile_to_binary, CompileOptions};
//! use std::path::Path;
//!
//! // Compile to executable binary
//! let options = CompileOptions::default();
//! let binary_path = compile_to_binary(Path::new("main.ruchy"), &options).unwrap();
//! println!("Binary created: {}", binary_path.display());
//! ```
pub use ;
pub use ;
pub use ModuleResolver;
pub use Transpiler;
// Tests removed: This module only re-exports from submodules.
// Actual implementations and tests belong in the submodules.