3 ms·
Introduction of generics would need a major version number change. It would involve not just a complier rework, but also a large stdlib rework.
by nine_k 5y ago
Introduction of generics would need a major version number change. It would involve not just a complier rework, but also a large stdlib rework.
- cube2222 5y agoThat is not true, generics are and have been planned for 1.18. They'll be introduced in a backwards compatible way.
- verdverm 5y agohttps://golang.org/doc/go1compat https://golang.org/doc/go1compat Generally, adding features does not break backwards compatibility. Note that ioutil was depreciated while it is unlikely to ever be removed
- 37ef_ced3 5y ago"The io/ioutil package has turned out to be a poorly defined and hard to understand collection of things. All functionality provided by the package has been moved to other packages. The io/ioutil package remains and will continue to work as before, but we encourage new code to use the new definitions in the io and os packages." It will never be removed, thankfully.
- nine_k 5y agoEven if the new stdlib is 100% backwards compatible (which I think is the goal), it still needs rework to make it use generics where appropriate.
- verdverm 5y agowhy does the stdlib need to adopt generics? That would break the Go1 promise. They would likely introduce new functions rather than changing existing ones. RE: what they did with the ioutil package