News for hackers. Stuff that matters.
Re:Featherweight Go by enitihas on Sunday May 31, 2020 @11:08AM (#23370019)
They could have gone to 2001 technology way back. The Go FAQs say ->

> " We haven't yet found a design that gives value proportionate to the complexity, although we continue to think about it."

I mean if you are going to use 2001 technology, you could have found it long back.

Re:Featherweight Go by pjmlp on Sunday May 31, 2020 @11:42AM (#23370227)
Yet, they acknowledged it was a mistake not to consider them.

> In three years of Go surveys, lack of generics has always been listed as one of the top three problems to fix in the language.

https://blog.golang.org/why-generics

By the way, they could have gone to 1974 (CLU), 1973 (ML), 1983 (Ada), 1986 (Eiffel), 1988 (Modula-3), 1990 (Sather & BETA), 1998 (C++), 2007 (D), 2009 (Java & Delphi).

These are just the most well known examples, CS literature in SIGPLAN and IEEE has plenty more to choose from. I bet Google employees can afford the respective subscriptions.

When there isn't any political willingness, there isn't anything to be found.

Re:Featherweight Go by throwaway34241 on Sunday May 31, 2020 @01:19PM (#23370946)
You're commenting on a paper by expert programming language theorists describing a design that is both complex and (in some aspects) novel. Almost certainly an element of getting these people to work on it is Go's existing popularity, it's mentioned in the second sentence of the paper.

If I understand you right, you are suggesting that instead of doing what they are doing now, they should have just used an existing design from your list, right from the beginning?

Is there any specific design from your list that you think would have been good to use in Go? Or, do you think it would have been better to have a less-capable generics implementation available right away instead of a more-capable one later?

For example the one you mention the most (Java) requires code duplication to work with 32 and 64 bit floats. I think even the previous proposals that have been rejected for Go have at least had that ability.

Re:Featherweight Go by pjmlp on Sunday May 31, 2020 @03:00PM (#23371741)
Yes, right from the beginning. Java isn't the only language to chose from.
Re:Featherweight Go by throwaway34241 on Monday June 01, 2020 @12:29AM (#23375459)
It’s hard for me to believe that it is as simple as you suggest, considering the large amount of work put in by the Go team already, and the even larger amount of work put in by other programming language implementors to eventually arrive at various (different) design points. Work which often takes many years like C++ concepts.

Not to mention the open invitation for concrete proposals on how to add them Go.

You might find this post by one of the Go team members interesting:

https://news.ycombinator.com/item?id=9622417

Re:Featherweight Go by pjmlp on Monday June 01, 2020 @01:30AM (#23375685)
As proven by the lack of progress, that invitation has just political value, it allows posts like yours when these discussions take place.

For example, while Valhalla has taken several years so far, OpenJDK team has experimental builds that you can go and play around with value types in Java.

Where are the experimental builds for generics support in Go?

Re:Featherweight Go by throwaway34241 on Monday June 01, 2020 @10:11AM (#23378634)
> For example, while Valhalla has taken several years so far, OpenJDK team has experimental builds that you can go and play around with value types in Java.

Actually Valhalla is pretty interesting to think about. For what I'm currently working on, the inability to have a list of points without individually heap-allocating each one makes a language much more of a non-starter than the lack of user-defined parameterized types does.

Even back when Java was invented, there was plenty of prior art (going back decades) about efficiently representing a list of points in memory. Probably most of its predecessors could do it. Yet Java has lacked this basic ability for 25 years.

I even expect that when they eventually implement it it will work similarly to other popular languages, compared to Go which seems to be drawing on more recent developments (like concepts etc) for its generics design.

Despite this, I don't accuse the Java team of political machinations every time the topic comes up. Mainly because I don't believe that to be the case. Maybe they've prioritized a critical feature for me lower than I would like, but it seems like a substantial amount of work to implement because (like generics) it interacts with other language features in a complex way and (like generics) once they ship a design they will be stuck keeping backwards compatibility with it basically forever, so they only have one chance to get it right.

Re:Featherweight Go by pjmlp on Monday June 01, 2020 @03:59PM (#23383030)
The difference being that Java teams deliver language improvements and go on the stand acknowledging where to improve and setting roadmaps, Go not so much.

Even stuff like error handling improvements and type alias were almost shot down.

Re:Featherweight Go by throwaway34241 on Monday June 01, 2020 @05:40PM (#23384261)
> The difference being that Java teams deliver language improvements

Sure, I think it's fair to say they've focused a lot more on implementation and library changes and not language changes up until recently. Things like rewriting the compiler from C, improving code generation / escape analysis / GC, more platform / architecture support, improving the standard library, getting a reasonable package manager, etc.

So it seems a little premature to read some secret anti-generics stance into it (and it not just being a matter of priorities) since there were all these other areas that they were also way behind Java in.

After package management was in generics started showing signs of life again, so it all seems reasonably consistent with the Go team just wanting to clear other stuff off their plate first before tackling it. Hopefully we see it in a similar timeframe to major Java/C++ features now that it's being worked on more.

If there's any silver lining the actual proposals seem pretty ambitious, seems like they want to enable a lot more than just new type safe collections if they add the feature.

Re:Featherweight Go by philosopher1234 on Monday June 01, 2020 @03:09AM (#23376018)
This actually exists. There’s a go playground earlier in this thread worth generics support
Re:Featherweight Go by pjmlp on Monday June 01, 2020 @05:10AM (#23376605)
Which apparently hasn't been updated since August, 2019.

https://github.com/ccbrown/wasm-go-playground/tree/master/ex...

So this is the prototype used at the GopherCon talk.

Re:Featherweight Go by geodel on Sunday May 31, 2020 @09:17PM (#23374688)
Huh, if there are so many languages to choose from then people can choose one of those. Go will die its natural death. Where is the problem?
Re:Featherweight Go by pjmlp on Monday June 01, 2020 @01:31AM (#23375689)
The problem is that like with JavaScript in the browser, some of us do have to put up with Go when dealing with k8s, even if we rather not.

Secondly, I also kind of like Go, just see it as lost opportunity to have been with little more than a C like type system, even C has some genericity support in the meantime.

And whatever gets out of it, will be rather clunky as proven by late adoption in Java.

Re:Featherweight Go by etse on Sunday May 31, 2020 @02:08PM (#23371342)
They weren't convinced at the time. Now they feel compelled to act. How is this political?
Re:Featherweight Go by pjmlp on Sunday May 31, 2020 @02:59PM (#23371729)
They have been saying that for years now. Yet nothing to show other than an half finished code repository.
Re:Featherweight Go by hu3 on Sunday May 31, 2020 @08:06PM (#23374261)
Sorry someone forgot to tell them that they should follow your priorities.

On another note, every other Go thread has you and @pcwalton bashing Go. Makes me wonder if Go's success causes some sort of discomfort in some people. It's almost religiously guaranteed to have you both regurgitation the same crap over and over.

Re:Featherweight Go by bmurphy1976 on Sunday May 31, 2020 @09:52PM (#23374841)
Jesus! They are building software for themselves that prioritize the things they want and need, not some rando commenters on social media. They have every right to go about things their own way and succeed or fail based on that. So far it seems to be working and a lot of people are quite happy with the results (myself included). You seem to be particularly upset by this. Why is it so terrible?