News for hackers. Stuff that matters.
Re:3.5 Years, 500k Lines of Go by weberc2 on Friday March 24, 2017 @12:03PM (#13949830)
I think you and I have different definitions of 'magic'. I agree that Go does not have user-defined generics. I don't think of a few blessed data-structures as 'magic', but I won't argue semantics.
Re:3.5 Years, 500k Lines of Go by iopq on Saturday March 25, 2017 @08:02AM (#13955189)
I disagree with the concept of "blessed" syntax in the first place. I want users to write libraries just as powerful as the standard library.
Re:3.5 Years, 500k Lines of Go by weberc2 on Saturday March 25, 2017 @02:21PM (#13956883)
Philosophically, I agree. Pragmatically, generics seem to tempt programmers into writing really weird code in pursuit of some purist notions of terseness or reusability. After having used Go as well as lots of languages with generics, I will say that most Go programmers write very similar code for very similar problems, and it does make it easier for programmers to understand each other's code. There are a few times that user-defined generics would be handy, but those times are really very rare and I'm not convinced that adding generics to the language would be a net positive. In fact, I think the case for algebraic data types is stronger than the case for generics.
Re:3.5 Years, 500k Lines of Go by Filligree on Sunday March 26, 2017 @08:53AM (#13960515)
I need a tree. Sorted lg(n) structures are incredibly useful, and maps aren't sorted, but as it stands I can't have one without risking runtime type errors.

Static typing that doesn't cover common use-cases is worse then useless. It gets in your way.

Re:3.5 Years, 500k Lines of Go by weberc2 on Sunday March 26, 2017 @05:21PM (#13963371)
> I need a tree. Sorted lg(n) structures are incredibly useful, and maps aren't sorted, but as it stands I can't have one without risking runtime type errors.

I agree. See my previous comments.

> Static typing that doesn't cover common use-cases is worse then useless. It gets in your way.

I agree. Fortunately Go's static typing covers the most common use cases. If your primary deliverable is typesafe tree algorithms, Go might not be for you.

Re:3.5 Years, 500k Lines of Go by iopq on Saturday March 25, 2017 @10:38PM (#13958764)
I think algebraic data types and not having nil would be a huge improvement to Go. I would agree with you about generics if Go had a good macro or templating system. Having to generate code feels a bit silly.