6 ms·
What are the flaws/weak points of Zig?
by NOGDP 6y ago
What are the flaws/weak points of Zig?
- ternaryoperator 6y agoThe ones I've seen are not Zig-specific, but rather attendant to any language in early stages: a small development team, very limited tooling. (To be fair though, the dev team has done an amazing job banging out good code.)
- rubiquity 6y agoI love Zig. Occasionally I wish it had interfaces because that’s how my brain designs software components. You currently achieve the same runtime characteristics of interfaces by using a function property on a struct. It’s a great language though and a ton of fun. It’s so easy to dive into a codebase quickly which I value as a very distracted dad. The standard lib is a joy to read too.
- throwaway17_17 6y agoCan you explain what you mean when use the term interfaces? I’m just curious as to what your describing. Also, do you mean use a function property on a struct in Zig specifically to capture the operation of such an interface?
- deleted 6y ago[deleted]
- mypalmike 6y agoI assume interfaces refers to runtime polymorphism.
- deleted 6y ago[deleted]
- AndyKelley 6y agosearch for "design flaw" on the issue tracker
- JNRowe 6y agoI was half expecting to find some kind of rickroll-esque joke, but there is actually a lot of really interesting discussion tucked away in that search¹. I find the open and frank discussion of problem choices to be very refreshing. ¹ https://github.com/ziglang/zig/search?q=design+flaw&type=issues https://github.com/ziglang/zig/search?q=design+flaw&type=iss...
- dilap 6y agowhile zig's error handling is almost perfect, it's missing a way to return context w/ the error (https://github.com/ziglang/zig/issues/2647 https://github.com/ziglang/zig/issues/2647) while the debug allocator can tell you at runtime about use-after-free or memory leaks, that's a less strong guarantee than rust or a GCed language there are no closures; in general the code you write is lower-level than code in python, c#, rust the language is very new --opinions of a zig dilettante bonus observations: the std library code is very readable the language overall has an excellent philosophy & design approach, and i predict it will become extremely popular (as a single point of comparison: even after puzzling over it for a while, i still don't understand how modules work in rust; the equivalent feature in zig is immediately obvious, and in fact is the same concept as structs. how cool is that? (very cool, imo.))
- vbezhenar 6y ago> the std library code is very readable I think that's very important feature to have for some people like me. I love Java standard library, because it's really easy to read. I regularly read its source code when I need to understand something and it's amazing how much time that could save. The only nitpick when it comes to Java is that some low-level stuff implemented in C and it's not as straightforward to jump into C implementation. And that what turns me off from Scala and from C++. Scala collections library is horrible to read. It's immensely complicated. I get that they're solving hard problem, but I don't like it. And I hate C++ STL code (at least those that I saw), they're using obscure __identifiers__ and so on (may be there are better implementations, I saw GCC and MSVC ones). Standard library is how language is supposed to be used. Those who learn language can just read its sources to better understand language idioms and replicate those in their code. And there's a huge difference between languages with readable standard library and languages with unreadable standard library (or even without sources at all, Apple sucks).
- Leherenn 6y agoThey use those "obscure __identifiers__" because they are reserved by the standard and thus a conforming program will not define macros with those values and break everything.
- flohofwoe 6y agoCurrently: initialization of multi-dimensional arrays, and partial initialization of arrays, this whole area isn't as convenient as C (yet, I hope). Also, currently it's possible to return a pointer/slice to a stack-allocated array from a function without a warning or error resulting in a dangling pointer. But this too will hopefully be fixed (because even C compilers warn about this these days). But I think all those points can be considered bugs / todos.
- lightgreen 6y agoUnlike Rust, Zig does not provide memory safety. They have runtime checks (unlike Rust compile checks) which are at least slower, but likely still don't guarantee memory safety (did not dig deep).