6 ms·
I love how Zig is pushing the state of the art forward. I have some expertise in the area, and I think the future is in languages that prioritize simplicity and
by verdagon 4y ago
I love how Zig is pushing the state of the art forward. I have some expertise in the area, and I think the future is in languages that prioritize simplicity and developer velocity like Zig is doing.
> The core team will then be able to begin thinking about: ... Exploring hot-code-swapping
Hot code swapping, plus Zig's ability to cross-compile, plus release-safe's memory assistance without mental overhead, all seem to come from one underlying drive: support and empower the programmer without getting in their way.
When designing a language, it's important to keep the user's ultimate goal in mind: making useful software. For some domains that might mean adding restrictions, but for other domains it means getting out of the programmer's way and making language mechanisms and tooling so they can iterate, experiment, and build faster.
I'm particularly excited about Zig's future in webassembly, where many safety concerns are already handled by sandboxing. It's amazing to read that someone ported an entire game to webassembly with Zig.
- giancarlostoro 4y ago> I think the future is in languages that prioritize simplicity and developer velocity like Zig is doing. I kind of dont like Zig because of the syntax its just a little out of the norm from what I'm used to. I like D more if I want to go the C-like route, just hate that its not quite as popular as Go or Rust seem to be. Currently I'm diving into Nim more than anything though, it feels like the sweet spot for me.
- NinoScript 4y agoOne gets used to syntax, don’t let that be the reason you don’t like a language.
- giancarlostoro 4y agoIt's not just syntax, it is obviously C-like which I like, but it is the way programs look, I think Zig is maybe more low level than I care for.
- sam0x17 4y agoI wish I had known about D like a decade ago. I swear it was just too ahead of its time.
- ArrayBoundCheck 4y agoIts a great language. I suspect the problem was it tried to out java java (GC!) and it kind of tried to out C++ C++
- pornel 4y agoI've tried it a decade ago, and it wasn't ready back then. It was split between D1 and D2, and Tango and Phobos. That was super annoying, because whatever documentation or library you'd find, it was most likely for a different combination of D+std than you had. Enjoy D now when it's more mature. The betterC switch is especially interesting.
- danielscrubs 4y agoLooks like it has nice syntax but it seems very very far from pushing state of the art, and that is totally fine.
- verdagon 4y agoIt can seem like that on the surface, but a closer look reveals a lot of very interesting new features. Here's a few off the top of my head: * Comptime, which can serve the purpose of generics without a new sub-language [1] * Colorblind async-await, basically parameterizing async-ness to avoid the downsides of async's infectious nature [2] * Hot-code swapping proof-of-concept [3] (Edit: specifically, new to low-level languages, AFAICT) Pretty cool stuff! [1] https://kristoff.it/blog/what-is-zig-comptime/ https://kristoff.it/blog/what-is-zig-comptime/ [2] https://kristoff.it/blog/zig-colorblind-async-await/ https://kristoff.it/blog/zig-colorblind-async-await/ [3] https://www.reddit.com/r/Zig/comments/s9toy1/we_have_a_working_hot_code_swapping/ https://www.reddit.com/r/Zig/comments/s9toy1/we_have_a_worki...
- muth02446 4y agoRE 3: Hot-code swapping seems to require a lot of tricky code. Are there compelling use cases that justify the implementation effort? The examples seem to be mostly focused on swapping out functions but I dot see how it could handle structural changes to data structures.
- Cloudef 4y agoHot-code swapping would guarantee a really fast compile times and maybe even "hot reload" of program while it's running. Do not underestimate how much this helps with developer productivity. I'm so tired of the compile times with large C++ codebases...
- cturtle 4y agoExactly! The idea is during development you use the super fast backend that supports hot code swapping. Then when you want to make a release build you use llvm and get all the optimization benefits of a longer compilation.
- OtomotO 4y agoUseful software is good. But it shouldn't be easy to program in memory errors.
- ArrayBoundCheck 4y agoYou mean rust shouldn't allow easy to write out of bounds errors? I'm still waiting for a flag to disable runtime bound checks
- OtomotO 4y agoI haven't mentioned Rust. I love KISS and Zig's simplicity especially but there is two sides to programming. The engineers perspective and the user perspective. I am both and prefer to have more paid hours and safer software ;)
- _vvhw 4y agoZig takes a different approach to safety. For example, Zig has checked arithmetic enabled by default in safe builds, can guarantee static allocation, and can recover from memory allocation failure. It depends on the definition of “safer software”, but for many domains where safety is a field [1], these are also important design decisions. [1] https://spinroot.com/gerard/pdf/P10.pdf https://spinroot.com/gerard/pdf/P10.pdf
- rowanG077 4y agoTo me simple and not getting in the way are complete opposites of one another. C and go are prime examples. The simplistic nature of the languages mean you can't express many obviously wanted things.