Live data from Hacker News

Zig is becoming more production-worthy

zigmonthly.org

11–20 of 73 posts

Re: Zig is becoming more production-worthy

#11
post #7

Earlier quoted context omitted.

It 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…

RE 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.

Hot-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...

Re: Zig is becoming more production-worthy

#12

My benchmark for how serious a C replacement is, is when it successfully moves to not embedded and people actually use it. So far Rust has the smallest of inroads to embedded. I hope Zig makes it, but I’ve been down this road before.

A bunch of people on the discord care about and use the freestanding target, but I don't know much about this.

Re: Zig is becoming more production-worthy

#13
post #7

Earlier quoted context omitted.

Looks like it has nice syntax but it seems very very far from pushing state of the art, and that is totally fine.

It 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…

Zig's async/await isn't actually colorblind. [1] It just seems that way at first.

[1]: https://gavinhoward.com/2022/04/i-believe-zig-has-function-c...

Re: Zig is becoming more production-worthy

#14
post #7

Earlier quoted context omitted.

Looks like it has nice syntax but it seems very very far from pushing state of the art, and that is totally fine.

It 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…

Erlang has had Hot-code swapping for decades

Re: Zig is becoming more production-worthy

#15
post #11

Earlier quoted context omitted.

RE 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.

Hot-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...

Exactly! 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.

Re: Zig is becoming more production-worthy

#16

My benchmark for how serious a C replacement is, is when it successfully moves to not embedded and people actually use it. So far Rust has the smallest of inroads to embedded. I hope Zig makes it, but I’ve been down this road before.

Check out[0] and the Zig Embedded Group[1] - it's not well publicized right now, but there's actually quite a lot of work going on here & Zig seems quite suitable for embedded compared to some other languages.

> The standard library can be used unmodified on freestanding targets thanks to explicit allocation, comptime is extremely useful for things like precalculated lookup tables, and the unfinished C backend (part of the stage 2 compiler) means we’ll be able to target exotic architectures that LLVM can’t.

[0] https://allyourcodebase.com/embedded/

[1] https://github.com/ZigEmbeddedGroup

Re: Zig is becoming more production-worthy

#17
post #13
post #7

Earlier quoted context omitted.

It 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…

Zig's async/await isn't actually colorblind. [1] It just seems that way at first. [1]: https://gavinhoward.com/2022/04/i-believe-zig-has-function-c...

Hello, have you had a chance to check out the successful implementation of the program you attempted to write in that blog post? https://gist.github.com/sharpobject/49bd88416e68606d7812d609...

Re: Zig is becoming more production-worthy

#18
post #4

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…

Useful software is good.

But it shouldn't be easy to program in memory errors.

Re: Zig is becoming more production-worthy

#19
post #18
post #4

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…

Useful software is good. But it shouldn't be easy to program in memory errors.

You mean rust shouldn't allow easy to write out of bounds errors?

I'm still waiting for a flag to disable runtime bound checks

Re: Zig is becoming more production-worthy

#20
post #10

Earlier quoted context omitted.

> 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.

I wish I had known about D like a decade ago. I swear it was just too ahead of its time.

Its a great language. I suspect the problem was it tried to out java java (GC!) and it kind of tried to out C++ C++
Post reply on HN