{"id":21421978,"url":"https://github.com/c272/cobalt","last_synced_at":"2025-07-08T14:06:48.686Z","repository":{"id":243444569,"uuid":"762843926","full_name":"c272/cobalt","owner":"c272","description":"An optimising COBOL compiler, built on modern code generation in Rust.","archived":false,"fork":false,"pushed_at":"2024-06-04T12:42:57.000Z","size":234,"stargazers_count":2,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T00:46:57.202Z","etag":null,"topics":["cobol","compiler","compiler-frontend","cranelift","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/c272.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}},"created_at":"2024-02-24T21:01:43.000Z","updated_at":"2025-06-21T22:05:49.000Z","dependencies_parsed_at":"2024-06-09T00:22:19.267Z","dependency_job_id":"463ee36a-dcd5-4098-8450-69cb8941cae0","html_url":"https://github.com/c272/cobalt","commit_stats":null,"previous_names":["c272/cobalt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/c272/cobalt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c272%2Fcobalt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c272%2Fcobalt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c272%2Fcobalt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c272%2Fcobalt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c272","download_url":"https://codeload.github.com/c272/cobalt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c272%2Fcobalt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264284267,"owners_count":23584672,"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":["cobol","compiler","compiler-frontend","cranelift","rust"],"created_at":"2024-11-22T20:41:09.017Z","updated_at":"2025-07-08T14:06:48.659Z","avatar_url":"https://github.com/c272.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"logo.png\" width=\"500\"/\u003e\n\n*An experimental COBOL compiler, written in Rust.*\n\u003c/div\u003e\n\n## Overview\n\n\u003e 🚧 **This project is experimental and not ready for production use. Read the [disclaimer](#disclaimer) for more details.** 🚧\n\nCobalt is an experimental COBOL compiler targeting x86 and aarch64 Linux systems, providing blazing fast compile times and runtime performance. Some key features include:\n\n* Built on Rust and Cranelift for fast modern code generation.\n* Small, efficient output binaries.\n* Security by default, utilising hardware features such as PAC+BTI/Intel CET where available. \n* Supports alternative linkers such as `gold` and `mold` for link-time performance.\n\nFor a peek inside the internals of Cobalt, see this project's [documentation](). A basic usage outline and performance comparison can be found below.\n\n\n## Building\nThis project depends on the presence of a Rust toolchain, with an MSRV of 1.76. The build process may also install the `rust-src` toolchain component, if not already present.\n\nTo build the compiler in release mode, simply run the following:\n\n```sh\ngit clone git@github.com:c272/cobalt.git\ncd cobalt \u0026\u0026 ./build.sh release\n```\n\nBuild artifacts for the project can be found in the `./build` directory. For testing debug builds during development of the compiler, the \"run\" and \"clean\" utilities may also be useful, for example:\n\n```sh\n# Build and execute an example with all opts.\n./run.sh build examples/algorithms/primality.cobol -O speed_and_size\n./out/primality\n\n# Clean up any compiler build artifacts.\n./clean.sh\n```\n\n## Usage\n```\nBuilds a single COBOL file.\n\nUsage: cobalt build [OPTIONS] \u003cFILE\u003e\n\nArguments:\n  \u003cFILE\u003e  The file to build\n\nOptions:\n  -o, --output-name \u003cOUTPUT_NAME\u003e  The name of the output executable. By default, the primary input file name with extensions removed\n  -d, --output-dir \u003cDIR\u003e           The output directory to save to. By default, `./out`\n  -v, --verbose...                 Set the verbosity of compiler output. Can be specified multiple times\n  -O, --opt-level \u003cOPT_LEVEL\u003e      The optimisation level to compile the provided code at. By default, optimises for compile speed (no optimisations) [possible values: none, speed, speed_and_size]\n  -p, --prefer-platform-linker     Actively selects the platform linker over other available linkers\n      --disable-security-features  Disables the generation of instructions utilising hardware security features within output binaries (e.g. PAC/BTI on aarch64)\n  -h, --help                       Print help\n```\n\n## Benchmarks\nA basic set of benchmarks are available in this repository for testing performance against a baseline solution (GnuCobol). These can be run through the `benchmarking` crate, which requires the following additional dependencies:\n\n* When comparing against GnuCobol, `cobc` in PATH. \n* When comparing against GnuCobol+clang, `clang` in PATH.\n\nResults from benchmarking runs can be found, by default, within the `./bench_out` directory as JSON files. For documentation on the structure of these output files, as well as how benchmark TOML files are formatted, view the [`bench` crate documentation]().\n\nSome example uses of the benchmarking suite can be seen below:\n\n```sh\n# Display a manual page for the benchmarking tool.\n./benchmark.sh --help\n\n# Execute all benchmarks with no comparisons, all opts.\n./benchmark.sh -O speed_and_size\n\n# Execute a specific benchmark TOML file.\n./benchmark.sh --ignore-default --benchmarks ./benchmarks/foo.toml\n\n# Compare all against `cobc` performance, all opts.\n./benchmark.sh --run-cobc -O speed_and_size -C 3\n\n# Compare against `cobc`+`clang`, build performance only.\n./benchmark.sh --run-cobc --run-clang --build-only\n```\n\n## Disclaimer\nThis compiler is experimental and feature incomplete, only supporting a minimal set of the COBOL specification. In addition, the only format supported for parity is GnuCobol's `-free` format.\n\nIn accordance, this compiler is not intended for production use and should not be used as such. No support is provided for production use cases.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc272%2Fcobalt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc272%2Fcobalt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc272%2Fcobalt/lists"}