# oksolc: a Solidity compiler in Zig that targets solc 0.8.36 to 0.8.39

**URL:** <https://forum.soliditylang.org/t/oksolc-a-solidity-compiler-in-zig-that-targets-solc-0-8-36-to-0-8-39/3794>\
**Category:** Tools & Infrastructure\
**Created:** [November 27, 2026, 12:19am UTC](https://forum.soliditylang.org/t/oksolc-a-solidity-compiler-in-zig-that-targets-solc-0-8-36-to-0-8-39/3794 "2026-11-27T00:19:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![0xthiru](https://avatars.discourse-cdn.com/v4/letter/0/7feea3/32.png) [@0xthiru](https://forum.soliditylang.org/u/0xthiru)\
**Post date:** [November 27, 2026, 12:19am UTC](https://forum.soliditylang.org/t/oksolc-a-solidity-compiler-in-zig-that-targets-solc-0-8-36-to-0-8-39/3794/1 "2026-11-27T00:19:23Z")

</div>

oksolc is a Solidity compiler written in Zig. It accepts the same Standard JSON input as solc, and the supported path is optimized via-IR. I work at OKcontract, the team that wrote it.

Repo: [GitHub - okcontract/oksolc: A Solidity compiler written in Zig. Reduces compilation time 10 to 50x and still targets byte-for-byte compatibility with solc · GitHub](https://github.com/okcontract/oksolc)

oksolc 0.2.5 added a `--solc-version` flag. The selected release controls pragma checks, code generation, diagnostics and metadata. The default is solc 0.8.39.

I compiled the 14 projects bundled with the oksolc benchmark on both compilers for solc 0.8.37, 0.8.38 and 0.8.39. The complete Standard JSON output was the same every time.

The solc 0.8.36 target can differ from solc 0.8.36. oksolc keeps the four via-IR fixes (`SOL-2026-4`, `SOL-2026-6`, `SOL-2026-7`, `SOL-2026-8`) on every target, and it generates separate constant helpers for checked and unchecked arithmetic. In the README’s test that changed the bytecode on 2 of 15 workloads: Sablier v2 and a 2022 Uniswap v4 fixture. The README lists every intentional exception:

> **[GitHub - okcontract/oksolc: A Solidity compiler written in Zig. Reduces...](https://github.com/okcontract/oksolc#status-and-compatibility)**
>
> A Solidity compiler written in Zig. Reduces compilation time 10 to 50x and still targets byte-for-byte compatibility with solc

On build time, with 4 jobs oksolc was 3.3 to 6.0 times faster than solc via-IR across 12 open-source projects, with the same bytecode.

If you maintain a project that builds with via-IR, build it with both and diff the output. Reports of any difference are welcome as issues on the repo: [Issues · okcontract/oksolc · GitHub](https://github.com/okcontract/oksolc/issues)
