Roc lang to be rewritten in Zig

16 Likes

A frustratingly common response I’ve heard to this complaint is that “several seconds is not as bad as [some other language or some other project that has minutes-long build times]!” I don’t care if things could be even worse, I care that I’m feeling this pain while knowing I don’t have to. Zig’s x86-64 backend can reportedly scratch-build (without anything cached) the entire 300K-line Zig compiler code base in a second or two. It takes us longer than that to build one of our medium-sized Rust crates, and that’s even with the benefit of caching.

I can be sympathetic to that frustration. However is it True that zig can build itself that fast? I’ve never actually built zig, just used the distributed binary.

1 Like

This video (which I watched yesterday by coincidence) explains a lot of the thinking here about how Zig is used in the Roc compiler. https://youtu.be/jIZpKpLCOiU?si=T1TZRN-DzFNCeWmQ

3 Likes

Presumably, he’s talking about the custom x86_64 backend, which is only for debug builds, does not use LLVM directly, and doesn’t support a number of things, afaik, but it is extremely fast to compile, otherwise.

3 Likes

yes I’ve tried it and it’s really fast, even on my laptop which isn’t a beast by any stretch of the imagination it’s really good.

1 Like

Love these news. Left a comment in the gist too.

2 Likes

I think it’s pretty close to parity to other backends in term of features support, at least on the issue tracking, there isn’t much left to implement for parity :slight_smile: