Zig: Build System Reworked
211–220 of 263 posts
Re: Zig: Build System Reworked
#212Re: Zig: Build System Reworked
#213Earlier quoted context omitted.
And if you really need more performance (or, more often, fast startup times), Go gives you 90% of the speed with 30% of the effort. Rust if you really want to squeeze everything that can possibly be squeezed of that CPU.
Zig gives you more control than Rust, which should theoretically lead to a higher performance ceiling. There's not much magic in Zig. Keep hitting goto-definition and you can eventually see the OS switch statements and syscalls.
Re: Zig: Build System Reworked
#214Earlier quoted context omitted.
Wow that’s gnarly it’s using dynamic dispatch. I mean I get it, but I thought zig was some sort of performance demon.
I believe their plan is using "restricted function pointers", where you can specify that a pointer will only ever be to a function defined in the codebase. I'm pretty sure they also have plans for devirtualization, but I haven't followed super closely.
i dont think you need to specify that. the compiler can figure it out and do an optimization pass at the end.
Re: Zig: Build System Reworked
#215Re: Zig: Build System Reworked
#216Earlier quoted context omitted.
> 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".
Maybe you're right, but how many other system programming languages toolchains give you sub 50ms re compilations across millions of LoC?
Re: Zig: Build System Reworked
#217Earlier quoted context omitted.
Is it really that good? My go-to "tinker in my garage" language is Python - lightweight syntax that stays out of your face, batteries included, packages for everything that's not included. What's Zig's edge?
That's so funny. At university we didn't use Python, but mostly Java, C++, C a bit of Haskell and some even more esoteric ones. Sure thing I got exposed to Python, but to this day, I don't like it. All that whitespace typing just kills me xD I am not normally someone who cares the slightest about Syntax. I've written Rust, C++, C, C#, JavaScript, TypeScript, Haskell, Kotlin, Scala, PHP, and many, many more in my spar…
Re: Zig: Build System Reworked
#218Would someone tell a rust user why they should and should not try zig?
> and should not try zig? Because it isn't memory safe. I honestly think it's beyond the point of "irresponsible" and well into "negligence" that we're still developing unsafe technologies - people are being harmed by this choice. It's one thing when you have to target specific platforms and maybe Rust wasn't an option or whatever, but the reasons to choose unsafe languages at this point are vanishingly small. Zig is…
this is an insane take
Re: Zig: Build System Reworked
#219Earlier quoted context omitted.
> and should not try zig? Because it isn't memory safe. I honestly think it's beyond the point of "irresponsible" and well into "negligence" that we're still developing unsafe technologies - people are being harmed by this choice. It's one thing when you have to target specific platforms and maybe Rust wasn't an option or whatever, but the reasons to choose unsafe languages at this point are vanishingly small. Zig is…
I completely agree. Zig has a nicer DX no doubt - no fighting the borrow checker etc. But if you are are writing software for other people they don't care about how nice your developer experience is, they only want the software to work correctly - and how can you guarantee that the software you wrote does what you expect it to do if it's not memory safe?
Re: Zig: Build System Reworked
#220Earlier quoted context omitted.
I believe their plan is using "restricted function pointers", where you can specify that a pointer will only ever be to a function defined in the codebase. I'm pretty sure they also have plans for devirtualization, but I haven't followed super closely.
"you can specify that a pointer" i dont think you need to specify that. the compiler can figure it out and do an optimization pass at the end.