Settings

Theme

Using Zig in our incremental Turborepo migration from Go to Rust

vercel.com

5 points by marksomnian 2 years ago · 3 comments

Reader

consoomer 2 years ago

Weird.. their answer is to ship a hybrid Go+Rust binary sandwiched with Zig. It's a like a who's who keyword stuffing technical blog post with vomit inducing technical decisions.

  • pornel 2 years ago

    They're not using the Zig language. They're using Zig's fantastic packaging of clang with many versions of glibc for easy cross-compilation.

    Cross-compilation is the weakest point of Cargo. It depends on a C linker, but can't be bothered to configure a compatible linker. The default linker is for the host OS only, and completely helpless about dependencies, so the out-of the-box experience in Cargo is a wall of errors and disappointment.

    Zig build helpfully does all the configuration legwork, and bundles all the required binaries.

    • consoomer 2 years ago

      So let me get this straight...

      They went through a phase of, "Let's rewrite it in Rust (from Go)!" but it got complicated, because reasons. One of their reasons is Cargo's cross compilation is bad so they decide to use Zig's toolchain to compensate for Cargo's inferior tool chain.

      Seems like they should have just stuck with Go.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection