Live data from Hacker News

Zig is becoming more production-worthy

zigmonthly.org

21–30 of 73 posts

Re: Zig is becoming more production-worthy

#21
post #18

Earlier quoted context omitted.

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

I 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 ;)

Re: Zig is becoming more production-worthy

#22
post #14
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…

Erlang has had Hot-code swapping for decades

Dart is one of the only compiled languages that also does that (see Flutter).

Re: Zig is becoming more production-worthy

#23
post #14
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…

Erlang has had Hot-code swapping for decades

For every feature X, there is a programming language Y that has had it for decades.

It's not a question of inventing it, but rather of making it mainstream popular.

Re: Zig is becoming more production-worthy

#25
post #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…

Still no m68k, sh2, etc?

Re: Zig is becoming more production-worthy

#26
post #13

Earlier quoted context omitted.

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

Yes, why does that matter? It still shows that Zig's async/await is not colorblind.

Re: Zig is becoming more production-worthy

#27
post #26

Earlier quoted context omitted.

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

Yes, why does that matter? It still shows that Zig's async/await is not colorblind.

It seemed like most of your post was about not being able to use the two functions through pointers of the same type, but you can use the two functions through pointers of the same type, so maybe now you can delete a majority of your post and submit a retraction to Hacker News or something.

I'm not sure you are using the same notion of "colorblind" as most people. All that is claimed is that much application code can be *compile time generic* over the async-ness of the I/O functions it calls. Stepping up the requirements to being runtime generic introduces some difficult concerns about the different error sets of different I/O functions, but async vs. non-async can be handled as in the above gist or by writing like one switch statement.

Re: Zig is becoming more production-worthy

#29

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.

I’m excited for Zig’s possible future in embedded, too.

I currently use Nim for our firmware at work, because at the end of the day —compileOnly means it’s just C. It’s been excellent for ESP-IDF/FreeRTOS, but I’d love to see Zig tackle it as well.

One lovely side effect of using Nim is our “business logic” code is remarkably simple in the firmware, as I got PPPoS working nicely with our Cat-M1/LTE NB-IoT modem, so making network requests is literally a single line of standard-library Nim. Quite lovely!

The less we have to write C/C++ the better, and I’d love to see Zig and Rust do a great job in embedded-land!

Re: Zig is becoming more production-worthy

#30
post #14

Earlier quoted context omitted.

Erlang has had Hot-code swapping for decades

For every feature X, there is a programming language Y that has had it for decades. It's not a question of inventing it, but rather of making it mainstream popular.

I expect that erlang is still significantly more popular than zig.
Post reply on HN