A Solidity compiler written in Zig Chainwall released oksolc 0.1.6, a Solidity compiler written in Zig that targets byte-compatibility with Solidity 0.8.36 through the optimized via-IR Standard JSON path, though the team states it is not production ready for onchain deployment and recommends the original solc for that. The project ships a CLI, a libsolc-compatible C ABI with libsolc.h, and a public Zig module named solidity, and was built with AI assistance (GPT 5.5 then 5.6 Sol) under human guidance. Documented deviations from solc 0.8.36 include named custom-error arguments in require encoding in declaration order, hexadecimal array bounds in IR, and Yul memoryguard retaining the exclusive 2^32 - 1 size limit. oksolc is a Zig implementation of the Solidity compiler that we built for our internal use in developing Chainwall https://chainwall.org . Its goal is to provide an alternative implementation of Solidity for development purposes, allowing faster iteration on the developer experience. We don’t consider oksolc to be production ready for deploying smart contracts onchain, and recommend using the original solc compiler for deployment. That said, we strive to be byte-compatible at this stage with Solidity 0.8.36, apart from the documented exceptions below. Other deviations in compiler output should be considered bugs and reported in Issues. The supported compilation path is the optimized, via-IR compilation through the Standard JSON interface. The project provides: - oksolc , a small command-line interface - a shared libsolc -compatible C ABI and installed libsolc.h - a public Zig module named solidity Note this project was built with AI assistance using GPT 5.5 then 5.6 Sol but under strict human guidance and control, our team having previous experience in building compilers and in formal verification. We intend to publish the methods and controls that we used. The compatibility target is the original Solidity 0.8.36 compiler for Standard JSON, creation bytecode, diagnostics, and deterministic output. Intentional exceptions: - Named custom-error arguments in require encode in declaration order. - Array bounds retain hexadecimal spelling in IR. - Empty dispatch omits unused helpers from unoptimized IR. - Hexadecimal subassembly prefixes require a following hex digit. - Yul memoryguard retains the exclusive 2^32 - 1 size limit. The compile command enables the optimizer with 200 runs. Use standard-json when exact control of compiler settings or output selection is required. oksolc has an independent product version; the Solidity version identifies its compatibility target. See CHANGELOG.md https://github.com/okcontract/oksolc/blob/main/CHANGELOG.md for release history. bash $ oksolc version oksolc 0.1.6 Solidity 0.8.36 $ oksolc --version oksolc, a solidity compiler commandline interface Version: 0.8.36+oksolc.0.1.6 oksolc version --json returns version the product version , solidity version the compatibility target , compatibility version the Solidity SemVer with oksolc build metadata , and build identity the compiler content identity, or null if unavailable . Include this output in bug reports. The public Zig module exposes the product version as solidity.version and the Solidity target as solidity.baseline.version . --version and the C ABI's solidity version retain a Solidity-compatible SemVer for tools such as Foundry. Even development releases put the oksolc version after + , so the Solidity target is still treated as a release. Contract metadata and CBOR keep the pinned reference compiler identity to preserve output and bytecode compatibility. Use the product version for upgrade comparisons; SemVer precedence ignores the build metadata after + . - Zig 0.16.0 - TypeScript 7.0.2 tsc and Bun 1.4.2 only for the optional web browser - libc and a working C toolchain - Clang with ASan/UBSan runtimes for fuzz-json-adapter and fuzz limited to the yyjson adapter for now - Python 3 for tests and benchmark orchestration - solc version 0.8.36 for optional reference audits and benchmark comparisons - zstd to replay the bundled external benchmarks; Forge and Git to capture fresh requests, plus Node.js/npm for old Uniswap and Node.js for Pendle setup The first Zig build downloads the dependencies declared in build.zig.zon . Build the CLI, shared library, and C header: zig build -Doptimize=ReleaseFast The executable is at zig-out/bin/oksolc ; the library and header are in zig-out/lib and zig-out/include . Add zig-out/bin to your PATH or install to a different prefix: zig build -Doptimize=ReleaseFast --prefix "$HOME/.local" For development, omit -Doptimize for Debug mode, or use -Doptimize=ReleaseSafe for an optimized build with runtime safety checks. To build only the CLI, use zig build build-cli . The web browser is disabled by default, so ordinary builds require neither Bun nor TypeScript. To include oksolc browse and oksolc serve --browse , install the pinned browser tools and opt in: zig build -Doptimize=ReleaseFast -Dbrowser=true Distribution builds can strip debug information and select a target: zig build -Dtarget=aarch64-macos -Doptimize=ReleaseFast -Dstrip=true \ --prefix build/macos-arm64 zig build -Dtarget=x86 64-linux-gnu -Doptimize=ReleaseFast -Dstrip=true \ --prefix build/linux-amd64 Compile one or more Solidity files and write the Standard JSON result to stdout: oksolc compile Contract.sol Library.sol For control over compiler settings and requested artifacts, supply a Standard JSON request from a file or stdin. Use -o to save the result: oksolc standard-json request.json oksolc standard-json - < request.json oksolc standard-json -o build/output.json request.json For filesystem imports, --base-path sets the source lookup root and repeatable --include-path options add library directories include paths require an explicit base path . AS of now, source paths must stay within the configured roots and cannot contain symlinks. Independent contract backends can compile in parallel. --jobs sets total concurrency, including the main thread: oksolc compile --parallel --jobs 4 Contract.sol Library.sol Add --progress for terminal progress, or --profile-optimizer FILE to save compiler timings as JSON. Run oksolc --help or oksolc