5 ms·
> Zig's comptime is a very large and all-encompassing feature that ultimately brings very little to the table that smaller features cannot. > I am personally a
by ivanjermakov 11mo ago
> Zig's comptime is a very large and all-encompassing feature that ultimately brings very little to the table that smaller features cannot.
> I am personally a proponent of a good macro system.
Comptime is much more constraint than any macro system: no code generation (including AST rewrite), no arbitrary tokens. Thus it's much harder to "go overboard" with Zig's comptime. This constraints of cource have their drawbacks, but code generation is still a thing.
> Much of Zig seems to me like "wishful thinking"; if every programmer was 150% smarter and more capable, perhaps it would work.
Nice way to put it! But I oppositely believe the world needs more tech that treats professionals as experts, not kids.
- brabel 11mo ago> Nice way to put it! But I oppositely believe the world needs more tech that treats professionals as experts, not kids. That’s how it was until around the turn of the century. Who needs types, we’re adults after all. Memory safety and garbage collection? Oh please go back to kindergarten. But then some of us learned that no matter how smart we are, we can make mistakes that those things can actually prevent. And those mistakes can have catastrophic consequences. Professionals should go for tools that help them prevent those mistakes, right??
- ModernMech 11mo ago> But then some of us learned that no matter how smart we are, we can make mistakes that those things can actually prevent. That's true but it's deeper than that -- no matter how much time goes by, there will always be people new to the language, and they will always make newbie mistakes if the language allows them to. So "just be an expert and don't write shoddy code" doesn't scale, no matter how hard you personally try.
- refulgentis 11mo agoIt's deeper to note people who know nothing will make the mistake, than "I, an expert, will make the mistake"? :)
- ModernMech 11mo agoOkay broader then?
- rvrb 11mo agoZig is a tool that helps professionals prevent those mistakes. "Memory safe languages" are tools that prevent professionals from making those mistakes. It's a subtle but important difference. Zig attempts to leave some humanity to the developer. When someone says they are incapable of earning or deserving that, I feel sad.
- James_K 11mo agoCreating a language which is difficult to use and dangerous is not “lending humanity to the developer”. Humans make mistakes, and a language that doesn't account for this is ignoring the humanity of its users.
- rvrb 11mo agoZig is famously simple to pick up and write with, so I don't know what you mean by "difficult". Software is dangerous. Memory safety is one of a million ways it can be dangerous. A compiler barfing when it thinks you are doing something unsafe with pointers is one approach to dealing with one of the ways that code can be dangerous to execute. Zig does not ignore that particular danger, it just takes a different approach to dealing with it than some other modern languages. An approach that, I believe, leaves the developer with a little more humanity by allowing them the benefit of the doubt that they know what they are doing. Everyone that has not built a systems language, or has not built a real application with both Zig and a memory safe language, that is reacting emotionally to what I've said should put a lot of consideration into whether they are cargo culting or using critical thought. Consider that we still do not yet know what is best, and shutting down attempts to explore different ideas with things like "creating [and using] this language is ignoring the humanity of the end user" is, well.. dumb.
- lerno 11mo agoI have never heard anyone calling Zig "famously simple" before. In fact, people tend to say it has quite the learning curve. Of course, caveats apply: it is certainly simple compared to some languages, but certainly not compared to others. "Famously simple" seems to indicate it is one of the simplest languages to learn, which seems wrong unless there are some serious qualifications to that statement?
- InsideOutSanta 11mo agoWhen I was much dumber, I thought I was much smarter. Now that I'm smarter, I realize that I'm often quite dumb.
- pron 11mo ago>> Much of Zig seems to me like "wishful thinking"; if every programmer was 150% smarter and more capable, perhaps it would work. ... and the same could be said about Rust, only with Rust we can already see that it suffers from relatively low adoption at a relatively advanced age. The funny thing about that claim is that it leads to an obvious question: if working harder to satisfy the compiler is something that requires less competence than other forms of thinking about a program, then why Rust? Why not ATS? After all, Rust does let you eliminate certain bugs at compile time, but ATS lets you eliminate so many more.
- whytevuhuni 11mo ago> Why not ATS? As in, why not use a language with much stronger formal verification? Because people have tried it and failed. Like you said, Rust is hard, it already feels at the limit of what people can handle. But unlike ATS, many people have tried Rust and succeeded, and some Rust programmers even claim that they become very productive with it after a while. I very much doubt the same could be said about ATS.
- pron 11mo ago> But unlike ATS, many people have tried Rust and succeeded, and some Rust programmers even claim that they become very productive with it after a while So if Rust is preferable to ATS because more people are productive with it despite ATS being able to guarantee more at compile-time, then by that logic a language that more people would be productive with than with Rust, despite Rust guaranteeing more at compile time, would be preferable to Rust. You see, the problem is that these arguments cannot lead us to an objective preference unless we compared Rust to all other points on the spectrum, especially since Rust proponents already must accept that the best point is not on any extreme. So we know that languages that guarantee more than C but more productive than ATS are preferable. Guess what? Zig is right there, too, so that argument can't be used to prefer Rust over Zig.
- whytevuhuni 11mo agoSure, that makes sense. I agree this is all very subjective, given we don't have the benefit of hindsight for what Zig can accomplish yet. I think where we disagree is that you believe Zig is as safe as Rust (by making it easier to make other things safer). I don't believe so (my first impression of Zig was Bun repeatedly segfaulting), and I'm just sad that people are choosing the easy route and going for more insecure software, when it finally looked like we made such great progress, with a language people can actually use. I agree with simpler, but there's so many other things that can be changed or removed from Rust, and still leave in lifetimes, or something similar.
- eviks 11mo ago> But I oppositely believe the world needs more tech that treats professionals as experts, not kids. Which part of expertise is rejecting the fact that safety through professional mind tricks in lieu of better underlying language design is unattainable?
- api 11mo ago> But I oppositely believe the world needs more tech that treats professionals as experts, not kids. This attitude is why we still have bounds checking memory bugs in new software in 2025. IMHO an artisan should want superior tools that produce better results.
- kennykartman 11mo ago> But I oppositely believe the world needs more tech that treats professionals as experts, not kids. This made me think about Rust borrow checker: given the amount of people struggling with it, I would think the number of experts is much lower than I would initially assume.
- 0manrho 11mo ago> But I oppositely believe the world needs more tech that treats professionals as experts, not kids. Seconded. I've really come to loathe tech that is constantly trying to "help me" unprompted and do things I didn't ask/want it to do or burying settings/configurations if not obfuscating them away entirely and acting as if it's doing me a favor by removing features in the name of "simplicity" or some shit. And let's not forget built-in obsolescence moonlighting with privacy-disrespecting dark patterns masquerading together as "Smart Devices."
- torginus 11mo agoNot an expert, but isn't Zig's comptime essentially an AST generator?
- ivanjermakov 11mo agoKind of, but such functionality is not exposed to the user. Great post on what comptime won't do: https://matklad.github.io/2025/04/19/things-zig-comptime-wont-do.html https://matklad.github.io/2025/04/19/things-zig-comptime-won...