|
|
|
|
|
by pron
2333 days ago
|
|
> besides you don't want to go read the implementation of your functions every time do you ? IDEs show us only prototypes for a reason The IDE can be changed to show you assertions in addition to the signature, just as it also shows doc comments. That the signature is special isn't some law of nature, it's just habit (and users of untyped languages don't even have those). > How would you for instance specialize a generic function in Zig ? ... and properly dispatches between both ? No, you'd need a single definition with a comptime branch. > I'd be hard pressed to say that it is "as powerful" given what I'm seeing for now. What you're seeing is personal taste. In my taste, that Zig doesn't allow overloading and has clear dispatch is clearer is more preferable (in fact, it's touted as one of Zig's biggest strengths); in yours, it is less preferable. That's perfectly OK, but it's got nothing to do with expressive power (which has a pretty good and precise definition: https://youtu.be/43XaZEn2aLc). There is a reason why some languages are more complicated while others are simple -- some people aesthetically prefer the more complex languages while others prefer simpler ones. What is impressive about Zig is that despite being simple, it's not giving up power, at least in those aspects I mentioned. C, another simple language, cannot do those things. |
|