5 ms·
It does seem confusing to me why someone would choose Zig. If you’re looking for a low-level language, Rust is safer with a better ecosystem. If you want a high
by rtev 4y ago
It does seem confusing to me why someone would choose Zig. If you’re looking for a low-level language, Rust is safer with a better ecosystem. If you want a high-level language, Nim binaries are smaller and the Go ecosystem is better.
When is Zig the best choice?
- ferdowsi 4y agoI would choose Zig because Zig has a much more approachable learning curve and Zig code is eminently legible compared to Rust code and it's overly complex type system.
- k__ 4y agoWhy not Go or Nim?
- stephc_int13 4y agoBecause Garbage Collection is basically a garbage feature that should be, at the very least, optional.
- kitkat_new 4y agoit's overly complex because ...?
- acuozzo 4y ago> When is Zig the best choice? "Freestanding" targets, perhaps? I often write software in C to run directly on microcontrollers; no OS, no runtime. I can see the advantage freestanding Rust would provide for e.g. 802.11 firmware. Broadcom repeatedly suffers from their choice to write the firmware for their WiFi chips in C. … but would Rust provide any clear advantage to the programmers of a Furby or a keyboard controller?
- Cyberdog 4y agoThe fanaticism of Rust devs makes me think it's probably massively overrated (see Node yesterday and Ruby/Rails the day before) and Go is associated with Google which gets a perhaps unfair but still unignorable knee-jerk reaction from me to avoid it. I don't know enough about Nim to pass judgment. Two reasons I decided to give Zig a try: The official chat channel is on IRC, instead of Discord or Slack (so the people involved care about efficiency, open standards, and avoiding trends/bandwagoning), and it has an early but promising-looking Swift UI-like cross-platform UI framework in development: https://github.com/capy-ui/capy https://github.com/capy-ui/capy
- davidatbu 4y agoI'm not at all trying to change your mind (I've never used Zig so I can't comment there), but just FYI: 1. Rust uses Zulip (ie, not Discord or Slack), 2. Rust doesn't lack for promising-looking, declarative/reactive UI frameworks: https://iced.rs/ https://iced.rs/, https://crates.io/crates/egui https://crates.io/crates/egui, for example.
- Arnavion 4y ago>1. Rust uses Zulip (ie, not Discord or Slack), The official Rust chat is on Discord. Now, to Cyberdog's point, there is an IRC channel on libera (that I'm also a part of) and it's even bigger than Zig's channel, but it's "unofficial" and they did ask for an official one. Like, Zig's channel has the advantage of being a direct line to andrewrk which you won't get from the Rust channel.
- davidatbu 4y agoThanks for the correction! I conflated what (I believe) some rust teams use as the thing that every thing in official rust uses. I think Rust uses both Discord and Zulip[0]. [0] https://zulip.com/case-studies/rust/ https://zulip.com/case-studies/rust/
- tialaramex 4y agoThere's no equivalent to a "direct line to andrewrk" because Rust does not have this one man setup. Culturally, there's more of a "pitch in to help" and less "ask before touching". So people are mostly looking for hand-holding, "How do I?" and "Is this correct?" rather than decisions and permission.
- zppln 4y agoSome might find Zig to have better ergonomics and some work on systems where dynamic memory allocation and concurrency are inappropriate for safety reasons anyway.
- xedrac 4y agoI could see Zig thriving in a kernel, with its seamless integration with C. It would be a relatively simple upgrade to make. I still think Rust is the better choice though. Maybe the answer to your question is, if you're strictly a C developer and you want something a little nicer without too much more, then Zig might be the best choice for you.
- deleted 4y ago[deleted]
- cztomsik 4y agofor me, - easy interfacing to C libs (glfw) - very easy and readable metaprogramming (compile time inline for over all enum variants, duck-typed and strong-typed anytype at the same time, @compileError for advanced compile checks so you can teach compiler new rules about your code instead of trying to fit your code in the extisting compiler rules)
- Tozen 4y agoVery good points, that can't be ignored. Zig looks to be trapped in a niche. It's going to have a really hard time pushing past other low-level languages, and because its small and focused on that area, will not be able to compete with numerous high-level general-purpose languages that do more for users. Add to that, Rust and Go have strong corporate backing, continually get lots of shine in the media, and often are given positive spin or ratings whenever compared to other languages. As you mentioned Nim, look how far uphill it still has to climb, after the many years (around 14 years) it has been out. TIOBE Index doesn't even have Nim in their top 50, and they aren't even on IEEE's top programming languages list (of around 60 languages). This is just as likely the fate of Zig as well. Not saying some people won't find Zig useful for particular niches, but rather it will likely never be on the level of Rust, Go, D, Object Pascal, etc... or possibly even Nim.