https://github.com/rust-lang/rustc_codegen_c
C based backend for rustc
https://github.com/rust-lang/rustc_codegen_c
Last synced: about 2 months ago
JSON representation
C based backend for rustc
- Host: GitHub
- URL: https://github.com/rust-lang/rustc_codegen_c
- Owner: rust-lang
- License: apache-2.0
- Created: 2024-08-26T23:15:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-27T10:54:37.000Z (about 1 year ago)
- Last Synced: 2025-01-30T07:21:57.102Z (10 months ago)
- Language: Rust
- Size: 42 KB
- Stars: 10
- Watchers: 19
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-compilers - rustc_codegen_c - This a C codegen backend for rustc, which lowers Rust MIR to C code and compiles it with a C compiler. (Rust / Other dialects and variants)
README
# rustc_codegen_c
C based backend for rustc
[](https://github.com/rust-lang/rustc_codegen_c/actions/workflows/ci.yml)
This a C codegen backend for rustc, which lowers Rust MIR to C code and compiles
it with a C compiler.
This code is still highly experimental and not ready for production use.
## Try it
In the root directory of the project, run the following command:
```bash
./y rustc examples/basic_math.rs
./build/basic_math
```
The usage of `./y` can be viewed from `./y help`.
Note: only Linux is supported at the moment. `clang` is required to compile C code,
and LLVM FileCheck is required to test the codegen.
## License
This project is licensed under a dual license: MIT or Apache 2.0.