| > They need Go 2 with T and ?T - that would be nice language to use. Zig has basically been this to me. As a developer, writing Zig feels a lot like writing Go, except with basically all of the pain points addressed. - Zig has different pointer types for different things. The default pointer type points to exactly one value. It also has an optional pointer type as described. Arrays and slices are also pointers of sorts, and a graph in this post[0] does a good job describing the relationships between N element pointer types. - Zig has a built-in error type that is able to carry stack trace information. - Zig has a syntactic shorthand for the common `if err != nil { return err}` pattern: the `try` keyword. - Zig doesn't impose a garbage collected runtime. - defer can handle arbitrary expressions in Zig. They do not need to be wrapped in a closure or a function call. - The frankly weird interface system in Go is replaced with one of the more sane metaprogramming systems (I would argue that comptime is the most sane metaprogramming system in any C-like language). Other than that, Zig and Go are very similar. They both use repos for modules. They have roughly the same concurrency semantics. They have the same allocate+defer deallocate pattern (though more flexible in Zig, also due to scope bound vs function bound). They both treat errors as values. They both disallow things like operator overloading. They both have built in testing systems. Zig makes breaking changes in ways that Go doesn't anymore, but the breaking changes are always very thoughtful, and are clearly converging on something that is more flexible than Go (both in expressiveness, and in portability) but with a very similar mental model for developers. [0] https://ziggit.dev/t/array-and-slice-address-relationship/14... |