{"id":13606847,"url":"https://github.com/c3lang/c3c","last_synced_at":"2026-06-06T23:01:37.689Z","repository":{"id":36401143,"uuid":"199931048","full_name":"c3lang/c3c","owner":"c3lang","description":"Compiler for the C3 language","archived":false,"fork":false,"pushed_at":"2026-06-03T09:36:38.000Z","size":42218,"stargazers_count":5515,"open_issues_count":157,"forks_count":372,"subscribers_count":42,"default_branch":"master","last_synced_at":"2026-06-03T10:25:14.814Z","etag":null,"topics":["c3","compiler","language"],"latest_commit_sha":null,"homepage":"https://c3-lang.org","language":"C3","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/c3lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":["c3lang"],"patreon":null,"open_collective":null,"ko_fi":"c3lang","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"polar":null,"custom":null}},"created_at":"2019-07-31T21:24:37.000Z","updated_at":"2026-06-03T09:16:13.000Z","dependencies_parsed_at":"2026-03-06T03:03:18.405Z","dependency_job_id":null,"html_url":"https://github.com/c3lang/c3c","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/c3lang/c3c","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c3lang%2Fc3c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c3lang%2Fc3c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c3lang%2Fc3c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c3lang%2Fc3c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c3lang","download_url":"https://codeload.github.com/c3lang/c3c/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c3lang%2Fc3c/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34002561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"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":["c3","compiler","language"],"created_at":"2024-08-01T19:01:12.971Z","updated_at":"2026-06-06T23:01:37.672Z","avatar_url":"https://github.com/c3lang.png","language":"C3","funding_links":["https://github.com/sponsors/c3lang","https://ko-fi.com/c3lang"],"categories":["C","Uncategorized","C3","\u003ca name=\"C\"\u003e\u003c/a\u003eC"],"sub_categories":["Uncategorized"],"readme":"# C3 Language\n\u003cimg src=\"https://c3-lang.org/assets/logo.svg\" align=\"right\" height=\"120\" /\u003e\n\nC3 is a programming language that builds on the syntax and semantics of the C language,\nwith the goal of evolving it while still retaining familiarity for C programmers.\n\nIt's an evolution, not a revolution: the C-like\nfor programmers who like C.\n\nPrecompiled binaries for the following operating systems are available:\n\n- Windows x64 [download](https://github.com/c3lang/c3c/releases/latest/download/c3-windows.zip), [install instructions](#windows).\n- Linux x64 [download](https://github.com/c3lang/c3c/releases/latest/download/c3-linux-static.tar.gz), [install instructions](#linux).\n- MacOS Arm64 [download](https://github.com/c3lang/c3c/releases/latest/download/c3-macos.zip), [install instructions](#macos).\n- OpenBSD x64 [download](https://github.com/c3lang/c3c/releases/latest/download/c3-openbsd.tar.gz), [install instructions](#openbsd).\n\nTo build the compiler from source instead, see the [instructions for building C3 from source](#building-c3-from-source).\n\n\u003ch3 align=\"center\"\u003e\u003ca href=\"https://c3-lang.org\"\u003e[Read the C3 Manual]\u003c/a\u003e\u003c/h3\u003e\n\n---\n\n\u003cimg src=\"https://github.com/c3lang/c3c/blob/master/resources/images/vkQuake.png?raw=true\" align=\"right\" hspace=\"50\" alt=\"vkQuake\"\u003e\n\n\u003e [!NOTE]\n\u003e Thanks to full ABI compatibility with C, it's possible to mix C and C3 in the same project with no effort.\n\u003e As a demonstration, vkQuake was compiled with a small portion of the code converted to C3 and compiled with the c3c compiler.\n\u003e (The aging fork can be found at https://github.com/c3lang/vkQuake)\n\u003cbr clear=\"all\"\u003e\n\nA non-curated list of user written projects and other resources can be found [here](https://github.com/c3lang/c3-showcase).\n\n---\n\n### Design Principles\n- Procedural \"get things done\"-type of language.\n- Try to stay close to C - only change what's really necessary.\n- C ABI compatibility and excellent C integration.\n- Learning C3 should be easy for a C programmer.\n- Data is inert.\n- Avoid \"big ideas\" \u0026 the \"more is better\" fallacy.\n- Introduce some higher level conveniences where the value is great.\n\nC3 owes its inspiration to the [C2 language](http://c2lang.org): to iterate on top of C without trying to be a\nwhole new language.\n\n### Example code\n\nThe following code shows [generics](https://c3-lang.org/generic-programming/generics/) (more examples can be found at https://c3-lang.org/language-overview/examples/).\n\n```c3\nmodule stack \u003cType\u003e;\n// Above: the parameterized type is applied to the entire module.\n\nstruct Stack\n{\n    usz capacity;\n    usz size;\n    Type* elems;\n}\n\n// The type methods offers dot syntax calls,\n// so this function can either be called\n// Stack.push(\u0026my_stack, ...) or\n// my_stack.push(...)\nfn void Stack.push(Stack* this, Type element)\n{\n    if (this.capacity == this.size)\n    {\n        this.capacity *= 2;\n        if (this.capacity \u003c 16) this.capacity = 16;\n        this.elems = realloc(this.elems, Type.sizeof * this.capacity);\n    }\n    this.elems[this.size++] = element;\n}\n\nfn Type Stack.pop(Stack* this)\n{\n    assert(this.size \u003e 0);\n    return this.elems[--this.size];\n}\n\nfn bool Stack.empty(Stack* this)\n{\n    return !this.size;\n}\n```\n\nTesting it out:\n\n```c3\nimport stack;\n\n// Define our new types, the first will implicitly create\n// a complete copy of the entire Stack module with \"Type\" set to \"int\"\nalias IntStack = Stack {int};\n// The second creates another copy with \"Type\" set to \"double\"\nalias DoubleStack = Stack {double};\n\n// If we had added \"alias IntStack2 = Stack {int}\"\n// no additional copy would have been made (since we already\n// have an parameterization of Stack {int} so it would\n// be same as declaring IntStack2 an alias of IntStack\n\n// Importing an external C function is straightforward\n// here is an example of importing libc's printf:\nextern fn int printf(char* format, ...);\n\nfn void main()\n{\n    IntStack stack;\n    // Note that C3 uses zero initialization by default\n    // so the above is equivalent to IntStack stack = {};\n\n    stack.push(1);\n    // The above can also be written IntStack.push(\u0026stack, 1);\n\n    stack.push(2);\n\n    // Prints pop: 2\n    printf(\"pop: %d\\n\", stack.pop());\n    // Prints pop: 1\n    printf(\"pop: %d\\n\", stack.pop());\n\n    DoubleStack dstack;\n    dstack.push(2.3);\n    dstack.push(3.141);\n    dstack.push(1.1235);\n    // Prints pop: 1.123500\n    printf(\"pop: %f\\n\", dstack.pop());\n}\n```\n\n### In what ways does C3 differ from C?\n\n- No mandatory header files\n- New semantic macro system\n- Module based name spacing\n- Slices\n- Operator overloading\n- Compile time reflection\n- Enhanced compile time execution\n- Generics based on generic modules\n- \"Result\"-based zero overhead error handling\n- Defer\n- Value methods\n- Associated enum data\n- No preprocessor\n- Less undefined behaviour and added runtime checks in \"safe\" mode\n- Limited operator overloading to enable userland dynamic arrays\n- Optional pre and post conditions\n\n### Current status\n\nThe current stable version of the compiler is **version 0.8.0**.\n\nThe upcoming 0.8.1 release will further refine the standard library.\nFollow the issues [here](https://github.com/c3lang/c3c/issues).\n\nIf you have suggestions on how to improve the language, either [file an issue](https://github.com/c3lang/c3c/issues)\nor discuss C3 on its dedicated Discord: [https://discord.gg/qN76R87](https://discord.gg/qN76R87).\n\nThe compiler is currently verified to compile on Windows, MacOS, Linux, OpenBSD, NetBSD.\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eSupport matrix\u003c/b\u003e\u003c/summary\u003e\n\n| Platform                 | Native C3 compiler available? | Target supported        | Stack trace | Threads  | Sockets  | Inline asm |\n|--------------------------|-------------------------------|-------------------------|-------------|----------|----------|------------|\n| Win32 x64                | Yes                           | Yes + cross compilation | Yes         | Yes      | Yes      | Yes*       |\n| Win32 Aarch64            | Untested                      | Untested                | Untested    | Untested | Untested | Yes*       |\n| MacOS x64                | Yes                           | Yes + cross compilation | Yes         | Yes      | Yes      | Yes*       |\n| MacOS Aarch64            | Yes                           | Yes + cross compilation | Yes         | Yes      | Yes      | Yes*       |\n| iOS Aarch64              | No                            | Untested                | Untested    | Yes      | Yes      | Yes*       |\n| Android Aarch64          | No                            | Untested                | Untested    | Untested | Untested | Yes*       |\n| Android x64              | No                            | Untested                | Untested    | Untested | Untested | Yes*       |\n| Linux x86                | Yes                           | Yes                     | Yes         | Yes      | Yes      | Yes*       |\n| Linux x64                | Yes                           | Yes                     | Yes         | Yes      | Yes      | Yes*       |\n| Linux Aarch64            | Yes                           | Yes                     | Yes         | Yes      | Yes      | Yes*       |\n| Linux Riscv32            | Yes                           | Yes                     | Yes         | Yes      | Yes      | Untested   |\n| Linux Riscv64            | Yes                           | Yes                     | Yes         | Yes      | Yes      | Untested   |\n| ELF freestanding x86     | No                            | Untested                | No          | No       | No       | Yes*       |\n| ELF freestanding x64     | No                            | Untested                | No          | No       | No       | Yes*       |\n| ELF freestanding Aarch64 | No                            | Untested                | No          | No       | No       | Yes*       |\n| ELF freestanding Riscv64 | No                            | Untested                | No          | No       | No       | Untested   |\n| ELF freestanding Riscv32 | No                            | Untested                | No          | No       | No       | Untested   |\n| ELF freestanding Xtensa* | No                            | Untested                | No          | No       | No       | Untested   |\n| FreeBSD x86              | Untested                      | Untested                | No          | Yes      | Untested | Yes*       |\n| FreeBSD x64              | Untested                      | Untested                | No          | Yes      | Untested | Yes*       |\n| NetBSD x86               | Untested                      | Untested                | No          | Yes      | Untested | Yes*       |\n| NetBSD x64               | Untested                      | Untested                | No          | Yes      | Untested | Yes*       |\n| OpenBSD x86              | Untested                      | Untested                | No          | Yes      | Untested | Yes*       |\n| OpenBSD x64              | Yes*                          | Yes                     | Yes*        | Yes      | Untested | Yes*       |\n| MCU x86                  | No                            | Untested                | No          | No       | No       | Yes*       |\n| Wasm32                   | No                            | Yes                     | No          | No       | No       | No         |\n| Wasm64                   | No                            | Untested                | No          | No       | No       | No         |\n\n*\\* Inline asm is still a work in progress*\u003cbr\u003e\n*\\* OpenBSD 7.8 is the only tested version*\u003cbr\u003e\n*\\* OpenBSD has limited stacktrace, needs to be tested further*\u003cbr\u003e\n*\\* Xtensa support is enabled by compiling with `-DXTENSA_ENABLE`. The [espressif llvm fork](https://github.com/espressif/llvm-project) is recommended for best compatibility*\n\nMore platforms will be supported in the future.\n\u003c/details\u003e\n\n#### What can you help with?\n\n- If you wish to contribute with ideas, please file issues or discuss on Discord.\n- Interested in contributing to the stdlib? Please get in touch on Discord.\n- Compilation instructions for other Linux and Unix variants are appreciated.\n- Would you like to contribute bindings to some library? It would be nice to have support for SDL3 and more. If you have created some bindings, please submit them to https://github.com/c3lang/vendor.\n- Build something with C3 and show it off and give feedback. The language is still open for significant tweaks.\n- Start work on the C -\u003e C3 converter which takes C code and does a \"best effort\" to translate it to C3. The first version only needs to work on C headers.\n- Do you have some specific area you have deep knowledge of and could help make C3 even better at doing? File or comment on issues.\n\n---\n\n## Installing\n\nThe instructions below install the latest stable release. If you wish to use the bleeding-edge nightly build instead, you can download the [latest prerelease binaries here](https://github.com/c3lang/c3c/releases/tag/latest-prerelease-tag).\n\n#### Windows\n\n**Precompiled binaries**\n1. Download the zip file: [https://github.com/c3lang/c3c/releases/latest/download/c3-windows.zip](https://github.com/c3lang/c3c/releases/latest/download/c3-windows.zip)\n   (debug version [here](https://github.com/c3lang/c3c/releases/latest/download/c3-windows-debug.zip))\n2. Unzip exe and standard lib.\n3. Run `c3c.exe`.\n\n**Install script**\n\nOpen a PowerShell terminal (you may need to run it as an administrator) and run the following command:\n```bash\niwr -useb https://raw.githubusercontent.com/c3lang/c3c/refs/heads/master/install/install.ps1 | iex\n```\nThe script will inform you once the installation is successful and add the `~/.c3` directory to your PATH, which will allow you to run the c3c command from any location.\n\nYou can choose another version with option `C3_VERSION`.\nFor example, you can force the installation of the 0.7.11 version:\n```bash\n$env:C3_VERSION='0.7.11'; powershell -ExecutionPolicy Bypass -Command \"iwr -useb https://raw.githubusercontent.com/c3lang/c3c/refs/heads/master/install/install.ps1 | iex\"\n```\n\n**(Optional)** If you don't have Visual Studio 17 installed, you can run the `c3c fetch windows-sdk` command which will download the necessary files to compile on Windows.\n\n**Scoop**\n\nc3c is included in the 'Main' bucket.\n\n```sh\nscoop install c3\n```\n\n---\n\n#### Linux\n\n**Precompiled binaries**\n1. Download tar file: [https://github.com/c3lang/c3c/releases/latest/download/c3-linux-static.tar.gz](https://github.com/c3lang/c3c/releases/latest/download/c3-linux-static.tar.gz)\n   (debug version [here](https://github.com/c3lang/c3c/releases/latest/download/c3-linux-static-debug.tar.gz))\n2. Unpack executable and standard lib.\n3. Run `./c3c`.\n\n**Install script**\n\nOpen a terminal and run the following command:\n```bash\ncurl -fsSL https://raw.githubusercontent.com/c3lang/c3c/refs/heads/master/install/install.sh | bash\n```\nThe C3 compiler will be installed, and the script will also update your ~/.bashrc to include `~/.c3` in your PATH, allowing you to invoke the c3c command from anywhere. You might need to restart your terminal or source your shell for the changes to take effect.\n\nYou can choose another version with option `C3_VERSION`.\nFor example, you can force the installation of the 0.7.11 version:\n```bash\ncurl -fsSL https://raw.githubusercontent.com/c3lang/c3c/refs/heads/master/install/install.sh | C3_VERSION=0.7.11 bash\n```\n\n**Arch Linux**\n\nArch includes c3c in the official 'extra' repo. It can be easily installed the usual way:\n\n```sh\nsudo pacman -S c3c\n# or paru -S c3c\n# or yay -S c3c\n# or aura -A c3c\n```\n\nThere is also an AUR package for the c3c compiler : [c3c-git](https://aur.archlinux.org/packages/c3c-git).\n\nYou can use your AUR package manager:\n```sh\nparu -S c3c-git\n# or yay -S c3c-git\n# or aura -A c3c-git\n```\n\nOr clone it manually:\n```sh\ngit clone https://aur.archlinux.org/c3c-git.git\ncd c3c-git\nmakepkg -si\n```\n\n**Fedora**\n\nC3 is available as a community maintained COPR package for Fedora.  \nTo install via dnf:\n```sh\nsudo dnf copr enable sisyphus1813/c3\nsudo dnf install c3\n```\n\n**NixOS / Nix**\n\nYou can access `c3c` via [flake.nix](./flake.nix), which will contain the latest commit of the compiler. To add `c3c` to your `flake.nix`, do the following:\n\n\u003cdetails\u003e\u003csummary\u003eflake.nix example\u003c/summary\u003e\n\n```nix\n{\n  inputs = {\n    nixpkgs.url = \"github:nixos/nixpkgs?ref=nixpkgs-unstable\";\n    flake-utils.url = \"github:numtide/flake-utils\";\n    c3c.url = \"github:c3lang/c3c\";\n    # Those are desired if you don't want to copy extra nixpkgs\n    c3c.inputs = {\n      nixpkgs.follows = \"nixpkgs\";\n      flake-utils.follows = \"flake-utils\";\n    };\n  };\n\n  outputs = { self, ... } @ inputs: inputs.flake-utils.lib.eachDefaultSystem (system:\n    let\n      pkgs = import inputs.nixpkgs { inherit system; };\n      c3c = inputs.c3c.packages.${system}.c3c;\n    in\n    {\n      devShells.default = pkgs.mkShell {\n        buildInputs = [\n          pkgs.c3c\n        ];\n      };\n    }\n  );\n}\n```\n\u003c/details\u003e\n\n\n**Gentoo**\n\n`c3c` is available in the [Gentoo GURU overlay](https://wiki.gentoo.org/wiki/Project:GURU).\n\nEnable and sync the GURU repository (if not already done):\n\n```sh\nsudo eselect repository enable guru\nsudo emaint sync -r guru\n```\n\nInstall `c3c` with:\n\n```sh\nsudo emerge -av dev-lang/c3c\n```\n\n* The compiler binary is installed to `/usr/bin/c3c`.\n* The standard library is installed to `/usr/lib/c3`.\n\nFor Gentoo-specific issues, please use the [Gentoo Bugzilla](https://bugs.gentoo.org/) (Product: *GURU*).\n\n\n---\n\n#### MacOS\n\n**Precompiled binaries**\n1. Make sure you have XCode with command line tools installed.\n2. Download the zip file: [https://github.com/c3lang/c3c/releases/latest/download/c3-macos.zip](https://github.com/c3lang/c3c/releases/latest/download/c3-macos.zip)\n   (debug version [here](https://github.com/c3lang/c3c/releases/latest/download/c3-macos-debug.zip))\n3. Unzip executable and standard lib.\n4. Because it is not signed, you need to approve it: `xattr -d com.apple.quarantine c3c`\n5. Run `./c3c`.\n\n(*Note that there is a known issue with debug symbol generation on MacOS 13, see [issue #1086](https://github.com/c3lang/c3c/issues/1086))\n\n---\n\n#### OpenBSD\n\n**Precompiled binaries**\n1. Download tar file: [https://github.com/c3lang/c3c/releases/latest/download/c3-openbsd.tar.gz](https://github.com/c3lang/c3c/releases/latest/download/c3-openbsd.tar.gz)\n   (debug version [here](https://github.com/c3lang/c3c/releases/latest/download/c3-openbsd-debug.tar.gz))\n2. Unpack executable and standard lib.\n3. Run `./c3c`.\n\n(*Note that this is specifically for OpenBSD 7.8, running it on any other version is prone to ABI breaks)\n\n---\n\n#### Docker\n\nYou can build `c3c` using an Ubuntu container. By default, the script will build through Ubuntu 22.04. You can specify the version by passing the `UBUNTU_VERSION` environment variable.\n\n```\nUBUNTU_VERSION=20.04 ./build-with-docker.sh\n```\n\nSee the `build-with-docker.sh` script for more information on other configurable environment variables.\n\n#### Getting started with a \"hello world\"\n\nCreate a `main.c3` file with:\n```c3\nmodule hello_world;\nimport std::io;\n\nfn void main()\n{\n   io::printn(\"Hello, world!\");\n}\n```\n\nMake sure you have the standard libraries at either `../lib/std/` or `/lib/std/`.\n\nThen run\n```sh\nc3c compile main.c3\n```\n\nThe generated binary will by default be named after the module that contains the main\nfunction. In our case that is `hello_world`, so the resulting binary will be\ncalled `hello_world` or `hello_world.exe`depending on platform.\n\n## Building C3 from Source\n\n#### Compiling on MacOS\n\n1. Install [Homebrew](https://brew.sh/)\n2. Install CMake: `brew install cmake`\n3. Clone the C3C github repository: `git clone https://github.com/c3lang/c3c.git`\n4. Enter the C3C directory `cd c3c`.\n5. Set up CMake build: `cmake -B build -S . -DC3_FETCH_LLVM=ON`\n6. Build: `cmake --build build`\n7. Change directory to the build directory `cd build`\n\n#### Compiling on Windows\n\n1. Make sure you have Visual Studio 17 2022 installed or alternatively install the \"Buildtools for Visual Studio\" (https://aka.ms/vs/17/release/vs_BuildTools.exe) and then select \"Desktop development with C++\"\n2. Install CMake\n3. Clone the C3C github repository: `git clone https://github.com/c3lang/c3c.git`\n4. Enter the C3C directory: `cd c3c`.\n5. Set up the CMake build: `cmake --preset windows-vs-2022-release -D C3_FETCH_LLVM=ON`\n6. Build: `cmake --build --preset windows-vs-2022-release`\n\nYou should now have a `c3c` executable in `build\\Release`.\n\nYou can try it out by running some sample code: `c3c.exe compile ../../resources/examples/hash.c3`\n\nBuilding `c3c` using Visual Studio Code is also supported when using the `CMake Tools` extension. Simply select the `Windows x64 Visual Studio 17 2022` configure preset and build.\n\n*Note that if you run into linking issues when building, make sure that you are using the latest version of VS17.*\n\n\u003e [!NOTE]\n\u003e **Debug Build:**\n\u003e To avoid LLVM library conflicts, configure and build using the debug preset instead:\n\u003e ```bash\n\u003e cmake --preset windows-vs-2022-debug -D C3_FETCH_LLVM=ON\n\u003e cmake --build --preset windows-vs-2022-debug\n\u003e ```\n\u003e *(Your executable will be located in `build-debug\\Debug`)*\n\n#### Compiling on Linux\n\n1. Install required build dependencies using your distribution's package manager:\n   - **Ubuntu / Debian:** `sudo apt-get install cmake git clang libcurl4-openssl-dev`\n   - **Fedora:** `sudo dnf install cmake clang git libcurl-devel`\n   - **Arch Linux:** `sudo pacman -S curl clang cmake git`\n   - **Void Linux:** `sudo xbps-install git cmake clang libcurl-devel`\n   - *Other distributions: Install CMake, Git, a C compiler (like Clang), and libcurl development headers.*\n\n2. Clone the C3C repository and enter the directory:\n   ```bash\n   git clone https://github.com/c3lang/c3c.git\n   cd c3c\n   ```\n   *(If you only need the latest commit, add `--depth=1` to the clone command)*\n\n3. Create the CMake build cache:\n   ```bash\n   cmake -B build -S . -DC3_FETCH_LLVM=ON -DCMAKE_BUILD_TYPE=Release\n   ```\n\n4. Build the compiler:\n   ```bash\n   cmake --build build\n   ```\n\n5. You should now have a `c3c` executable in the `build` directory. You can test it by compiling an example:\n   ```bash\n   ./build/c3c compile resources/examples/hash.c3\n   ```\n\n   *(Optional) To install the compiler globally: `sudo cmake --install build`*\n\n#### Compiling on NixOS\n\n1. Enter nix shell, by typing `nix develop` in root directory\n2. Configure cmake via `cmake . -Bbuild $=C3_CMAKE_FLAGS`. Note: passing `C3_CMAKE_FLAGS` is needed to generate `compile_commands.json` and find missing libs.\n3. Build it `cmake --build build`\n4. Test it out: `./build/c3c -V`\n5. If you use `clangd` lsp server for your editor, it is recommended to make a symbolic link to `compile_command.json` in the root: `ln -s ./build/compile_commands.json compile_commands.json`\n\n*A note on compiling for Linux/Unix/MacOS: to be able to [fetch vendor libraries](# \"`c3c vendor-fetch` will list easily downloadable bindings. For example: `c3c vendor-fetch raylib`\")\nlibcurl is needed. The CMake script should detect it if it is available. Note that\nthis functionality is non-essential and it is perfectly fine to use the compiler without it.*\n\n#### Licensing\n\nUnless specified otherwise, the code in this repository is MIT licensed.\nThe exception is the compiler source code (the source code under `src`),\nwhich is licensed under LGPL 3.0.\n\nThis means you are free to use all parts of standard library,\ntests, benchmarks, grammar, examples and so on under the MIT license, including\nusing those libraries and tests if you build your own C3 compiler.\n\n#### Editor plugins\n\nEditor plugins can be found at https://github.com/c3lang/editor-plugins.\n\n#### Contributing unit tests\n\n1. Write the test, either adding to existing test files in `/test/unit/` or add\n   a new file. (If testing the standard library, put it in the `/test/unit/stdlib/` subdirectory).\n2. Make sure that the test functions have the `@test` attribute.\n3. Run tests and see that they pass. (Recommended settings: `c3c compile-test -O0 test/unit`.\n   - in this example `test/unit/` is the relative path to the test directory, so adjust as required)\n4. Make a pull request for the new tests.\n\n## Thank yous\n\nA huge **THANK YOU** goes out to all contributors and sponsors.\n\nA special thank you to sponsors [Zack Puhl](https://github.com/NotsoanoNimus) and [konimarti](https://github.com/konimarti) for going the extra mile.\n\nAnd honorable mention goes to past sponsors:\n[Ygor Pontelo](https://github.com/ygorpontelo), [Simone Raimondi](https://github.com/SRaimondi),\n[Jan Válek](https://github.com/jan-valek), [Pierre Curto](https://github.com/pierrec),\n[Caleb-o](https://github.com/Caleb-o) and [devdad](https://github.com/devdad)\n\n## Star History\n\n\u003ca href=\"https://www.star-history.com/?repos=c3lang%2Fc3c\u0026type=date\u0026legend=top-left\"\u003e\n \u003cpicture\u003e\n   \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=c3lang/c3c\u0026type=date\u0026theme=dark\u0026legend=top-left\" /\u003e\n   \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=c3lang/c3c\u0026type=date\u0026legend=top-left\" /\u003e\n   \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=c3lang/c3c\u0026type=date\u0026legend=top-left\" /\u003e\n \u003c/picture\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc3lang%2Fc3c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc3lang%2Fc3c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc3lang%2Fc3c/lists"}