5 ms·
I’ve never managed to understand your year-long[1] manic praise over this feature. Given that you’re a language implementer. It’s very cool to be able to just
by keybored 2y ago
I’ve never managed to understand your year-long[1] manic praise over this feature. Given that you’re a language implementer.
It’s very cool to be able to just say “Y is just X”. You know in a museum. Or at a distance. Not necessarily as something you have to work with daily. Because I would rather take something ranging from Java’s interface to Haskell’s typeclasses since once implemented, they’ll just work. With comptime types, according to what I’ve read, you’ll have to bring your T to the comptime and find out right then and there if it will work. Without enough foresight it might not.
That’s not something I want. I just want generics or parametric polymorphism or whatever it is to work once it compiles. If there’s a <T> I want to slot in T without any surprises. And whether Y is just X is a very distant priority at that point. Another distant priority is if generics and whatever else is all just X undernea... I mean just let me use the language declaratively.
I felt like I was on the idealistic end of the spectrum when I saw you criticizing other languages that are not installed on 3 billion devices as too academic.[2] Now I’m not so sure?
[1] https://news.ycombinator.com/item?id=24292760 https://news.ycombinator.com/item?id=24292760
[2] But does Scala technically count since it’s on the JVM though?
- ww520 2y agoI'm sorry but I don't understand what you're complaining about comptime. All the stuff you said you wanted to work (generic, parametric polymorphism, slotting <T>, etc) just work with comptime. People are praising about comptime because it's a simple mechanism that replacing many features in other languages that require separate language features. Comptime is very simple and natural to use. It can just float with your day to day programming without much fuss.
- keybored 2y agocomptime can’t outright replace many language features because it chooses different tradeoffs to get to where it wants. You get a “one thing to rule all” at the expense of less declarative use. Which I already said in my original comment. But here’s a source that I didn’t find last time: https://strongly-typed-thoughts.net/blog/zig-2025#comptime-is-probably-not-as-interesting-as-it-looks https://strongly-typed-thoughts.net/blog/zig-2025#comptime-i... Academics have thought about evaluating things at compile time (or any time) for decades. No, you can’t just slot in eval at a weird place that no one ever thought of (they did) and immediately solve a suite of problems that other languages use multiple discrete features for (there’s a reason they do that).
- throwawaymaths 2y ago> comptime can’t outright replace many language features because it chooses different tradeoffs to get to where it wants. You're missing the point. I don't have any theory to qualify this, but: I've worked in a language with lisp-ey macros, and I absolutely hate hate hate when people build too-clever DSLs that hide a lot of weird shit like creating variable names or pluralizing database tables for me, swapping camel-case and snake case, creating a ton of logic under the hood that's hard to chase. Zig's comptime for the most part shys you away from those sorts of things. So yes, it's not fully feature parity in the language theory sense, but it really blocks you or discourages you away from shit you don't need to do, please for the love of god don't. Hard to justify theoretically. it's real though. It's just something you notice after working with it for while.
- keybored 2y agoNo, you are clearly missing the point because I laid out concrete critiques about how Zig doesn’t replace certain concrete language features with One Thing to Rule Them All. All in reply to someone complimenting Zig on that same subject. That you want to make a completely different point about macros gone wild is not my problem.
- hitekker 2y agoDo you have a source for "criticizing other languages not installed on 3 billion devices as too academic" ? Without more context, this comment sounds like rehashing old (personal?) drama.
- keybored 2y agopron has been posting about programming languages for years and years, here, in public, for all to see. I guess reading them makes it personal? (We don’t know each other) The usual persona is the hard-nosed pragmatist[1] who thinks language choice doesn’t matter and that PL preference is mostly about “programmer enjoyment”. [1] https://news.ycombinator.com/item?id=16889706 https://news.ycombinator.com/item?id=16889706 Edit: The original claim might have been skewed. Due to occupation the PL discussions often end up being about Java related things, and the JVM language which is criticized has often been Scala specifically. Here he recommends Kotlin over Scala (not Java): https://news.ycombinator.com/item?id=9948798 https://news.ycombinator.com/item?id=9948798
- pron 2y agoMy "manic praise" extends to the novelty of the feature as Zig's design is revolutionary. It is exciting because it's very rare to see completely novel designs in programming languages, especially in a language that is both easy to learn and intended for low-level programming. I wait 10-15 years before judging if a feature is "good"; determining that a feature is bad is usually quicker. > With comptime types, according to what I’ve read, you’ll have to bring your T to the comptime and find out right then and there if it will work. Without enough foresight it might not. But the point is that all that is done at compile time, which is also the time when all more specialised features are checked. > That’s not something I want. I just want generics or parametric polymorphism or whatever it is to work once it compiles. Again, everything is checked at compile-time. Once it compiles it will work just like generics. > I mean just let me use the language declaratively. That's fine and expected. I believe that most language preferences are aesthetic, and there have been few objective reasons to prefer some designs over others, and usually it's a matter of personal preference or "extra-linguistic" concerns, such as availability of developers and libraries, maturity, etc.. > Now I’m not so sure? Personally, I wouldn't dream of using Zig or Rust for important software because they're so unproven. But I do find novel designs fascinating. Some even match my own aesthetic preferences.
- keybored 2y ago> But the point is that all that is done at compile time, which is also the time when all more specialised features are checked. > ... > Again, everything is checked at compile-time. Once it compiles it will work just like generics. No. My compile-time when using a library with a comptime type in Zig is not guaranteed to work because my user experience could depend on if the library writer tested with the types (or compile-time input) that I am using.[1] That’s not a problem in Java or Haskell: if the library works for Mary it will work for John no matter what the type-inputs are. > That's fine and expected. I believe that most language preferences are aesthetic, and there have been few objective reasons to prefer some designs over others, and usually it's a matter of personal preference or "extra-linguistic" concerns, such as availability of developers and libraries, maturity, etc.. Please don’t retreat to aesthetics. What I brought up is a concrete and objective user experience tradeoff. [1] based on https://strongly-typed-thoughts.net/blog/zig-2025#comptime-is-probably-not-as-interesting-as-it-looks https://strongly-typed-thoughts.net/blog/zig-2025#comptime-i...
- keybored 2y ago> Because I would rather take something ranging from Java’s interface to Haskell’s typeclasses since once implemented, they’ll just work. With comptime types, according to what I’ve read, you’ll have to bring your T to the comptime and find out right then and there if it will work. Without enough foresight it might not. This was perhaps a bad comparison and I should have compared e.g. Java generics to Zig’s comptime T.