{"id":15627544,"url":"https://github.com/fornever/cesium","last_synced_at":"2026-04-02T17:07:22.705Z","repository":{"id":39622235,"uuid":"439656530","full_name":"ForNeVeR/Cesium","owner":"ForNeVeR","description":"C compiler for the CLI platform","archived":false,"fork":false,"pushed_at":"2025-04-30T15:18:03.000Z","size":2683,"stargazers_count":406,"open_issues_count":115,"forks_count":43,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-30T16:28:43.318Z","etag":null,"topics":["c","compiler","dotnet","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ForNeVeR.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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}},"created_at":"2021-12-18T16:00:27.000Z","updated_at":"2025-04-30T15:18:07.000Z","dependencies_parsed_at":"2022-07-10T14:00:22.769Z","dependency_job_id":"343ac0ca-c030-4b7d-b712-047b692102c6","html_url":"https://github.com/ForNeVeR/Cesium","commit_stats":{"total_commits":1267,"total_committers":34,"mean_commits":37.26470588235294,"dds":0.6045777426992897,"last_synced_commit":"d687d868c1c451ce0131f4a78e1c773db0f0561d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForNeVeR%2FCesium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForNeVeR%2FCesium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForNeVeR%2FCesium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ForNeVeR%2FCesium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ForNeVeR","download_url":"https://codeload.github.com/ForNeVeR/Cesium/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414493,"owners_count":22067271,"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":["c","compiler","dotnet","hacktoberfest"],"created_at":"2024-10-03T10:17:20.266Z","updated_at":"2026-04-02T17:07:22.699Z","avatar_url":"https://github.com/ForNeVeR.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: 2022-2026 Cesium contributors \u003chttps://github.com/ForNeVeR/Cesium\u003e\n\nSPDX-License-Identifier: MIT\n--\u003e\n\nCesium [![Status Enfer][status-enfer]][andivionian-status-classifier] \u003cimg src=\"docs/logo.svg\" width=\"48\" height=\"48\" align=\"right\"/\u003e\n======\n\nCesium is a fully managed C compiler for CLI platform (.NET).\n\n**What?** Cesium compiles standard C source code to a .NET assembly. No unmanaged/mixed mode (a-lá C++/CLI) code is generated; everything is fully managed (but may be unsafe).\n\n**Why?** C programs are very useful in the modern world and solve practical tasks. At the same time, deploying C code alongside .NET code may be tricky (especially if your application supports multiple platforms). Cesium is designed to resolve the problems of C code deployment, and lift it to the managed state (so it is cross-platform in the same way as the underlying CIL code it is compiled to).\n\nImplementation Status\n---------------------\n\n### TL;DR: is it ready for use?\n\nUnfortunately, not yet. You won't be able to use Cesium for anything useful today. Probably, you'll be able to start after [the next milestone][issue.next-milestone] is implemented. Stay tuned!\n\n### Sneak Peek\n\nCurrently, Cesium is able to compile a \"Hello, world\" C23 example to a .NET assembly:\n\n```c\n#include \u003cstdio.h\u003e\n\nint main(int argc, char *argv[])\n{\n    puts(\"Hello, world!\");\n    return 42;\n}\n```\n\nThe next milestone is [#61: sha1collisiondetection][issue.next-milestone], which is **80%** complete _(note that the progress estimation is preliminary and may be changed in either direction at any moment)_.\n\nInstallation\n------------\nCesium consists of different components, which could be installed separately.\n\n### Project Templates\nInstall the templates:\n```console\n$ dotnet new install Cesium.Templates\n```\n\nThen use:\n```\n$ dotnet new cesiumapp\n$ dotnet new cesiumlib\n```\n\nThe `cesiumapp` template will create a new application (executable), `cesiumlib` will create a library (a non-executable assembly).\n\nBoth templates integrate with MSBuild and are buildable using `dotnet build`. This is possible thanks to the [Cesium SDK][docs.msbuild-sdk]. Speaking of which…\n\n### Cesium SDK\nTo start working on a new project using Cesium.SDK, write a `.ceproj` file:\n```xml\n\u003cProject Sdk=\"Cesium.Sdk/[version]\"\u003e\n    \u003cPropertyGroup\u003e\n        \u003cTargetFramework\u003e[tfm]\u003c/TargetFramework\u003e\n        \u003cOutputType\u003eExe\u003c/OutputType\u003e\n        \u003cRollForward\u003eMajor\u003c/RollForward\u003e\n    \u003c/PropertyGroup\u003e\n\u003c/Project\u003e\n```\n\nReplace `[version]` with the Cesium SDK version you want to use, and `[tfm]` with the target framework of your program (e.g. `net6.0`).\n\nAnd add a `program.c` file (or any other `.c` and `.h` files) to the same folder.\n\nThis is essentially the same as what's contained in the corresponding project template.\n\nThen, build your project via\n```console\n$ dotnet build\n```\n\nAnd run it via\n```console\n$ dotnet run\n```\n\n### Compiler\nIf you want to install the compiler separately from the SDK, you have two options:\n1. Install the compiler as a [.NET global tool][dotnet.tools]:\n\n   ```console\n   $ dotnet tool install --global Cesium.Compiler\n   $ Cesium.Compiler --help\n   ```\n\n   (See the arguments and how to run the compiler below.)\n\n2. Install a self-contained version of Cesium for your platform: download the corresponding `Cesium.Compiler.Bundle.\u003cplatform\u003e.zip` from the [releases] page. Unpack and then use the `Cesium.Compiler(.exe)` executable file.\n\n   These platform-specific bundles provide [self-contained executables][dotnet.self-contained] for all the supported platforms, so they don't have a dependency on .NET runtime installed in the target environment.\n\nPackages\n--------\n\n| Package                    | Link                                                                                    |\n|----------------------------|-----------------------------------------------------------------------------------------|\n| **Cesium.Compiler.Bundle** | [![Cesium.Compiler.Bundle][badge.cesium.compiler.bundle]][nuget.cesium.compiler.bundle] |\n| **Cesium.Compiler**        | [![Cesium.Compiler][badge.cesium.compiler]][nuget.cesium.compiler]                      |\n| **Cesium.Runtime**         | [![Cesium.Runtime][badge.cesium.runtime]][nuget.cesium.runtime]                         |\n| **Cesium.Sdk**             | [![Cesium.Sdk][badge.cesium.sdk]][nuget.cesium.sdk]                                     |\n| **Cesium.Templates**       | [![Cesium.Templates][badge.cesium.templates]][nuget.cesium.templates]                   |\n\nCompiler Usage\n--------------\n```console\n$ Cesium.Compiler \u003clist of the input files\u003e --out \u003cpath to the output assembly\u003e [optional parameters go here]\n```\n\nFor run from sources, use `dotnet run --project Cesium.Compiler` in the repository root directory, followed by `--` and the same arguments.\n\nFor example, this will generate an assembly executable by .NET 6 or later, .NET Framework, or Mono:\n\n```console\n$ dotnet run --project Cesium.Compiler -- Cesium.Samples/minimal.c --out out.exe\n$ dotnet ./out.exe # run with .NET 6 or later\n$ ./out.exe # only on Windows, run with .NET Framework\n$ mono ./out.exe # run with Mono\n```\n\nAs inputs, Cesium accepts its own internal `.obj` file format produced by the `-c` option (see below), or standard C source files (normally kept with `.c` file extension, but anything else than `.obj` will be treated as C anyway).\n\n### Optional Parameters\n\n- `--framework \u003cframework\u003e`: specifies the target framework, defaults to `Net`\n  - `NetFramework` for .NET Framework\n  - `NetStandard` for .NET Standard\n  - `Net` for .NET 6 or later\n- `--arch \u003carchitecture-set\u003e`: specifies the [target architecture set][docs.architecture-sets], defaults to `Dynamic`. Possible values are:\n  - `Dynamic` (machine-independent, calculates pointer size and structure layout in runtime),\n  - `Bit32` (for 32-bit architectures),\n  - `Bit64` (for 64-bit architectures),\n  - `Wide` (machine-independent, uses 64-bit pointers even on 32-bit architectures).\n- `--modulekind \u003cmoduleKind\u003e`: specifies the output module kind; by default, it is autodetected from the output file extension\n  - `Dll`: gets detected from a `.dll` extension\n  - `Console`: gets detected from an `.exe` extension\n  - `Windows`: doesn't get detected, so it's only possible to select manually\n  - `NetModule`: is a rudiment from Cecil, not supported\n- `-c`: will produce a JSON-based object file imitation in the output file. This mode is supposed to be used when using Cesium compiler as a C compiler for an existing toolset\n- `--ast-dump`: prints the Abstract Syntax Tree (AST) of the output file. No output assembly is generated. For diagnostic use only.\n\nImplementation Dashboard\n------------------------\n\n- [ ] [C23 standard compatibility][issue.c23-standard]: poor\n    - [ ] [Preprocessor][issue.preprocessor]: about **30%** ready\n    - [ ] [Lexer][issue.lexer]: mostly works, but needs more tests and validation on its compliance\n    - [ ] [Parser][issue.parser]: supports about **25%** of the language syntax\n- [ ] **Compiler**\n    - [x] CIL code generator: basics are ready, new features get added\n    - [ ] [PDB support][issue.pdb]: none\n- [ ] [Standard library][stdlib]: a very few functions are supported\n- [ ] [.NET SDK][issue.sdk]: none (but planned!)\n\n**Have a question?** Welcome to [the discussions section][discussions]!\n\n**Looking to contribute?** Check [open issues with the \"help-wanted\" label][issues.help-wanted]. Cesium is a big project which lives thanks to its contributors.\n\n**Not sure where to contribute?** Check [open issues with the \"good first issue\" label][issues.good-first-issue].\n\nTake a look at [the contributor guide][docs.contributing].\n\nIf you're interested in certain project areas, check the per-area issue labels:\n- [`area:cil-interop`][issues.cil-interop]: issues related to CLI interop\n- [`area:compiler`][issues.compiler]: issues related to the Cesium compiler, type checker, and code analyzer\n- [`area:parser`][issues.parser]: issues related to C parsing\n- [`area:sdk`][issues.sdk]: issues related to the Cesium .NET SDK\n- [`area:standard-support`][issues.standard-support]: issues related to C23 standard support\n- [`area:stdlib`][issues.stdlib]: issues related to the standard library implementation\n\nDocumentation\n-------------\n\n- [C23 Language Standard Draft][c23-draft]\n\n- [Changelog][docs.changelog]\n- [Contributor Guide][docs.contributing]\n- [Cesium Tests][docs.tests]\n- [Cesium Type System][docs.type-system]\n- [Cesium SDK][docs.msbuild-sdk]\n- [Architecture Sets][docs.architecture-sets]\n- [CLI-Related Language Extensions][docs.language-extensions]\n- [Built-in Functions][docs.builtins]\n- [Exceptions in the Compiler Code][docs.exceptions]\n- [Design Notes][docs.design-notes]\n- [Maintainer Guide][docs.maintaining]\n\nLicense\n-------\nThe project's sources, except the project templates, are distributed under the terms of [the MIT license][docs.license.mit].\n\nThe project templates (from the directory `Cesium.Templates`) are distributed under the terms of [the CC-0 license][docs.license.cc0].\n\nThe license indication in the project's sources is compliant with the [REUSE specification v3.3][reuse.spec].\n\n[andivionian-status-classifier]: https://andivionian.fornever.me/v1/#status-enfer-\n[badge.cesium.compiler.bundle]: https://img.shields.io/nuget/v/Cesium.Compiler.Bundle\n[badge.cesium.compiler]: https://img.shields.io/nuget/v/Cesium.Compiler\n[badge.cesium.runtime]: https://img.shields.io/nuget/v/Cesium.Runtime\n[badge.cesium.sdk]: https://img.shields.io/nuget/v/Cesium.Sdk\n[badge.cesium.templates]: https://img.shields.io/nuget/v/Cesium.Templates\n[c23-draft]: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf\n[discussions]: https://github.com/ForNeVeR/Cesium/discussions\n[docs.architecture-sets]: docs/architecture-sets.md\n[docs.builtins]: docs/builtins.md\n[docs.changelog]: CHANGELOG.md\n[docs.contributing]: CONTRIBUTING.md\n[docs.design-notes]: docs/design-notes.md\n[docs.exceptions]: docs/exceptions.md\n[docs.language-extensions]: docs/language-extensions.md\n[docs.license.cc0]: LICENSES/CC0-1.0.txt\n[docs.license.mit]: LICENSE.md\n[docs.maintaining]: MAINTAINING.md\n[docs.msbuild-sdk]: docs/msbuild-sdk.md\n[docs.tests]: docs/tests.md\n[docs.type-system]: docs/type-system.md\n[dotnet.self-contained]: https://learn.microsoft.com/en-us/dotnet/core/deploying/\n[dotnet.tools]: https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools\n[issue.c23-standard]: https://github.com/ForNeVeR/Cesium/issues/62\n[issue.lexer]: https://github.com/ForNeVeR/Cesium/issues/76\n[issue.next-milestone]: https://github.com/ForNeVeR/Cesium/issues/61\n[issue.parser]: https://github.com/ForNeVeR/Cesium/issues/78\n[issue.pdb]: https://github.com/ForNeVeR/Cesium/issues/79\n[issue.preprocessor]: https://github.com/ForNeVeR/Cesium/issues/77\n[issue.sdk]: https://github.com/ForNeVeR/Cesium/issues/80\n[issues.cil-interop]: https://github.com/ForNeVeR/Cesium/labels/area%3Acil-interop\n[issues.compiler]: https://github.com/ForNeVeR/Cesium/labels/area%3Acompiler\n[issues.good-first-issue]: https://github.com/ForNeVeR/Cesium/labels/good-first-issue\n[issues.help-wanted]: https://github.com/ForNeVeR/Cesium/labels/status%3Ahelp-wanted\n[issues.parser]: https://github.com/ForNeVeR/Cesium/labels/area%3Aparser\n[issues.preprocessor]: https://github.com/ForNeVeR/Cesium/labels/area%3Apreprocessor\n[issues.sdk]: https://github.com/ForNeVeR/Cesium/labels/area%3Asdk\n[issues.standard-support]: https://github.com/ForNeVeR/Cesium/labels/area%3Astandard-support\n[issues.stdlib]: https://github.com/ForNeVeR/Cesium/labels/area%3Astdlib\n[nuget.cesium.compiler.bundle]: https://www.nuget.org/packages/Cesium.Compiler.Bundle\n[nuget.cesium.compiler]: https://www.nuget.org/packages/Cesium.Compiler\n[nuget.cesium.runtime]: https://www.nuget.org/packages/Cesium.Runtime\n[nuget.cesium.sdk]: https://www.nuget.org/packages/Cesium.Sdk\n[nuget.cesium.templates]: https://www.nuget.org/packages/Cesium.Templates\n[releases]: https://github.com/ForNeVeR/Cesium/releases\n[reuse.spec]: https://reuse.software/spec-3.3/\n[status-enfer]: https://img.shields.io/badge/status-enfer-orange.svg\n[stdlib]: Cesium.Compiler/stdlib\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffornever%2Fcesium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffornever%2Fcesium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffornever%2Fcesium/lists"}