What's Zig got that C, Rust and Go don't have? (with Loris Cro)

This was released a week ago but I was busy with Handmade Seattle, so I’m sharing it now.

Since it was published, people pointed out two mistakes I made:

  1. Go has been able for a while now to export dynamic libraries. My knowledge was from before that time and I also got confused, thinking that you could not export C ABI functions at all, while in fact you can. That said, having a runtime still makes Go not a viable C replacement in the most direct sense of the expression.

  2. Zig used to only support pointer arithmetic by converting the pointer to an int, applying the operation, and then converting it back to a pointer. Since a few months ago, [*]T (and related) started supporting arithmetic. That’s a pointer type that you don’t touch directly often, as you normally would use a slice (ptr + len).

16 Likes

Loved it! Eloquent and to the point. You did great, Loris!

Also available via the Developer Sources podcast:

https://feeds.zencastr.com/f/oSn1i316.rss

I have also shared a blog post where I gave basic overview why ghostty terminal decided to use Zig instead of Rust or Go. I explained reasons that makes Zig the right choice for this project.

1 Like

Zig programming language is slowing becoming

missprint?..

Pardon me, English is not my language.

1 Like

Neither it is for me…
Did you mean “is slowly becoming”?

yeah, I updated the line thanks

1 Like