Remix.run Logo
pdpi 3 days ago

> Actually, the Rust toolchain makes cross-compiling way easier than any other fully-compiled language I've ever used

Zig takes the crown on that one, to the point that some people use Zig to cross-compile Go projects with CGo dependencies.

wyldfire 3 days ago | parent [-]

The way Zig solves this problem "better" than Rust is by claiming the target libraries as part of its distribution and building those on demand. It makes for a really excellent experience cross-building.

Rust might have a harder time if it wanted a corresponding feature because it doesn't natively build C like Zig does (using libclang). Either it would have to start using libclang or ship with rust re-implementations of the C library. AFAIK it's impossible to write the C++ library in Rust though.