{"id":19297234,"url":"https://github.com/mycoboco/beluga","last_synced_at":"2025-04-22T08:31:25.415Z","repository":{"id":21213238,"uuid":"24526159","full_name":"mycoboco/beluga","owner":"mycoboco","description":"a standard C compiler (with an integrated preprocessor)","archived":false,"fork":false,"pushed_at":"2025-02-17T12:54:26.000Z","size":5235,"stargazers_count":65,"open_issues_count":11,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-17T13:36:37.427Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://code.woong.org/beluga","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mycoboco.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS","contributing":null,"funding":null,"license":"LICENSE.lcc","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}},"created_at":"2014-09-27T07:28:55.000Z","updated_at":"2025-02-17T12:51:31.000Z","dependencies_parsed_at":"2024-11-09T23:02:02.029Z","dependency_job_id":null,"html_url":"https://github.com/mycoboco/beluga","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mycoboco%2Fbeluga","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mycoboco%2Fbeluga/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mycoboco%2Fbeluga/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mycoboco%2Fbeluga/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mycoboco","download_url":"https://codeload.github.com/mycoboco/beluga/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250206179,"owners_count":21392205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-09T23:01:48.876Z","updated_at":"2025-04-22T08:31:20.397Z","avatar_url":"https://github.com/mycoboco.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"beluga: a standard C compiler\n=============================\n\n`beluga` is a standard C compiler being developed based on an earlier version\nof [`lcc`](https://github.com/drh/lcc). It supports C90 (to be precise,\n[ISO/IEC 9899:1990](http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=17782))\nas its ancestor does and is planned to extend the coverage to\n[C99](http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=29237)\n(and\n[C11](http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=57853)\nfinally).\n\nCompared to its parent, `beluga` carefully implements the language standard\nand thus provides production-quality diagnostics including caret diagnostics,\nrange highlighting, `typedef` preservation and macro expansion tracking:\n\n![screenshot for enhanced front-end features](http://code.woong.org/common/files/compiler-20171025.png)\n\nThe generated code is not highly optimized, but satisfactory enough for daily\nuse. (_This is a hobby project; never easy for me alone to catch up production\ncompilers like [gcc](https://gcc.gnu.org/) and\n[clang+llvm](http://clang.llvm.org/)_.)\n\n`beluga` currently produces assembly output for\n[x86](https://en.wikipedia.org/wiki/X86) only (and uses an assembler from the\ntarget system). Thanks to its origin, however, it can be readily retargeted to\nother platforms. Support for 64-bit machines (like\n[x86-64](https://en.wikipedia.org/wiki/X86-64)) requires new significant\nfeatures to be implemented and is one of most important goals of this project.\n\nAlso I'm redesigning each part of the compiler aiming for better structure\n(e.g., see below for an integrated preprocessor) and have a plan to completely\nreplace the back-end interface and implementation to ease adoptation of more\nambitious optimization techniques mainly based on a\n[CFG](https://en.wikipedia.org/wiki/Control_flow_graph).\n\n\n#### An integrated preprocessor\n\nThe preprocessor formerly developed as a separate executable under the name of\n`sea-canary`, has been integrated into the compiler. It reads source code and\ndelivers tokens (not characters) to the compiler proper via a token stream (not\nvia a temporary file). It is\n[fairly fast](https://github.com/mycoboco/beluga/issues/4), is correct enough\nto pass many complicated\n[test cases](https://github.com/mycoboco/beluga/tree/master/tst/cpp), produces\nhighly compact output and has rich diagnostics. For example, it catches, with\n`-Wtoken-paste-order` option, code that subtly depends on an unspecified\nevaluation order of the `##` operator like this:\n\n    #define concat(x, y, z) x ## y ## z\n    concat(3.14e, -, f)    /* non-portable */\n\nand, due to the line mapper shared by the compiler, it pinpoints problematic\nspots as precisely as possible:\n\n![range highlighting on sub-expression from macro expansion](http://code.woong.org/common/files/pp-20171025.png)\n\nThe current version conforms to C90, but supports features like empty arguments\nand [variadic macros](http://en.wikipedia.org/wiki/Variadic_macro) introduced\nin C99 and widely used now.\n\n\n#### Try it out\n\nYou can try them out on the `beluga`'s\n[web page](http://code.woong.org/beluga).\n\n\n#### How to install\n\n`INSTALL.md` explains how to build and install the package. For the copyright\nissues, see the accompanying `LICENSE.md` file.\n\n\n#### Contact\n\nIf you have a question or suggestion, do not hesitate to contact me via email\n(woong.jun at gmail.com) or web (http://code.woong.org/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmycoboco%2Fbeluga","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmycoboco%2Fbeluga","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmycoboco%2Fbeluga/lists"}