4 ms·
Zig seems to be a good choice here.
by hassleblad23 2y ago
Zig seems to be a good choice here.
- UncleOxidant 2y ago> Rust's compile times are slow. Zig's compile times are fast. This is not the only reason, but it's a big reason. So why not something like OCaml that has fast compile times and a lot of nice features for writing compilers? (pattern matching, etc.)
- whytevuhuni 2y agoBecause, like he said, compile times matter. This includes the Roc compiler too. Zig is significantly faster than OCaml.
- LAC-Tech 2y agoThe Ocaml compiler is significantly faster than the Zig one. It's one of the fastest I've seen.
- whytevuhuni 2y agoAh, sorry, I was referring to the speed of the resulting Roc compiler. A Roc compiler written in Zig would compile Roc code significantly faster than a Roc compiler written in OCaml.
- LAC-Tech 2y agoAh! That makes sense.
- platinumrad 2y agoThe same reason why they're not self-hosting. They want compiler performance to be in the top C, C++, Rust, Zig tier. OCaml isn't slow, but at best it's in the second Java, C#, etc. tier.
- henning 2y agoZig's union enums get you something kind of like pattern matching. https://zig.guide/language-basics/unions/ https://zig.guide/language-basics/unions/
- theLiminator 2y agoI guess if you want to never limit yourself in terms of performance, you're kinda stuck with either C/C++/Zig/Rust/etc. GCed languages can be fast, probably even as fast as any of the aforementioned languages with enough engineering effort, but in terms of high performance, it's actually easier to write high performance code in the aforementioned languages rather than in a GCed language.
- pjmlp 2y agoOCaml is fast enough for writing hypervisors, unikernels, networking drivers, powering all Jane Street's business.