{"id":22270215,"url":"https://github.com/kitech/cygo","last_synced_at":"2026-03-10T04:10:41.878Z","repository":{"id":57635431,"uuid":"230560870","full_name":"kitech/cygo","owner":"kitech","description":"A toy programming language base on Golang and compile to C,  no name yet","archived":false,"fork":false,"pushed_at":"2026-02-07T15:51:17.000Z","size":2376,"stargazers_count":34,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-02-07T23:24:28.199Z","etag":null,"topics":["coroutine","golang","mini-golang-binary-size","programming-language"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kitech.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-12-28T05:03:00.000Z","updated_at":"2026-02-07T15:51:20.000Z","dependencies_parsed_at":"2026-01-27T05:01:28.550Z","dependency_job_id":null,"html_url":"https://github.com/kitech/cygo","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kitech/cygo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitech%2Fcygo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitech%2Fcygo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitech%2Fcygo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitech%2Fcygo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kitech","download_url":"https://codeload.github.com/kitech/cygo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitech%2Fcygo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30324186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T01:36:58.598Z","status":"online","status_checked_at":"2026-03-10T02:00:06.579Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coroutine","golang","mini-golang-binary-size","programming-language"],"created_at":"2024-12-03T12:07:45.716Z","updated_at":"2026-03-10T04:10:41.847Z","avatar_url":"https://github.com/kitech.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Compile Go to C, with a generic library contains Go core features, like goroutine,channel,GC.\n\nThat's will generate minimal binary. The farther plan is compile any Go package to C.\n\n### The pain of Go\n* Too large binary size\n* Not zero cost call with C\n* Builtin string/array/map no methods\n* Too verbosity error handling, not like the Go2 `try` error handling proposal\n\n### Features\n* goroutine\n* channel\n* defer\n* GC\n* CGO\n* interface\n* closure\n* string/array/map with lot builtin methods\n* `catch` statement error handling (https://github.com/kitech/cygo/blob/0f213381f06116d0f6f2ca6bf2ccbe70ab088882/bysrc/tpkgs/catch2/t.go#L18)\n* unused var warning, not error\n* for range =\u003e for in\n* type foo struct =\u003e struct foo\n* unsafe.Pointer =\u003e voidptr\n* uintptr =\u003e usize\n* seamless C symbol use\n* zero cost C call\n* all variables reference\n\n### Install\n\n```\ncd $GOPATH\ngit clone https://github.com/kitech/cygo\ncd cygo/bysrc\ngo build -o cygo\n```\n\n### Example\n\n```\n./cygo ./tpkgs/hello\ncmake .\nmake\n```\n\nmore examples/tests https://github.com/kitech/cygo/tree/master/bysrc/tpkgs/\n\nSource code structure:\n* main compiler source https://github.com/kitech/cygo/tree/master/bysrc/\n* goroutine/channel implemention in C https://github.com/kitech/cygo/tree/master/corona-c/\n* some go stdlib implemention https://github.com/kitech/cygo/tree/master/xgo/\n\n### Supported important syntax\n* defer\n* closure\n* select\n\n### Todos\n* [ ] dynamic stack resize\n* [ ] correct and more safe point for GC\n* [ ] support more OS/platforms\n* [ ] so much to do\n\n### Supported original Go packages\n* unsafe\n* errors\n\n### 资料\n* minigo\n* tinygo\n* Let's Build A Simple Interpreter  https://github.com/rspivak/lsbasi\n* dwarf https://github.com/gimli-rs/gimli\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitech%2Fcygo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitech%2Fcygo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitech%2Fcygo/lists"}