Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lemoncmd/vcc
C compiler written in V
https://github.com/lemoncmd/vcc
Last synced: 3 months ago
JSON representation
C compiler written in V
- Host: GitHub
- URL: https://github.com/lemoncmd/vcc
- Owner: lemoncmd
- License: mit
- Created: 2019-10-02T04:35:01.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-05T04:16:19.000Z (8 months ago)
- Last Synced: 2024-04-23T16:38:12.739Z (7 months ago)
- Language: V
- Size: 311 KB
- Stars: 98
- Watchers: 8
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-v - vcc - A C compiler written in V. (Applications / Interpreters/Compilers)
README
# VCC - The C Compiler in V
This is a toy C compiler written in V.
This compiler is based on [chibicc](https://github.com/rui314/chibicc) by Rui Ueyama.
This is the first compiler I have made.The main object of this compiler is to compile The V Programming Language and compile itself by produced V binary.
Document by Rui Ueyama(Japanese): https://sigbus.info/compilerbook
My blog(Japanese): https://blog.anzu.tech/post/vcc## Usage
Please make sure that the V compiler is installed on your terminal.
The V Programming Language: https://vlang.ioTo build VCC, run the following command
```sh
v -o vcc ./src
```
or just type
```sh
make
```To compile C source code,
```sh
./vcc foobar.c > foobar.s
gcc -o foobar foobar.s
```## Key Features of VCC
- All the operators in C are implemented
- `extern` and global variables/prototype declaration supported
- You can declare variables in `for` statements! Yay!
- Structs and Unions are supported## and WIPs, you know
- Preprocessor
- Initialization
- Float
- Enum
- Compound literal, it's well used in V## Reference
Special thanks to [Rui Ueyama](https://twitter.com/rui314)