7 ms·
Where do you guys see good use cases for Zig? I'm intrigued by the language but don't really have any good ideas on where to try it out. I thought about trying
by bakuninsbart 3y ago
Where do you guys see good use cases for Zig? I'm intrigued by the language but don't really have any good ideas on where to try it out.
I thought about trying it out in as small data engineering project, but I'm not sure if language support is sufficient for the kind of tooling I would need eg. Database adapters.
- jgalt212 3y agoI've been thinking about using it for Python hot paths. I'm not smart enough to write rust (at least without limitless supplies of aspirin). And I'd like to avoid C for all the obvious reasons.
- Dowwie 3y agoTry Elixir.
- chjj 3y agoDo you maintain any C projects? Personally, I tried using zig for its build system (which can also compile C and whose build files are written in zig). One of the benefits of this was easy cross-compilation to all major platforms. It might not be a _real_ use-case or anything, but writing a `build.zig` file for an existing C project might be a good way to at least dip your toe in the water.
- pjmlp 3y agoIn what concerns userspace, I don't see any good case, if I want a better C, without much features, I rather stick to Go even if I dislike some of the design decisions. Or D, Nim, Swift, OCaml, Haskell, AOT C#, AOT Java,... If any kind of automatic memory isn't possible/allowed, I would be reaching out for Rust, not a language that still allows for use-after-free errors. Maybe it is a good language for those that would like to have Modula-2 with a C like syntax, and metaprogramming capabilities, and are ex-Objective-C developers.
- distcs 3y ago> If any kind of automatic memory isn't possible/allowed, I would be reaching out for Rust I have come to the same conclusion but then I also fear that Rust will continue to expand in scope and become a monster language like C++. Do you or anyone fear that? Is that a possibility?
- vilunov 3y agoRust hasn't grown in scope very much since its release, but in places where it has grown, particularly async and unpin, I find that there features interact very badly with lifetimes and borrowing. I am often forced to ditch borrowing across async method calls and to put everything in Arcs, even when the lifetime is well-defined and it could be easily used if it had been scoped threads instead of futures. I fear that newer features will be incompatible with older ones in a similar way, but fortunately there are no such features on the horizon. Considering all that, I still see Rust as the most sane choice for writing native programs. I don't really want a "better C", I want to write memory-safe software with confidence, and that means static analysis or a thick safe runtime, whatever is more suitable for the use case.
- mr_00ff00 3y agoTechnically though, isn’t memory safety not necessary in some cases? For example, single player video games. You can exploit your own machine if you want, but that’s not an issue. I like rust, but if I ran into async issues and annoying stuff, I could see a world where I grab a non-memory safe language to make games easily.
- nequo 3y agoCrashing the program during runtime and having to debug it then is still a worse experience than knowing before running it that it cannot crash (due to memory errors). This certainty comes at a cost, either by negotiating with the Rust compiler or by putting up with a GC. But depending on your calculus, that cost might be worth paying.
- 3y ago
- mcdonje 3y ago>Use Zig as a zero-dependency, drop-in C/C++ compiler that supports cross-compilation out-of-the-box. - ziglang.org homepage