|
|
Subscribe / Log in / New account

Zig 2024 roadmap

Zig 2024 roadmap

Posted Feb 4, 2024 11:57 UTC (Sun) by atnot (subscriber, #124910)
In reply to: Zig 2024 roadmap by roc
Parent article: Zig 2024 roadmap

I feel like there is this inevitable curve every compiler backend goes through where, unless given some external constraint, people will always find one more optimization that's just a tiny bit more expensive but makes huge gains in output quality in some scenario. And if you could just tweak this data structure a little bit they would be so much easier to write. Then you repeat that 100 times and you end up just where GCC and LLVM are with huge, slow data structures built to get every last bit of performance out at the cost of baseline compile times.

I'm a bit more optimistic about cranelift there because it always has to remain usable for interactive use with WASM. Go achieves that constraint by refusing to make a release if the compile time is slower than before. I hope Zig does something similar.


to post comments

Zig 2024 roadmap

Posted Feb 4, 2024 14:53 UTC (Sun) by tialaramex (subscriber, #21167) [Link] (2 responses)

My optimism for Cranelift is that they seem more enthusiastic about delivering on clear semantics for their IR. A recurring problem with LLVM is that the IR was built by C++ people, who have a very lax attitude to tricky semantic correctness problems because C++ itself just punts all those problems to the programmer, knowing the programmer will just ignore them and so too bad the end users eat the consequences, however bemusing or outright lethal those might be.

With an already unsafe language like C++ the resulting miscompilations barely register, but for Rust it "optimizes" enough routine provably safe (even if sometimes daft) code into nonsense that it's a significant blight.

Zig 2024 roadmap

Posted Feb 4, 2024 19:19 UTC (Sun) by roc (subscriber, #30627) [Link] (1 responses)

I don't think LLVM is a lost cause there --- John Regehr and others are doing heroic work in this area --- but it sure is a problem.

Zig 2024 roadmap

Posted Feb 4, 2024 20:18 UTC (Sun) by Wol (subscriber, #4433) [Link]

Yup. I got the impression the LLVM people were quite happy to fix the problems, but if it's pervasive right through the IT and implementation, I can understand it being a long and painful process.

Certainly I've seen a fair few complaints that "C/C++ isn't strict, so the LLVM isn't strict. Rust is strict and it breaks".

Cheers,
Wol


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds