3 ms·
> Go has a minimal type system, and is able to do much of Google's internal server side work. And yet Go is adding generics in 1.8. And I'm sure its type syste
by acchow 5y ago
> Go has a minimal type system, and is able to do much of Google's internal server side work.
And yet Go is adding generics in 1.8. And I'm sure its type system in another 5 years will be much more expressive than 1.8's. The community has long been saying that the minimal type system isn't enough.
- benhoyt 5y agoNit: they're adding Generics in 1.18 (not 1.8). Regarding "another 5 years": I'm not so sure. Go is very conservative about language changes. The type system didn't change at all from version 1.0 through version 1.17 (a 12-year period).
- morelisp 5y agoSome changes to nil accesses were made in 1.3. Tags were ignored in casts since 1.8. Overlapping methods were allowed in 1.14. New array pointer casts were added in 1.17. (Arguably, also type aliases in 1.9.) None of these are as significant as generics, but things do change.
- benhoyt 5y agoYes, you're right. Saying that it didn't change "at all" was perhaps overstatement. But those are all very subtle changes. I've coded Go daily for 3-4 years and never been affected by them, except the tags one -- I think I used that once (post 1.8). Not sure what you're referring to about the nil changes in 1.3 -- I didn't see anything about nil in the 1.3 release notes: https://go.dev/doc/go1.3 https://go.dev/doc/go1.3
- morelisp 5y agoApparently what I was thinking of was in 1.2; nil pointers used to give semi-meaningful (but useless) results when an address was taken of a subfield, like the usual C implementation of `offsetof`. https://docs.google.com/document/d/14DgGJKGQeBTNJDXo3YxnlSwv7ouRqvj7BMmZw17vWV0/pub https://docs.google.com/document/d/14DgGJKGQeBTNJDXo3YxnlSwv... It was before my time so I don't know what the practical impact was, just inherited some code that needed updating a few years ago... I have used tagless casting a half-dozen times to deal with JSON vagaries; and overlapping methods today almost constantly. Slice conversions to array pointers is too new to say generally but I had one use-case pretty much immediately.