5 ms·
This sounds like great news, Zig's compilation times are already terrific and this is going to only make them better.
by epolanski 5mo ago
This sounds like great news, Zig's compilation times are already terrific and this is going to only make them better.
- dmit 5mo ago> Zig's compilation times are already terrific In my experience, this (for now) is mostly aspirational. It's obviously a major goal, and there are clear milestones outlined on how to achieve it, but in practice the initial compile of an empty project or the excruciating pause when you `direnv allow` and ZLS needs to be (re)built are not what I'd describe as "terrific".
- epolanski 5mo agoMaybe you're right, but how many other system programming languages toolchains give you sub 50ms recompilations across millions of LoC?
- dmit 5mo agoI foresee a pjmlp comment in your near future. :)
- epolanski 5mo agoYeah, let's add a sprinkle of toxicity to my Saturday morning!
- Mawr 5mo agoWhat, you wouldn't want a condescending lecture on which exact, unpopular even at the time, languages from the 80's, which had 10% of features of Zig and ran 20x slower, also had fast compilation times? For the 1000th time? Shame on you.
- ksec 5mo agoOh that is me as well :)
- speed_spread 5mo agoI'm not pjmlp, but the cached answer is Turbo Pascal.
- schaefer 5mo ago>(re)built are not what I'd describe as "terrific". It sounds like you are a strong candidate to try out the new improvements mentioned in this devlog and see what benefits you can get for yourself.
- wffurr 5mo agoCompared to Rust or C++?
- pjmlp 5mo agoYes, compilation speeds of the 90's are slowly making a return, thankfully.
- bbkane 5mo agoI thank Go for this. Go's compilation times seemed to inspire other language devs
- magnio 5mo agoI doubt Go has any sizable effect on the community of programming language developers. Probably Pascal has more impact on this.
- DetroitThrow 5mo agoPascal has a lot of influence on this, but Go as well! My PL friends often talk about Go's benefits and flaws when thinking about advancing other their own projects or improving the mainstream languages they work on.
- Mawr 5mo agoThen you haven't been paying attention to the space. At all. Every single new post-Go language, like Rust & Zig, ships with an opinionated autoformatter and a single go-to command to manage builds, packaging, etc. And how many new languages do you see include inheritance and exceptions? Older languages have started adapting what they can too: - Python with `uv` and `black` - Java with goroutine-like fibers and modern configuration-free gcs and the go-gc-like low pause times zgc - Many languages now ship a production-ready http server, just like Go
- pjmlp 5mo agoGo has exceptions, bad ones at that. From type theory exceptions are effects, and result types are a form of effects. Auto formatting has been a thing in IDEs for a decade, and doing pre-commit hooks on CVS with indent was a thing in the 1990's. Java and .NET had http servers. Co-routines trace back to languages like Solo Pascal. Configuration free GC not really that great, given the rewrites into Rust. Anyway, Oberon, Modula-3, Eiffel, .NET,.... Pauseless GC goes back to real time Java from PTC, Aonix, Aicas, and companies like Azul with their custom hardware.
- ozgrakkurt 5mo agoJust creating a file with dummy test like if (2 * 2 != 5) { @panic("fail"); } And running `zig test file.zig -OReleaseSafe` takes a couple seconds on my computer. It also keeps taking the same amount of time every time I do it when I modify that file. Using 0.16 (or master) version so my toolchain isn't old and I'm on linux. Zig is super nice to use as a language but the compiler/stdlib isn't developed conservatively enough imo. You may not run into an issue like this when starting out with hello world but you will want to run optimized binaries for fuzz testing or benchmarking. And then it becomes super annoying considering you might be compiling a relatively small amount of code. Just for comparison, imo Zig is a much better language than these other languages, but if you did something like this in Rust/C++/C etc. this kind of issues basically doesn't ever happen. Assuming clang/gcc/ninja etc. usage for C/C++. I am able to use Ninja/Python/clang for configuring/building (-O2 or -O3)/testing ~10k loc C++ project in 200ms on the same computer for example.
- ozgrakkurt 5mo agoAlso another point. I have some zig projects from couple of months back and they all have build.zig/build.zig.zon. I tried to copy that to the new dummy project I did and of course the API changed and that is broken now (just 15 lines of build.zig code). This kind of thing just feels unacceptable considering I don't really see ANY improvement on the issues I had from back then. Also had a similar baffling experience when I last tried to come back to writing Zig. The std.time.Instant or similar API that also exists in rust and most other languages was move to the new Io interface and they also completely removed that std.time.Instant code. Overall it feels like people developing the tool don't respect the people using the tool. C++ or even Rust are much less enjoyable languages to write compared to Zig so it is really sad that it is not possible to actually use Zig for me.
- epolanski 5mo agoTo be fair the language is in beta and breaking changes are expected.
- defen 5mo ago> Just creating a file with dummy test like > if (2 * 2 != 5) { @panic("fail"); } > And running `zig test file.zig -OReleaseSafe` takes a couple seconds on my computer. What kind of computer are you on? I just ran that test (latest master build, first run): ~ % time zig test file.zig -OReleaseSafe file.zig:1:17: error: expected type expression, found '{' if (2 * 2 != 5) { @panic("fail"); } ^ zig test file.zig -OReleaseSafe 0.03s user 0.44s system 505% cpu 0.094 total Granted I'm on an M4 Mac but I wouldn't expect another system to be 20x slower.