https://github.com/maekawatoshiki/rucc
rucc is a tiny toy C compiler in Rust.
https://github.com/maekawatoshiki/rucc
c compiler rust
Last synced: 10 months ago
JSON representation
rucc is a tiny toy C compiler in Rust.
- Host: GitHub
- URL: https://github.com/maekawatoshiki/rucc
- Owner: maekawatoshiki
- License: mit
- Created: 2017-04-12T08:59:33.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-09-18T15:17:58.000Z (almost 3 years ago)
- Last Synced: 2024-12-27T02:09:54.975Z (over 1 year ago)
- Topics: c, compiler, rust
- Language: Rust
- Homepage:
- Size: 441 KB
- Stars: 182
- Watchers: 7
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RUCC
[](https://circleci.com/gh/maekawatoshiki/rucc)
[](https://codecov.io/gh/maekawatoshiki/rucc)
[](./LICENSE)
rucc is a small toy C compiler implemented in Rust.
# REQUIREMENTS
- latest Rust (recommend [rustup](https://www.rustup.rs/))
- LLVM 10.0
```sh
# ubuntu, or debian...
$ apt-get install llvm-10 llvm-10-dev
```
# RUN
First, do test
```sh
$ cargo test
```
After the test exits successfully, you can try rucc easily with ``./rucc.sh``!
```sh
$ # slow (use binary created by `cargo build`)
$ ./rucc.sh [filename (*.c)]
$ # fast (use binary created by `cargo build --release`)
$ ./rucc.sh [filename (*.c)] --release
```
# FORK AND PULL REQUEST LIFECYCLE
1. fork https://github.com/maekawatoshiki/rucc repository
2. clone your repository on local pc
```sh
$ git clone git@github.com:youraccount/rucc.git
$ cd rucc
```
3. add maekawatoshiki upstream repository & fetch & confirm
```sh
$ git remote add upstream git@github.com:maekawatoshiki/rucc.git
$ git fetch upstream
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/upstream/master
```
4. fetch & marge upstream
```sh
$ git fetch upstream
$ git merge upstream/master
```
5. pullrequest on GitHub
# REFERENCES
I'm using [8cc](https://github.com/rui314/8cc) as reference.