A transpiler that converts C source code into human-readable, idiomatic Go code.
CxGo is a transpiler tool that converts C source code into Go, enabling developers to migrate C libraries and applications to the Go programming language. It parses C code using a dependency-free parser, performs type checking, and generates idiomatic Go output. The tool solves the problem of porting legacy C codebases to modern Go ecosystems while maintaining correctness and readability.
Developers and teams working with legacy C codebases who want to migrate to Go, or those integrating C libraries into Go projects. It's also useful for open-source maintainers looking to port C projects to Go.
CxGo offers a practical, configurable translation process that produces human-readable Go code without relying on external C compilers. Its focus on correctness and idiomatic output sets it apart from simpler code converters, making it suitable for real-world projects.
Tool for transpiling C to Go.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses the cc/v3 library to parse C code without external compilers like clang or GCC, simplifying setup and reducing toolchain dependencies.
Generates human-readable Go code that follows Go conventions, making the translated code more maintainable and easier to integrate.
Offers customization options to handle edge cases, such as flattening identifiers for goto workarounds, allowing tailored translation.
Successfully transpiled projects like Potrace and G722, demonstrating practical utility for specific libraries and algorithms.
Marked as experimental with warnings against production use, and test coverage is only 63-70% for major compilers, indicating reliability issues.
Many C features, including static, auto, bitfields, and unions, are partially implemented or missing, as listed in caveats, limiting compatibility.
Some standard library functions and types are not yet supported, requiring manual intervention and reducing automation for full porting.