Comment by jamiejquinn
3 months ago
Has it changed how you program in other languages? Because that to me is the true mark of a thought-shifting language.
3 months ago
Has it changed how you program in other languages? Because that to me is the true mark of a thought-shifting language.
The big thing I would say I actually learned and would intentionally apply to other languages is SIMD programming. Otherwise, I'd say it gave me a much clearer mental model of memory management that helps me understand other languages much more fundamentally. Along with getting my hands directly on custom allocators for the first time, a question that took me time to figure out but gave me a lot of clarity in answering was "why can't you do closures in Zig?" Programming in Zig feels very Go-like, and not having closures was actually one of the biggest hiccups for me. I don't think this really changed how I write in other languages, but definitely how I think about other languages.
Snap! I also played around with closures a tonne in Zig. Definitely possible but not... ergonomic. Haven't ended up using them much.
And agree with allocators; in C I always considered using custom allocators but never really needed to. Having them just available in the zig std means I actually use them. The testing allocator is particularly useful IMO.
Never used Go but if it's Zig-like I might give it a shot! Thanks!
I'll make a list of the things that both languages have in common that make them feel similar to me:
[0] https://ziglang.org/documentation/master/std/#std.Io.async
[1] https://go.dev/tour/concurrency/1
[2] https://ziglang.org/documentation/master/std/#std.Io.Queue
[3] https://go.dev/tour/concurrency/2
[4] https://ziglang.org/documentation/master/std/#std.Io.select
[5] https://go.dev/tour/concurrency/5