Sobes.tech
Senior

What would you change in Go if you were a maintainer?

sobes.tech AI

Answer from AI

If I were a maintainer of Go, I would consider the following improvements:

  • Enhancement of generics support — expand the capabilities of generic programming, add more flexible constraints, and improve syntax for better usability.

  • Built-in package manager — although there is go mod now, it could be made more integrated and user-friendly, with support for versioning and caching.

  • Extension of the standard library — add more utilities for working with modern data formats, such as improving support for JSON, YAML, protobuf.

  • Parallelism and asynchrony — improve tools for concurrency, possibly add more powerful primitives or enhance the goroutine scheduler.

  • Profiling and debugging tools — make them more convenient and informative to simplify performance optimization.

An example of a hypothetical syntax improvement for generics:

func Map[T any, R any](items []T, f func(T) R) []R {
    result := make([]R, len(items))
    for i, v := range items {
        result[i] = f(v)
    }
    return result
}

A more concise syntax for such functions could be added.

What would you change in Go if you were a maintainer… - sobes.tech