Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nwtgck/8cc-elc-hs
C Compiler written in Haskell powered by 8cc and ELVM
https://github.com/nwtgck/8cc-elc-hs
c compiler haskell
Last synced: 13 days ago
JSON representation
C Compiler written in Haskell powered by 8cc and ELVM
- Host: GitHub
- URL: https://github.com/nwtgck/8cc-elc-hs
- Owner: nwtgck
- License: bsd-3-clause
- Created: 2018-04-26T15:45:57.000Z (over 6 years ago)
- Default Branch: develop
- Last Pushed: 2018-04-29T01:11:10.000Z (over 6 years ago)
- Last Synced: 2024-10-11T15:08:48.346Z (27 days ago)
- Topics: c, compiler, haskell
- Language: Haskell
- Homepage:
- Size: 2.18 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 8cc-elc-hs
[![wercker status](https://app.wercker.com/status/58d52d173d227199e549fdf158f44561/s/develop "wercker status")](https://app.wercker.com/project/byKey/58d52d173d227199e549fdf158f44561)C Compiler written in Haskell powered by [8cc](https://github.com/rui314/8cc) and [ELVM](https://github.com/shinh/elvm).
## Build
```bash
stack build --fast
```NOTE: It takes very very long time to compile.
## Install
```bash
stack install
```Then, `8cc-hs` and `elc-hs` commands will be available.
## Compiler Usage
This section explains how to compile C program.
Input : `example_c/hello.c`
Output: `hello` executable```bash
(echo hs && cat example_c/hello.c | 8cc-hs) | elc-hs > hello.hs
stack ghc hello.hs
./hello
```Important thing is that `8cc-hs` and `elc-hs` are written in pure Haskell.
## References
* [yutopp/8cc.rill](https://github.com/yutopp/8cc.rill)
* [rhysd/8cc.vim: C Compiler written in Vim script](https://github.com/rhysd/8cc.vim)