Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zchee/cznic-ccgo
https://github.com/zchee/cznic-ccgo
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/zchee/cznic-ccgo
- Owner: zchee
- License: bsd-3-clause
- Created: 2020-11-07T05:43:35.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-03T17:11:20.000Z (over 2 years ago)
- Last Synced: 2024-06-20T12:44:44.881Z (5 months ago)
- Language: Go
- Size: 23 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ccgo/v1
Package ccgo translates [cc](https://modernc.org/cc/) ASTs to Go. (Work In Progress)
The v1 and v2 versions are no longer maintained. Please see the v3 version at
https://modernc.org/ccgo/v3
Installation
$ GO111MODULE=on go get -t -v -x modernc.org/ccgo/v3
After this, assuming binaries built by the Go downloader are on your $PATH, you should be able to run
$ ccgo hello.c -o hello.go
on a C "Hello, World" program and get an interesting result.
This directory also contains the older v2 and v1 versions. You almost certainly want the version in v3.
- Compile hello.c
jnml@e5-1650:~/tmp> ll
total 0
jnml@e5-1650:~/tmp> cat << EOF > hello.c
#include
int main() {
printf("Hello World!\n");
}
EOF
jnml@e5-1650:~/tmp> ccgo hello.c -o hello.go
jnml@e5-1650:~/tmp> go run hello.go
Hello World!
jnml@e5-1650:~/tmp>- Run `$ go test -download` to (once) get required test resources. Add -dev for
additional 100MB of gcc sources.