News for hackers. Stuff that matters.
Re:Fourteen Years of Go by evmar on Saturday November 11, 2023 @06:32AM (#38229390)
As a person who was initially disappointed by Go and who has come to love it, one of the biggest things I learned from watching it grow was the following:

As far as languages go, Go is relatively well-funded. You can of course imagine hypotheticals where there was more money behind it, but on the spectrum of PLs it's got more support than most. And further, I think the core developers who work on it like rsc and bradfitz are objectively great implementers. Despite that, the majority of complaints about Go are a lack of language features; you even see some in this thread.

In other words, a language with an above-average amount of effort and ability and 14 years behind it is still perceived as feature poor. But imagine how much more time it would have taken if they had taken on a larger scope, like if they had gone through all the complex design process for generics up front.

For me it is a great lesson on how important reducing scope is for shipping, and also how a reduced scope enables you to more judiciously choose what is important. If they had decided that features X, Y, Z were table stakes for their launch they would never have had the time to do the other things that I think have made Go great.

Re:Fourteen Years of Go by VBprogrammer on Saturday November 11, 2023 @06:59AM (#38229553)
I only have a small amount of Go experience but in my humble opinion I don't think the lack of features is due to lack of time or funding. In fact it would have probably been much easier to say yes to a bunch of features than to continually deflect and reject the demand for those. I'm sure anyone working with different stakeholders recognises this effect.

They have very deliberately tried to minimise the feature set in order to keep the language easy to learn. C++ is probably the canonical example of a language which hasn't kept the feature set tractable but I'd even argue that Python may have fallen into this trap in recent history.

Re:Fourteen Years of Go by asah on Saturday November 11, 2023 @07:14AM (#38229660)
Given AI assisted programming, I'm not sure how much any of this matters...
Re:Fourteen Years of Go by sakjur on Saturday November 11, 2023 @08:28AM (#38230122)
Complex language features have much more of a toll on reading code than they have on writing code. One example that I like to use is that while Go's lack of operator overloading is occasionally a nuisance, it means that you'll never have to dig deep to understand what "+" is doing on this particular line, since it'll always behave according to the core language rules.

I think the total cost of debugging hours often ends up being several magnitudes higher than the cost of development hours. At least for me, the process of debugging is something that involves scanning the code to load up my brain with as much possibly relevant context as I can and then try to analyze what parts of that might explain the seen behavior. A carefully designed language should help to both minimize the size of that context and the amount of linguistical gotchas that are part of it.

If I'd use an AI assistant, that lets me ask more pointed questions. Wouldn't that improve the assistance the AI can provide?

Re:Fourteen Years of Go by merb on Saturday November 11, 2023 @09:02AM (#38230352)
That is not necessarily true. Especially the error handling makes it really awkward to read go code. A lot of languages with an expressive type system do look aweful when looking at methods. But the same thing can be done with go methods. Writing hard to understand go code is just as easy as say with scala or rust
Re:Fourteen Years of Go by sakjur on Saturday November 11, 2023 @09:22AM (#38230508)
Oh, absolutely. I don't mean to claim Go as an outstanding example of a well-designed programming language. I appreciate Go's language design, but I also similarly appreciate Scala, Rust, Java, Erlang and various other programming languages I've interacted with.

My point is more against the notion that AI assistants would make careful language design any less important than in favor of any particular language. The popular programming languages all have their own virtues and drawbacks (and the unpopular ones almost certainly have at least their own drawbacks).

Re:Fourteen Years of Go by randomdata on Saturday November 11, 2023 @12:57PM (#38232674)
> Especially the error handling makes it really awkward to read go code.

Go does not have error handling at all, just general value handing. What do you find awkward about its value handlers? They are essentially the same as every other C-style language out there.

Re:Fourteen Years of Go by VBprogrammer on Saturday November 11, 2023 @01:17PM (#38232903)
It's certainly not difficult to understand Go error handling. But it does take up quite a bit of real-estate. I think more importantly for me, it's too easy to forget an error check. Having primitives which make error checking painless and validated by the compiler would be nice.
Re:Fourteen Years of Go by randomdata on Saturday November 11, 2023 @02:16PM (#38233513)
> it's too easy to forget an error check.

I never understood this. I do understand it is easy to forget to handle an error like it is easy to forget to handle a distance or temperature. Humans will make mistakes.

But nobody laments about how they forget to handle distances or temperatures, or cry for special constructs to ensure that they don't screw up their distance and temperature handling. What is it about the word error that sends developers into a tizzy?

Why would we want a solution that only works for errors and not for values of all kinds?

Re:Fourteen Years of Go by vacuity on Saturday November 11, 2023 @03:31PM (#38234212)
Because handling errors is important for complex programs. Whether errors-as-values or exceptions or aborts are the best option, being able to write a program that handles errors well makes it that much more robust. Don't want some weird behavior happening when the program should've noticed an error and dealt with it somehow.
Re:Fourteen Years of Go by randomdata on Saturday November 11, 2023 @05:02PM (#38235014)
Handing values is important for all programs. You don't want some weird behaviour happening in any case. If you are writing a system that turns on a heater when the temperature falls below freezing, you're going to have a really bad time if you forget to handle the temperature.

So, yes, it makes sense to have constructs that can help with that problem, but it would be weird to have such constructs only for what a human considers an error condition. You would want that for every case that needs to be handled.

Otherwise you have to resort to testing, and if you accept that testing is good enough to ensure that you don't forget to check the temperature, then it also good enough to ensure that you have checked an error. There is nothing special about the error case. It's just another state like any other.

Re:Fourteen Years of Go by vacuity on Saturday November 11, 2023 @05:16PM (#38235135)
Well, I think that's why a lot of people are disappointed that Go doesn't quite have sum types, because sum types do increase expressivity around values in general. That they improve error handling is just one application.
Re:Fourteen Years of Go by randomdata on Saturday November 11, 2023 @05:40PM (#38235320)
There seems to be no consensus as to what sum types actually means, but the most popular definition I find in my travels is: Tagged unions.

While Go might benefit from tagged unions, I'm not sure they actually help in any way with errors. There is no other type at play, so there is nothing to union with. Maybe if you have different kinds of errors you might union different error types, but even just one type of error state is prone to the forgetting to handle it problem.

But perhaps you are of another sum type school? Perhaps one of the other sum type definitions are useful here?

Re:Fourteen Years of Go by vacuity on Saturday November 11, 2023 @05:43PM (#38235343)
Tagged union is a good definition. I was thinking of Rust's Result type, which has Ok(some value) and Err(some value) variants.
Re:Fourteen Years of Go by randomdata on Saturday November 11, 2023 @05:58PM (#38235453)
Right. See that doesn't help, at least not in the context of Go without any other modifications. Logically, you can reduce that Result state to a simple boolean (Ok = true, Err = false). But the bool type in Go is prone to the very same problem.

It doesn't matter how many type layers you add. The problem is that there is nothing in the language that enforces handling of values, no matter what type that value might be.

Re:Fourteen Years of Go by vacuity on Saturday November 11, 2023 @06:23PM (#38235626)
Yes, manual tagging doesn't provide type safety. That's why I said some people are disappointed that Go doesn't have sum types. There isn't even a convoluted workaround either, at least not a full one.
Re:Fourteen Years of Go by randomdata on Saturday November 11, 2023 @07:09PM (#38235893)
It is not so much a matter of lack of type safety, it is forgetting to implement an application requirement.

Even an advanced type system capable of formal proofs isn't going to help you if you've forgotten the requirement when defining the types. And if you are using a language with a lesser type system (Go, Rust, any language you are likely to use in the real word), and haven't forgotten the requirement, then you would have encoded that knowledge in tests instead, making the forgetfulness in implementation ultimately immaterial. After all, there is no practical difference between learning that you forgot to implement logic by the compiler telling you or the test suite telling you.

So, we can infer that the OP is talking about where one straight up forgot about the requirement from start to finish. I'm skeptical that there is any technical solution to that problem, but sum types most certainly isn't it.

Re:Fourteen Years of Go by vacuity on Saturday November 11, 2023 @07:27PM (#38236006)
There is a point at which even dependent typing won't save you, but sum types are a useful tool to reduce negligence. Don't let perfect be the enemy of good.
Re:Fourteen Years of Go by randomdata on Saturday November 11, 2023 @07:45PM (#38236126)
Sum types are useful tool, but they are not helpful in this particular case. There is nothing about sum types that would help avoid this problem in the slightest. Perfect need not be the enemy of good, but good is not equivalent to not even trying.

This is not a general "wouldn't it be nice of Go had..." thread. We are talking about a specific problem.

Re:Fourteen Years of Go by vacuity on Saturday November 11, 2023 @08:04PM (#38236239)
I'm not really sure what your point is then. We should have comprehensive tests and therefore error checking isn't special compared to other programming mistakes? I think we should both have tests (don't skimp on them if given time, of course) and use tools like sum types to write more robust programs from the get-go. Errors can even be treated like other values using sum types; that raises the bar universally instead of just improving error checking.
Re:Fourteen Years of Go by randomdata on Sunday November 12, 2023 @12:43PM (#38242374)
The point is to stay on topic. In what way do you believe sum types solve the problem being discussed?
Re:Fourteen Years of Go by vacuity on Sunday November 12, 2023 @01:12PM (#38242629)
If you're going to invoke some abstract "the programmer doesn't know what they're doing" situation, I'm not sure how to continue this discussion. Even testing may not help in that case. Things are going to slip through the cracks. Having features like sum types is a way to generally reduce the likelihood of such semantic errors.

Besides, the original topic was that Go doesn't make its error handling very foolproof. Sum types help with that and don't make error handling special, so I really don't see your point. Why not write everything in Brainfuck then? Everything is uniform and simple. Well, it's simple to the point that it's way too easy to make mistakes.

Re:Fourteen Years of Go by randomdata on Sunday November 12, 2023 @03:51PM (#38243970)
The original topic was, stated quite explicitly, that it is easy to forget to handle errors in Go. There is nothing about sum types, as defined, that addresses that concern.

Like we established in my very first comment, well before you even showed up, the handling forgetfulness problem exists for all types. That would include a hypothetical (tagged) union type. I did question if you were using some other definition of sum types, as there isn't a great consensus on what sum types actually mean, but you did confirm you were thinking of tagged unions...

But it must be that you didn't actually mean tagged unions. What is the definition of sum types that you are using here that would help with the stated problem?

Re:Fourteen Years of Go by vacuity on Sunday November 12, 2023 @05:21PM (#38244704)
There may be a misunderstanding. I say "sum type" to mean something along the lines of Rust's enum: a value stores both a tag and its data, and pattern matching distinguishes the variants (like a switch statement). It's a tagged union where the interpretation of the tag is managed by the compiler. The underlying value can't be used without extracting the variant with pattern matching. Even if the success and failure variants both contain an integer, you can't add an integer with this value.
Re:Fourteen Years of Go by randomdata on Monday November 13, 2023 @10:25AM (#38251241)
And how do you think that solves the problem? Consider:

   func foo() error
With the programmer forgetting to handle the error:

   foo()
Now imagine that Go received some kind of hypothetical Result type that matches what you describe. The foo function is updated to use it.

   func foo() Result[error]
But the problem remains... The compiler still isn't going to tell you that you forgot to handle the error.
Re:Fourteen Years of Go by vacuity on Monday November 13, 2023 @05:13PM (#38256095)
So you're saying the programmer forgets to use the return value at all. There are linters, documentation, and basic common sense. This is not at all a relevant issue, or else there are serious issues with the programs you see. Why are you discussing whether Go's error handling needs improvement if your imagined programmer can't even program? Well, I've spent enough time on this thread.
Re:Fourteen Years of Go by randomdata on Monday November 13, 2023 @07:26PM (#38257240)
> So you're saying the programmer forgets to use the return value at all.

That's what the original commenter said. Logically, how else could you forget to handle the error? The compiler will bitch and moan if you do capture the result and then don't do anything with it. You did take the time to read the thread before replying, yes?

> This is not at all a relevant issue

It must be, else how do you explain the many comments you wrote trying to explain how sum types solves the problem? Even while I continually told you they don't.

> Why are you discussing whether Go's error handling needs improvement if your imagined programmer can't even program?

I said that it doesn't need improvement because in practice your tests will catch the problem immediately anyway. I even said that it is probably fundamentally impossible for there to be technical solution to the problem.

And the rest of the time was telling you that sum types cannot solve the problem, despite your constant urging. I am still not clear how you think sum types solve the problem.

> Well, I've spent enough time on this thread.

Are you sure you spent any time on this thread?

Re:Fourteen Years of Go by erik_seaberg on Saturday November 11, 2023 @11:14PM (#38237235)
An error signals that a non-error value you were relying on will not be available. Control flow should nearly always change in response to that, often drastically. That’s why a language should provide a caller-controlled non-local exit from a futile chain of calls. Many languages only do that for errors, and it’s not a major limitation when users can define errors.
Re:Fourteen Years of Go by randomdata on Monday November 13, 2023 @10:14AM (#38251091)
> An error signals that a non-error value you were relying on will not be available.

Except the non-error value should always be available, even if that means relying on the zero value. Zero values should be useful. An error state is an independent state. It should also be useful without any other values.

While the caller may choose to use the error state to make decisions about other state, it is faulty API design to force that upon the caller.

Re:Fourteen Years of Go by erik_seaberg on Tuesday November 14, 2023 @12:50PM (#38266788)
Many domains have no meaningful zero value. If “getUserByID” returns a fake user, anything you do with him will be incorrect, if you don’t panic and die (as zeroes of builtin types often do).
Re:Fourteen Years of Go by randomdata on Friday November 17, 2023 @08:43AM (#38303415)
> If “getUserByID” returns a fake user

Logically, getUserByID returns nil when there is no user, not a fake user. The caller can then check for its nil-ness without needing to consider the error value. nil is a useful value. For better or worse, nil is how Go convention represents the absence of a value. In fact, convention sees error also rely on nil to be useful in the very same way.

It's funny how people completely forget how to write software as soon as they see the word error. Why is that?

Re:Fourteen Years of Go by usrbinbash on Sunday November 12, 2023 @10:03AM (#38240660)
> it's too easy to forget an error check.

How? What exactly makes this "too easy"?

In regards to a functions error returns, there are exactly two things a caller can do

    func foo() (int, error) {
        // foo code
    }

    // explicitely ignore the error
    foo()
    val, _ := foo()
    
    // handling the error
    val, err := foo()
    _, err := foo()
If I do the latter, I cannot ignore `err`. If I do, the compiler yells at me because there is now an unused value in my code.

If I do the former, then I made the conscious choice that the error doesn't matter to me. Yes, this goes for `foo()` as well, because Go makes it exceedingly clear that errors are just return values, and that call ignores all returns.

Re:Fourteen Years of Go by VBprogrammer on Monday November 13, 2023 @06:50AM (#38249211)
Unless things have changed, if the return is only a single error value then it's possible to overlook capturing it.
Re:Fourteen Years of Go by mejutoco on Saturday November 11, 2023 @11:26AM (#38231676)
I think you will like this quote :)

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan

I dont know if it applies to language features, though.

Re:Fourteen Years of Go by xigoi on Saturday November 11, 2023 @12:28PM (#38232352)
> it means that you'll never have to dig deep to understand what "+" is doing on this particular line,

Instead you'll have to dig deep to undershnnd what "Add()" is doing on this particular line. How is that any different?

Re:Fourteen Years of Go by thunky on Saturday November 11, 2023 @01:23PM (#38232976)
Because parent is taking about operators like "+" and how it can be confusing not knowing if a function call is behind it. This is different from obvious functions like "Add()".
Re:Fourteen Years of Go by xigoi on Saturday November 11, 2023 @01:26PM (#38233008)
How is “Add()” any different from “+”? They're just two different names for the same thing – a function that adds two numbers or other objects.
Re:Fourteen Years of Go by thunky on Saturday November 11, 2023 @01:32PM (#38233064)
Because if the language doesn't allow overloading (which is the context of this thread) then "+" will always be implemented by the language. That's a big difference.
Re:Fourteen Years of Go by usrbinbash on Sunday November 12, 2023 @10:19AM (#38240852)
> They're just two different names for the same thing

No, they are not. One is a function, the other is an operator.

An operator has implicit meaning. I know with absolute certainty, that `+` is supposed to mean that 2 things are added to one another.

`Add()` is a function. Its name may or may not indicate what it is actually doing. Even if it indicates it, it may not be obvious how it is doing it's thing, or how good the indication is. Example: If Add takes as first argument a list and as second argument an integer, does it append the integer to the list? Does it add it to every element of the list? Does it sum the list and add the integer to the result? All these things could be meant by "Add"-ing an integer to the list. Does it have side effects?

I don't know, and I don't expect to know, until I look at `Add()` (or at least read it's documentation).

That is the big difference between operators and functions; With operators, I expect to know what it does, without looking it up. And that's also the big problem with operator-overloading, because as soon as a language supports that, that assumption flies out the window.

Re:Fourteen Years of Go by VBprogrammer on Sunday November 12, 2023 @09:26AM (#38240310)
> Go's lack of operator overloading is occasionally a nuisance, it means that you'll never have to dig deep to understand what "+"

It's funny, in 10 years of writing Python professionally I can only think of one occasion when I had to dig into what a __add__ operation did (a Money library which didn't special case 0 meaning sum didn't work as you might hope).

I think it's probably because python has a pretty comprehensive standard library which gives reasonably consistent examples of where to use them.

Re:Fourteen Years of Go by speed_spread on Saturday November 11, 2023 @08:33AM (#38230156)
A line of code is written once but read ten times. AI making it cheap to write will only increase the maintenance burden. And if you need AI to maintain AI written code, you'll have gained nothing but a new dependency in your toolbox.
Re:Fourteen Years of Go by bananapub on Saturday November 11, 2023 @09:56AM (#38230804)
> A line of code is written once but read ten times

really? source? My counter-assertion is that I'd guess most code is basically never read - most of it is in ad-hoc PHP CMSes or VBA scripts.

Re:Fourteen Years of Go by speed_spread on Saturday November 11, 2023 @10:57AM (#38231417)
My assumption about something coded in Go is that it was expected to be persistent and actively maintained. I agree that AI is good for one-off scripting purposes.
Re:Fourteen Years of Go by bayindirh on Saturday November 11, 2023 @11:16AM (#38231578)
If you can’t design your program in your head, and can’t trace the code by reading it, neither the compiler nor AI (i.e.: code derived from other people’s code) won’t help you.

I like Go in that regard. You can keep the whole feature set in your head, and read/simulate the code without getting confused, and I’m telling this is a C++ fan.

Re:Fourteen Years of Go by asah on Saturday November 11, 2023 @02:44PM (#38233792)
The downvoting is so cute. Given the pace of AI development, y'all really think we're going to be typing individual lines of code in languages like golang? Seriously?

Come on HN, you're better than this.

Re:Fourteen Years of Go by usrbinbash on Sunday November 12, 2023 @10:25AM (#38240921)
Yes, I do expect that, and I will continue to do so, unless someone can show me a breakthrough in language modeling, that isn't just a big-data derived stochastic parrot.

Being able to write code because I have seen lots of it, and know what code is supposed to look like, and being able to write code because I understand what code does, and what it does in context, are 2 completely different things.

Re:Fourteen Years of Go by mseepgood on Saturday November 11, 2023 @07:58AM (#38229926)
> They have very deliberately tried to minimise the feature set

I thought this was common knowledge. They made whole conference talks about it.

Re:Fourteen Years of Go by vram22 on Saturday November 11, 2023 @10:51AM (#38231363)
Yes, and Rob Pike has a post about it on his blog, command-central.com, IIRC.
Re:Fourteen Years of Go by teodorlu on Monday November 13, 2023 @03:37AM (#38248205)
Might I ask for a link?

I searched around, but didn't find anything. Perhaps the title is something different than "go minimal feature set".

Re:Fourteen Years of Go by Gys on Tuesday November 14, 2023 @08:03AM (#38262807)
Re:Fourteen Years of Go by raverbashing on Saturday November 11, 2023 @07:12AM (#38229640)
Yeah true

For me the issue of Go is that it has a focus on backend services and doesn't try going much further than that. (And also it's probably a bit too plan9'ish)

At the same time it's good that it has a focus, because that's what made it get where it got

Re:Fourteen Years of Go by pansa2 on Saturday November 11, 2023 @07:12AM (#38229642)
> on the spectrum of PLs it's got more support than most

Go definitely has much more funding and developer hours put into it than open-development languages like Python - that’s got to be a good thing for the language.

On the other hand, would you choose to build a long-term business on top of Go, given that all that support comes from one company? What if Google decide that maintaining Go is no longer in their best interest?

Re:Fourteen Years of Go by usrbinbash on Saturday November 11, 2023 @07:27AM (#38229741)
> On the other hand, would you choose to build a long-term business on top of Go

a) Absolutely and b) already done.

Go is stable. The language is battle tested. It works as advertised. It is open source. Even if google pulled all funding (unlikely, since alot of their architecture seems to use it), the language is maintainable.

And btw. Languages don't have to continuously evolve to remain viable. Modern languages seem to indicate otherwise, but that behavior is what Go actively avoids; adding everything and the kitchen sink into the language as soon as some other language has it. If Go showed one thing, it is that PLs don't need to add as many features as possible.

And just to prove that point: C is still a top rated language in terms of usage. When was it last updated? C17 came out in 2017, and did not add new features. It superseded C11, which came out 6 years before that, also mainly standardising things that were already de-factos in most compilers. Before that was C99 in 1999, and before that is only ANSI-C and K&R.

Re:Fourteen Years of Go by crabbone on Saturday November 11, 2023 @09:41AM (#38230668)
There's a lot of misinformation, bad arguments and bad conclusions in this post. Let's pick it apart.

> Go is stable.

But, past isn't a guarantee of the future. It was stable before, but who's to say it will be in the future? The fact that it's "owned" by a single entity should make you scared that it wont, because the whim of that entity is what can change any property of the language.

Additionally, Go has no standard, no alternative implementations to speak of. All of this should have you concerned for the future (but you seem to ignore the obvious dangers).

> It works as advertised.

It's the opposite. Languages with single (or one primary) implementation advertise how they work. Go is implement first document later language. The public discussion is for show because public doesn't control how things are being implemented. The Go dev. team may listen to everyone's opinion, nod in agreement, and do something else entirely, and nobody will hold them responsible for the discrepancy.

> the language is maintainable.

By who? How did you come to this conclusion? There's only evidence to the contrary of your argument. There isn't any other organization that's interested in maintaining Go if Google were to go away. At least nobody expressed such an intention publicly.

> Languages don't have to continuously evolve to remain viable.

This is demonstrably false. Hardware changes, operating system interfaces change. If you don't keep up with these changes, eventually your language becomes irrelevant. To further illustrate this point: today, versions of Python 3.7 and older cannot be built from source on modern Linux with current GCC. Python's dependencies on libffi and libssl are incompatible with their current interfaces, and so the language can only be built with older libraries (but then the operating system needs to use the older ones too) or statically linked with those libraries, but in case of libffi that doesn't help because it will not work for its intended goal. And the further back you go, the less likely it is that you will be able to build and use any version of Python. Bet, the same is true for Go.

> When was it last updated? C17 came out in 2017

C standards don't get implemented on the year they are released. Bet you Microsoft probably doesn't fully implement this standard. (I don't know, it's a guess based on past experience using their tools).

In more broader terms, I have no idea why did you bring C into this argument. C is an entirely different language in terms of governance, support, standardization... It's basically all things that Go isn't. Standards and multiple interested vendors ensure the survival of the language. The whole argument against using Go for long-term projects is that it's not like C. You trying to point out that C is used successfully for long-term projects doesn't help to show that Go would too. If anything, you should suspect that it won't, because Go is the opposite of C.

Re:Fourteen Years of Go by Wowfunhappy on Saturday November 11, 2023 @09:59AM (#38230838)
> This is demonstrably false. Hardware changes, operating system interfaces change. If you don't keep up with these changes, eventually your language becomes irrelevant. To further illustrate this point: today, versions of Python 3.7 and older cannot be built from source on modern Linux with current GCC. Python's dependencies on libffi and libssl are incompatible with their current interfaces, and so the language can only be built with older libraries (but then the operating system needs to use the older ones too) or statically linked with those libraries, but in case of libffi that doesn't help because it will not work for its intended goal. And the further back you go, the less likely it is that you will be able to build and use any version of Python. Bet, the same is true for Go.

If Python 3.8+ didn't exist, how difficult would it be to update cypthon to target newer GCC? Correct me if I'm wrong, but my sense is this would be a relatively minor maintenance task. No one has updated Python 3.7 because there is no need (and frankly the Python foundation would probably prefer to nudge everyone to update).

Re:Fourteen Years of Go by usrbinbash on Saturday November 11, 2023 @10:55AM (#38231395)
>There's a lot of misinformation, bad arguments and bad conclusions in this post. Let's pick it apart.

No, there really isn't, but I had fun answering :-)

> But, past isn't a guarantee of the future. It was stable before, but who's to say it will be in the future?

Whos to say C will be stable tomorrow? Well, the fact that things like GCC are standards unto themself, even without any official governance (Which C has in addition). Its the same for Go.

If anyone was to change that, all I have to do is check out an earlier version of this open source language, and use that. And since tons of code rely on this, that is what would happen.

Languages don't become unstable because they suddenly change trajectory. This rarely ever happens. Language instability requiring constant evolvement and developer effort (both from the languages devs, as well as the languages users) is the result of feature upon feature getting heaved upon a language, along with codebases relying on these features, necessitating constant maintenance effort to keep up to date.

Go, explicitly, has a completely different design trajectory. And as a result, Go code that was written in Go 1.8 will still compile today.

> Go has no standard

Here is the official spec of the language: https://go.dev/ref/spec

Which is a de-facto standard, even according to this listing: https://en.wikipedia.org/wiki/Comparison_of_programming_lang...

Btw. if you look at the listing, MOST languages, including commonly used ones, don't have an international or national standard. Many don't even have a de-facto standard. Among them are many tried and battle tested languages.

> and nobody will hold them responsible for the discrepancy.

Anyone unhappy with the implementation is free to fork the project and take it in a different direction. He who writes the code makes the rules. If people are unhappy with that, they can fork, or use another language. And people seem to be very happy with the language: https://madnight.github.io/githut/#/pull_requests/2023/3

> By who? How did you come to this conclusion? There's only evidence to the contrary of your argument.

What evidence is there for the assumption that Go would vanish if Google lost interest?

> This is demonstrably false.

No, it is not, as demonstrated by the example I gave regarding C. The language didn't change much from C99, which itself wasn't that big a step away from ANSI-C. C99 was a quarter century ago, and C remains one of the most used languages in existence.

> To further illustrate this point: today, versions of Python

I am pretty sure I never used Python as an example for this. If you disagree, quote where I did.

> In more broader terms, I have no idea why did you bring C into this argument.

For a very simple reason: To show that a language that is mostly feature-freezed, and so stable that I can run a modern compiler on decades-old unchanged code, and still get a runnable executable, can be, and are, incredibly successful. Go has been called "C for the 21st century", and for everything other than System-Programming, that statement holds true.

Re:Fourteen Years of Go by vacuity on Saturday November 11, 2023 @03:34PM (#38234240)
> Go, explicitly, has a completely different design trajectory. And as a result, Go code that was written in Go 1.8 will still compile today.

Just saying, Go is far from the only language that values backwards compatibility.

Re:Fourteen Years of Go by usrbinbash on Sunday November 12, 2023 @06:05AM (#38239203)
That's true, but Go's backwards compatibility is a side-effect of another design goal, one that many contemporary languages do not share: Keeping the language small and stable, and actively trying not to add shiny new features.

Many languages have pretty good or even excellent backwarsds compatibility. In languages that incude as many features as possible, that quickly becomes a burden that requires it's own fair share of developer attention.

Re:Fourteen Years of Go by vacuity on Sunday November 12, 2023 @09:14AM (#38240218)
Hm, that's a fair point. I personally don't prefer Go's style, but I'm growing to appreciate that it works for others.
Re:Fourteen Years of Go by pjmlp on Saturday November 11, 2023 @03:46PM (#38234334)
> The language didn't change much from C99, which itself wasn't that big a step away from ANSI-C. C99 was a quarter century ago, and C remains one of the most used languages in existence.

The library and compiler specific extensions did.

Besides, a language that nowadays only matters on UNIX clones and embedded development, naturally doesn't need to keep changing all the time, anyway C23 is around the corner.

Re:Fourteen Years of Go by saturn_vk on Saturday November 11, 2023 @11:32AM (#38231720)
I can think of at least 2 more implementations besides the official one. So I'd have to assume that the misinformation you speak of us coming from you
Re:Fourteen Years of Go by dang on Tuesday November 14, 2023 @04:39PM (#38270168)
Can you please not post in the flamewar style to HN, regardless of how wrong someone else is or you feel they are? It destroys the curious, thoughtful conversation that we want here, and you can make your substantive points without it.

If you wouldn't mind reviewing https://news.ycombinator.com/newsguidelines.html and taking the intended spirit of the site more to heart, we'd be grateful.

Re:Fourteen Years of Go by pjmlp on Saturday November 11, 2023 @03:44PM (#38234322)
This year, C23 will be ratified in January 2024, and there are enough features on the pipeline for C to be "C++ without classes".
Re:Fourteen Years of Go by SubjectToChange on Monday November 13, 2023 @02:14AM (#38247781)
It is open source. Even if google pulled all funding … the language is maintainable.

First of all it’s not just an issue of maintaining the language itself, but all of the associated tooling as well. Second of all, it’s not just that Google could pull support, but that Google could choose to prioritize their own needs over the rest of the community.

And btw. Languages don't have to continuously evolve to remain viable. … If Go showed one thing, it is that PLs don't need to add as many features as possible.

Go advocates say this often enough that it’s honestly beginning to come off as an insecurity. And I would be concerned about cultivating a community around “less is more, Go should only evolve as a last resort”.

Moreover, keep in mind that the primary selling point of Go were goroutines. At the time Go was particularly well suited to exploit a gap left by other languages. Fast forward to today and Go has become a significantly less compelling option.

And just to prove that point: C is still a top rated language in terms of usage. When was it last updated?

Projects written in pure ISO C are relatively few and far between. In fact many high profile C projects are exclusively tied to one or two compilers. Furthermore, ISO C has delegated a lot of functionality to external standards like POSIX instead of giving them first class support, not to mention the plethora of nonstandard language extensions found in many compilers[0]. In other words, ISO C has stagnated, albeit C23 is a big update, while the C language has evolved.

Anyway, as I see it, golang is basically a dead end as a PL. It doesn’t interface well with other languages, it doesn’t substantially differentiate itself as a PL, any nuance you encounter with the language is likely to never be fixed, it’s a poor language for writing great libraries and/or abstractions, etc. That said, plenty of great businesses have been built on top of languages like PHP, so it can definitely work. Personally I don’t expect anything like another kubernetes coming out of the language again.

[0]https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html

Re:Fourteen Years of Go by usrbinbash on Monday November 13, 2023 @06:58AM (#38249255)
> First of all it’s not just an issue of maintaining the language itself, but all of the associated tooling as well.

Which is part of the language core, and distributed alongside it.

> Google could choose to prioritize their own needs over the rest of the community.

Which they would do why, and how specifically? This isn't a server or a database, it's a PL. What specific scenario do you see for such a change? And even in that unlikely scenario, the language is open source, and the community can fork it.

> Go advocates say this often enough that it’s honestly beginning to come off as an insecurity.

How anyone choses to interpret this message, is their business. We say it because it's true.

> And I would be concerned about cultivating a community around “less is more

Why? It seems to work exceedingly well. And there are more than enough languages following the "everything-and-the-kitchen-sink" approach already. What benefit would there be in trying to secure a tiny portion of a niche that is already overfilled?

> that the primary selling point of Go were goroutines

They were one of the selling points. What anyone sees as "the primary" point is a matter of opinion. For many people, the primary selling point of Go is the simplicity of the language.

> Fast forward to today and Go has become a significantly less compelling option.

Really? What other mainstream language uses CSPs with the same syntactic ease and core-language support?

> Anyway, as I see it, golang is basically a dead end as a PL.

What data specifically supports that point of view? Because, going by usage metrics, like code contributed, Go is easily among the most used languages, and still growing.

If you have different metrics, please, do share them here.

Re:Fourteen Years of Go by TeddyDD on Saturday November 11, 2023 @07:32AM (#38229785)
Without any hesitation. Google won't kill Go given how much they use it internally. Even if they do, someone else will take over. Additional benefit of choosing Go over Python is lack of breaking changes in minor releases.
Re:Fourteen Years of Go by crabbone on Saturday November 11, 2023 @09:54AM (#38230782)
What if Google goes under? What if the next big lawsuit against Google makes it disown portions of its business, and they say goodby to Go as a result? (That actually happened to IBM for example, at the time they were virtually the sole provider of all software services in the world -- that's more or less why and how we have software industry today).

What makes you so convinced "someone" will take over? Is there anyone who offered themselves in such capacity? I've heard a lot of people making similar bold claims about Python 2.X -- sure, someone will step in and maintain Python 2.X indefinitely... Well, no one did.

Re:Fourteen Years of Go by betaby on Saturday November 11, 2023 @11:06AM (#38231483)
> What if Google goes under? What if Sun goes under? Oh, wait...

> and they say goodby to Go as a result? and they say goodbye to Java as a result?

> and maintain Python 2.X indefinitely.. Someone said that? Anyway 20 years of 2.x branch is pretty impressive.

Re:Fourteen Years of Go by crabbone on Monday November 13, 2023 @08:06AM (#38249679)
You took just one example. And, although there weren't many cases of proprietary languages or almost-proprietary languages dying in recent years, there are, of course, examples of them dying. You just picked one where this didn't happen...

So, ActionScript would be one example. Dylan would be another. There are probably many more of lesser known proprietary languages that died never making the news.

And, looping back to the original subject: parent believes there's no danger in using an almost-proprietary language, where the evidence is that owners of proprietary languages do kill them every now and then. Do they do it all the time? -- well, no, but I didn't claim anything like that...

---

As to your observation about Python 2.X -- you didn't understand in what context the argument was made. C, or any other language with a standard is warranted the lifetime that's as long as humanity is able to read and understand the standard as well as implementing it. So, 20 years will be essentially insignificant compared to the longevity of a language with a published standard.

Please don't confuse this to me advocating for every language needing a standard. Writing one severely restricts what a language can offer, while at the same time, immortalizing potentially harmful features. Going back to see, we wish today that all the str* stuff would be gone, or stuff like atoi()... but that's not an option anymore, because this stuff made it into the standard. Languages w/o one can shed their skin and remove bad decisions. But, this same feature makes them less viable for long-term projects.

Re:Fourteen Years of Go by usrbinbash on Saturday November 11, 2023 @12:35PM (#38232411)
> What if Google goes under?

Then Go is still an Open Source Project with massive community support, that everyoen is free to form and extend or maintain by himself.

> What makes you so convinced "someone" will take over?

Because tens of thousands of projects depend on the language? Because the people who developed go don't just vanish if Google suddenly did? Because OSS has a long history of maintenance changing hands?

> sure, someone will step in and maintain Python 2.X indefinitely... Well, no one did.

There is a simple reason for that: Py2 was obsoleted by it's successor, Py3. There is simply no point in maintaining an obsolete language, especially if it has a direct successor, that is both similar, and an improvement in every single way.

And even so, Python 2.7 was still supported for almost a decade after it's release.

Re:Fourteen Years of Go by cpuguy83 on Saturday November 11, 2023 @10:46AM (#38231323)
Go has breaking changes frequently.
Re:Fourteen Years of Go by saturn_vk on Saturday November 11, 2023 @11:33AM (#38231729)
Ok, could you name 10?
Re:Fourteen Years of Go by cpuguy83 on Saturday November 11, 2023 @12:08PM (#38232136)
Can I name 10? No. I don't keep that information in my head and I don't need to explain myself to you. What a terrible comment.

But:

archive/tar breaks so often we've had to have a fork of it on and off for the last 10 years. One time it even caused a CVE due to it suddenly starting to dynamically link glibc (to preserve usernames in the tar header), which was being lazily relinked after chroot.

Go modules, whether I like them or you like them or not, are a breaking change. I've even had code I didn't touch cause other people break because some dependency (literally my only dep) switched go mods... I didn't even update the dependency just the fact of them changing broke downstreams.

More recently, it's behind an env var in go1.21 but will be default in go1.22, go is changing the loop semantics to scope loop variables to the loop. Now, I like and agree with this change, but it is a breaking change.

"Compiles" is not the same thing as "works". Behavior changes that are only apparent at runtime is where go makes breaking changes. Breaking compilation is often more preferable, to me.

Re:Fourteen Years of Go by usrbinbash on Saturday November 11, 2023 @12:47PM (#38232553)
> What a terrible comment.

How is asking for examples for a statement a "terrible comment"?

>go is changing the loop semantics to scope loop variables to the loop. Now, I like and agree with this change, but it is a breaking change.

Please explain what exactly that change breaks.

> Behavior changes that are only apparent at runtime is where go makes breaking changes.

Such as? And yes, I am asking for examples. Because I have personally compiled and run code that was written in Go 1.8, with a modern compiler. And the only change I saw so far, is better performance.

Re:Fourteen Years of Go by cpuguy83 on Saturday November 11, 2023 @01:20PM (#38232943)
> How is asking for examples for a statement a "terrible comment"?

Demanding 10 examples is a terrible comment. It communicates hostility and disbelief rather than curiosity.

> Please explain what exactly that change breaks.

https://github.com/golang/go/issues/60078 is where this is discussed. Again, I _agree_ with this change, but I'm pointing out that it is a breaking change. rsc points out in the proposal that it is a breaking change.

> Such as? And yes, I am asking for examples. Because I have personally compiled and run code that was written in Go 1.8, with a modern compiler. And the only change I saw so far, is better performance.

I gave multiple examples already. If you are truly interested I'm sure you can find more either in the go issue tracker or on google.

Re:Fourteen Years of Go by saturn_vk on Saturday November 11, 2023 @01:51PM (#38233268)
> Demanding 10 examples is a terrible comment. It communicates hostility and disbelief rather than curiosity.

It followed the same tone of your comment, where you claimed that they were doing frequent changes, without providing any examples, of which there should be numerous, if they really occur so frequently.

Re:Fourteen Years of Go by usrbinbash on Saturday November 11, 2023 @02:20PM (#38233553)
> It communicates hostility and disbelief rather than curiosity.

To me, it just asks for examples. I guess that's a matter of opinion then.

> https://github.com/golang/go/issues/60078 is where this is discussed.

We can discuss semantics here, but a breaking change, to me, is one that that breaks well-crafted existing code. Well, what kind of real world code would rely on the fact that closures over an iteration target examine a value that depends on runtime behavior instead of the actual value that, semantically, seems to have been closed over?

I have stumbled upon this issue myself when I first learned Go. I have used Go professionally and in private projects and since long before modfiles became a thing. I have NEVER seen code that relies on this completely unintuitive behavior. This is not a change that breaks something good, this is a fix that removes a footgun from the language.

Further down, rsc writes this (https://github.com/golang/go/issues/60078#issuecomment-15424...)

    That's some of the real-world evidence in favor of changing 3-clause loops.
    I have looked, and I found no evidence in favor of not changing them.
    If you want to make the case for not changing them, the way to do that would
    be to provide real-world examples of code that breaks with the new semantics.
So, semantics aside, no, I do not consider this a breaking change, because while it is, technically, not backward compatible, it doesn't break existing code.

> I gave multiple examples already.

What exactly breaks in the archive/tar package? I looked it up, only found some bugs and issues, but nothing I would consider a change that breaks existing code.

What exactly did modfiles break? I can still compile code without modules. Yes, modern versions of the go-tool require a flag via envvars, but they are still compatible with old projects. And libraries changing is not the same as the language changing. If a build relies on a certain commit on the library, I can always check out that commit.

Re:Fourteen Years of Go by demi56 on Saturday November 11, 2023 @07:22AM (#38229708)
What makes you think that Google has active authority over Go development?,
Re:Fourteen Years of Go by vitorsr on Saturday November 11, 2023 @08:48AM (#38230256)
As I understand it, Go is funded by Google in the sense that core language development is largely undertaken by Google employees, not in the sense that an independent language foundation organization that receives funding from external backers invests in core language development.
Re:Fourteen Years of Go by patmorgan23 on Saturday November 11, 2023 @09:43AM (#38230686)
Well the language was created by Google employees and Google funds the majority of development work on GO.
Re:Fourteen Years of Go by Art9681 on Saturday November 11, 2023 @09:30AM (#38230559)
Go is so deeply embedded in Cloud computing that if it were abandoned it would break the internet. Some of the most critical systems are built with it.

If it’s good enough for Kubernetes then it’s good enough for any business.

Re:Fourteen Years of Go by crabbone on Saturday November 11, 2023 @09:49AM (#38230739)
I believe, Kubernetes was initially built in Java. Its codebase reeks of Java for miles even today. I'm pretty sure that porting it back to Java wouldn't be too hard, should Google discontinue Go.

Pretty sure Internet and cloud will not go anywhere if Go vanishes tomorrow. Even if you need containers, there are plenty of tools that don't use Go, and give you similar service.

I've lived enough to see technologies with humongous popularity die in a matter of years (eg. Flash). Those who didn't believe Flash would die made very similar arguments about how certain things would be "impossible" w/o it. Not sure who am I quoting here, but there's this saying that "cemeteries are full of indispensable people".

Re:Fourteen Years of Go by bananapub on Saturday November 11, 2023 @09:56AM (#38230811)
> I'm pretty sure that porting it back to Java wouldn't be too hard, should Google discontinue Go.

lol

Re:Fourteen Years of Go by nilamo on Saturday November 11, 2023 @10:23AM (#38231096)
> On the other hand, would you choose to build a long-term business on top of Go, given that all that support comes from one company?

Like Java? Or c#? Go is hardly unique in that it's developed primarily by a single entity.

...but even if Google abandoned it, it seems like you're making the assumption that no one in the world would continue developing an open source project, and the source would just become unusable, or something? It's not like Google can just turn off go lmao

Re:Fourteen Years of Go by pjmlp on Saturday November 11, 2023 @03:47PM (#38234343)
Java is developed by several companies, there are plenty of alternative implementations in the same vein as C and C++ compilers.
Re:Fourteen Years of Go by onthecanposting on Saturday November 11, 2023 @10:55AM (#38231401)
I would be more concerned that Google maintains the language because they do or intend to use it for one of their surveillance or monetization schemes.
Re:Fourteen Years of Go by HumblyTossed on Saturday November 11, 2023 @07:17AM (#38229679)
I like Go because it does have so few features. There are plenty of other languages out there that are feature rich, not all languages have to have everything.
Re:Fourteen Years of Go by chubot on Saturday November 11, 2023 @08:45AM (#38230236)
Yeah definitely, starting the project in 2007 to releasing publicly in November 2009 is very fast. Then reaching a very stable 1.0 in 2012 is also fast.

That's only possibly by reducing scope. I don't think more people help, because you can't really divide and conquer language design.

(As far as I understand, the early project was something like "take Ken Thompson's C compilers and add goroutines, garbage collection, slices, and interfaces")

I don't use Go regularly, but I've also had some very good experiences with it lately.

They have kept the tools simple and predictable. Getting started is a breeze.

The MIPS support worked surprisingly well, e.g. on a machine with 64 MB of RAM.

I've had and still have a lot of gripes about (mainly being a sort of closed ecosystem), but you can't deny that it works well, and is a big achievement.

Re:Fourteen Years of Go by lolinder on Saturday November 11, 2023 @09:37AM (#38230628)
I don't think the lack of features is due to time or funding constraints: all the large languages that originated after Go have more elaborate features, and many of them have less funding than I assume Google puts towards Go.

Rust, Kotlin, Swift, and Dart are the main ones I'm looking at. Rust and Dart had an official package manager long before Go did. All four have had some form of generics, at least the first three have sum types, null safety, and many other features that are missing in Go. These languages might have as much funding as Go (I don't know), but they've had less time to implement these things.

Rather than funding constraints, it seems to me that Go has avoided adding features because that's not the kind of language they want to design. It may have led to more polish than some of the languages listed above (I personally prefer programming in any of the first three to programming in Go), but it's not a given that Go would have taken longer to build if they'd made the scope bigger.

Re:Fourteen Years of Go by pif on Saturday November 11, 2023 @10:56AM (#38231404)
The only reason for the reduced feature set is because it was never meant for professional software developers.

Go is a toy language for hobbyist programmers.

Re:Fourteen Years of Go by ADSSDA on Saturday November 11, 2023 @11:29AM (#38231699)
Odd take, golang was designed by Google for their needs. It has very little uptake amongst hobbyist devs and is nearly entirely used by professional devs. In my experience hobbyist devs focus primarily on javascript/python.
Re:Fourteen Years of Go by betaby on Saturday November 11, 2023 @11:00AM (#38231440)
As the opposite to what language?
Re:Fourteen Years of Go by 62951413 on Saturday November 11, 2023 @01:10PM (#38232817)
Just think about golang as the next generation's Java. The same strong points (concurrency, GC, "simplicity" for junior developers), the same egregious mistakes (generics alone prove it for me), the same BigCo backing, the same undeserved early popularity.
Re:Fourteen Years of Go by kaba0 on Sunday November 12, 2023 @03:27AM (#38238419)
Java was novel back then and managed to live up to its hype.

Go isn’t novel, and doesn’t provide anything new compared to even Java 1.1.

Re:Fourteen Years of Go by tejinderss on Monday November 13, 2023 @04:07PM (#38255399)
How does it compare to rust in your experience?