Skip to content

Decy v2.2.0 — C++/CUDA Transpilation

Latest

Choose a tag to compare

@noahgift noahgift released this 31 Mar 07:38
· 15 commits to main since this release

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)

  • Classesstruct + impl with fields, methods, constructors, destructors
  • Namespacespub mod blocks (nested)
  • Constructorspub fn new() -> Self with positional param fallback
  • Destructorsimpl Drop
  • Operator overloadingstd::ops traits (Add, Sub, Mul, Div, Rem, PartialEq, AddAssign, SubAssign)
  • Single inheritance → composition field + Deref/DerefMut
  • new/deleteBox::new() / drop()
  • bool/nullptr literals → bool / NullLiteral
  • Implicit this accessself.field in method bodies

CUDA Features (5)

  • .cu file 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

31 PMAT tickets: DECY-198 through DECY-228