• seppdroid released this 2026-02-21 17:46:13 +01:00 | 0 commits to main since this release

    Download cowc.rs and install the rust toolset: https://rust-lang.org/tools/install/

    Build cowc

    rustc -O cowc.rs -o cowc
    

    Compile a .cow program (native)

    ./cowc hello.cow -o hello
    

    Keep the generated Rust (helpful for inspection/debugging):

    ./cowc hello.cow --keep-rs -o hello
    

    Only emit Rust and stop:

    ./cowc hello.cow --emit-rs -o hello
    

    Cross-compiling

    Install the target:

    rustup target add x86_64-pc-windows-gnu
    

    Compile:

    ./cowc --target x86_64-pc-windows-gnu hello.cow -o hello.exe
    

    Notes:

    • Cross targets require the Rust std components for that target.
    • Some targets also require a system linker/toolchain; rustc will tell you if something is missing.

    Max performance

    After running the benchmarks, it turns out that fat LTO doesn’t provide any real benefit for most COW applications.

    You can enable it with the LTO flag

    ./cowc hello.cow --lto -o hello
    

    In the previous version, output was automatically buffered and only written when the program finished for performance.
    This is now an optional flag, since the behavior made some programs unusable. See the issue here

    ./cowc hello.cow --vec-stdout -o hello
    

    For host builds, keep the default native CPU tuning (-C target-cpu=native). Disable it with:

    ./cowc hello.cow --no-native-cpu -o hello
    
    Downloads