Hasty Briefsbeta

Bilingual

Show HN: Hybrid-Transpiler – A tool to convert C++ to Rust and Go

4 months ago
  • #Rust
  • #C++
  • #transpiler
  • A source-to-source compiler (transpiler) that converts C++ code into modern, safe languages like Rust and Go with high accuracy and performance.
  • Leverages LLVM/Clang's complete C++ parser for accurate type system mapping and semantic preservation.
  • Converts C++ RAII patterns to Rust's ownership system and smart pointers to appropriate forms in Rust/Go.
  • Supports transformation of STL containers, templates to generics, and exception handling to Result/Option types in Rust or error values in Go.
  • Includes FFI generation for Rust and Go, allowing direct calls to C++ libraries through C ABI.
  • Provides detailed mappings for C++ features like threading, coroutines, and virtual functions to Rust and Go equivalents.
  • Offers performance metrics and execution times for different project sizes when transpiling to Rust or Go.
  • Includes a comprehensive directory structure for the transpiler project, covering parser, IR, codegen, and FFI components.
  • Lists limitations such as partial support for macro expansion, complex template metaprogramming, and inline assembly.
  • Encourages community contributions through bug reports, feature requests, and pull requests under the MIT License.