top | item 36331828

(no title)

detrites | 2 years ago

Are there advantages to this other than, I guess it being convenient? (Zig noob here.)

Eg, are there C to Zig ports that have had a demonstrable performance or memory-safety gain or something like that?

(Specifically, I mean over a C-lib wrapper compiled using Zig, as matching this case.)

discuss

order

jedisct1|2 years ago

The Zig compiler itself is a good example: https://kristoff.it/blog/zig-self-hosted-now-what/

"The new self-hosted compiler reduces memory usage 3x compared to the old C++ implementation"

dangets|2 years ago

Have to point out that this includes second system optimizations. Just porting C over to Zig won't give you that 3x reduction. For others, I also highly recommend the video linked in that blog post.