C++/CUDA Transpilation Support
Decy now transpiles C++ and CUDA source code to idiomatic Rust. All output compiles with rustc --edition 2021.
C++ Features (9)
- Classes →
struct+implwith fields, methods, constructors, destructors - Namespaces →
pub modblocks (nested) - Constructors →
pub fn new() -> Selfwith positional param fallback - Destructors →
impl Drop - Operator overloading →
std::opstraits (Add, Sub, Mul, Div, Rem, PartialEq, AddAssign, SubAssign) - Single inheritance → composition field +
Deref/DerefMut new/delete→Box::new()/drop()bool/nullptrliterals → bool / NullLiteral- Implicit
thisaccess →self.fieldin method bodies
CUDA Features (5)
.cufile parsing with C++ mode + CUDA keyword detection__global__kernels →extern "C"FFI declarations__device__functions → GPU-only annotation comments__host__functions → normal transpilation- CUDA qualifier preservation through entire transformation pipeline
Quality
- 19/19 spec falsification tests pass (Popperian methodology)
- 5 rustc compilation E2E tests (transpiled C++ actually compiles)
- 9 runnable examples (all compile-proven)
- 2 provable contracts (cpp-type-preservation-v1, cuda-kernel-safety-v1)
- pmat comply: 0 failures
- TDG average: 94.8
Try it
cargo install decy
cargo run -p decy-core --example cpp_full_program_demo
cargo run -p decy-core --example cuda_kernel_ffi_demo
cargo run -p decy-core --example dogfood_validation_demo