9 ms·
> Again, it shows how things have changed that I praised Go’s type inference as an advance in the state of the art, but now the Hacker News crowd considers Go’s
by wk_end 3y ago
> Again, it shows how things have changed that I praised Go’s type inference as an advance in the state of the art, but now the Hacker News crowd considers Go’s type inference to be very limited compared to other languages. "You either die a language nobody uses or live long enough to be one people complain about."
This rubs me the wrong way. Even back when Go first came out, anyone who knew anything about programming languages rolled their eyes at pretty much everything about Go's type system, including the inference. Just because Sun couldn't figure out how to do it in the 90s doesn't mean that type inference wasn't mostly solved in the 70s. Well before many people were using it or lived any real length of time, Go's always been a language people have - rightly - complained about.
That said...nothing in the original post says anything along the lines of "Go's type inference [is] an advance in the state of the art", so I might be misunderstanding the author here.
- softirq 3y ago> anyone who knew anything about programming languages rolled their eyes at pretty much everything about Go's type system And Go has succeeded despite these condescending diatribes on how a language needs to have a Hindley-Milner type system with ADTs and type classes to be useful. Go made me truly realize how insufferable the PLT community is, and why they are so absolutely lost when it comes to creating successful languages. In under a decade Go swept up entire markets with a simple, down to earth language you can learn in a day and keep in your head. It optimized for the masses and the common cases and has absolutely eaten the lunch of these languages with lauded type systems that takes several courses in formal logic to even get started with.
- nullwarp 3y agoGo really is great. There was a big argument around a new project we were starting whether to do Go or Clojure. What we did to settle the debate was to ask an entry level dev that was just starting if he was interesting in writing two sample applications in each language, having known nothing of either. Nothing complicated but touched enough points (HTTP endpoints, database interaction) A full day later was still trying to get the Clojure app working correctly. He finished up the Go one in like an hour. Since then we've brought new devs on with zero Go experience and they are up writing good code in a day. I can't imagine where we would be if we had gone down the Clojure route.
- cempaka 3y agoAs a method for choosing a language, doesn't this just inherently skew to the smaller and more simplistic one, which may not necessarily be the best for all tasks or over a longer run where the techniques of the more involved language could be learned? It's like hiring a new farmhand and saying, "here, dig two 3 foot holes, and we'll see what takes you longer, this shovel or an excavator you have no training or experience with," and then concluding the shovel is superior for all digging tasks from that point on.
- Veraticus 3y agoI would say it skews towards languages that are easy to be immediately productive in, which is certainly one of Go's biggest strengths.
- tornato7 3y agoPotentially. Devs might get up and running with Scratch even faster than Go. But I'm assuming the OP already determined that Go or Clojure would work well for the task. Go probably has a leg up on Clojure for reputation in production projects, considering Docker, K8s, Terraform, InfluxDB, and Geth are all written in Go. The biggest ones I can find written in Clojure are Puppet and CircleCI.
- dogleash 3y ago> As a method for choosing a language, doesn't this just inherently skew to the smaller and more simplistic one, which may not necessarily be the best for all tasks or over a longer run where the techniques of the more involved language could be learned? pmuch. I migrated a team off of an aging enterprise application to the product that was rapidly gaining popularity in industry. I had some expertise and believed in it, I won't name products (and it wouldn't mean anything to HN anyway) but this was a painfully obvious change. We were the pilot project at the company, and went though 6 months of most users struggling. It was about 18 months after adoption that my boss told me he felt like the new product was both better and that the slow down had been worth it. Life isn't long enough for too many of those experiments. Not everything takes that long. And the experiment could have failed. But the experience really put lots of decisions into perspective. There's a saying that nobody uses technologies that their boss didn't learn in college. Factually inaccurate, quite astute in message.
- za3faran 3y agogolang mainly ended up competing with and replacing the likes of python and ruby, where it was intended to compete with C and C++, where it didn't really change anything. It makes sense in retrospect of course, python and ruby are slow, dynamically typed languages, and any improvement in performance and typing is welcome. It doesn't mean that golang is inherently better somehow to other offerings. I still maintain that Java and C# are superior languages and ecosystems.
- matwood 3y agoGood point. I know I'm just being bitter, but I still can't stand Python after dealing with the 2->3 transition. I code mostly Java and use Go where I might have reached for Python before. The Go built in libs make it so easy to build small CLI apps where I may have used scripting before. And the cross compile situation makes it easy to ship wherever. I'm not a PLT person, and Go is easy for me to simply solve problems with. Probably also why I'm fine using modern Java.
- nateb2022 3y agoWhy C#? It definitely has its own niche, and is good for building userspace Windows apps and games, however beyond Windows I don't think it has neither an established presence nor ecosystem. If anything, C# attempts to be more of a Java replacement than address Go's niche. Performance-wise, C# and Go are head-to-head: https://programming-language-benchmarks.vercel.app/go-vs-csharp https://programming-language-benchmarks.vercel.app/go-vs-csh... I also would say Go has been much more adopted for cross-platform use than C# ever was. Regarding language features, Go's devotion to staying intentionally bare-bones is worth a lot. C# may be more elegant in a lot of ways, however it seems to be in the process of being choked by Microsoft's continuous feature-creep.
- Capricorn2481 3y agoC# has way, way more market share than Go as well as a bigger ecosystem and it's not even close. I would hardly call a Java replacement a "niche" since that's everywhere. There are, of course, other benchmarks that rank c# above go, but benchmarks are flawed. I imagine people are comparing C# to go because it's got a pretty solid type system
- mikebenfield 3y ago> And Go has succeeded despite these condescending diatribes on how a language needs to have a Hindley-Milner type system with ADTs and type classes to be useful Fine. But it's beside your parent comment's point. The article claims that everyone thought Go's type system was an advance on the state of the art. This isn't even close to true.
- primax 3y agoBuilding something that can be successfully adopted and operationalized at mass scale is an element of the state of the art.
- xctr94 3y agoAmen. I’ll give Microsoft crap any day, but the most popular language on Earth is now routinely developed with a sane type interpreter that eliminates entire error categories.
- monksy 3y ago> you can learn in a day and keep in your head. I'm not sure that this successpoint is really that valuable. It sounds more valuable for those who want butts in seats than it does for long term satisfaction and survivability of your code base.
- omegabravo 3y agoBeing able to read your code you wrote 2 years ago does wonders for survivability, which is a gross simplification of course. It's a great language for some problems, horrible for others. The problem is people tend to talk as though everyone works in their domain.
- monksy 3y ago> Being able to read your code you wrote 2 years ago It won't stop you from asking wtf did someone write this and then doing a git blame and seeing your name.
- kaba0 3y agoIf “each individual line is easy” would work, we would be reading-writing in assembly. I don’t accept the premise that Go would be any better in this region, if anything, it is worse by cluttering up the happy path by error “handling” noise, and much harder than they should be opewtions.
- gaganyaan 3y agoYeah, I can keep Brainfuck in my head easily. Doesn't mean I'm going to use it as anything other than a toy language.
- tomcam 3y agoNow you’ve got me curious. I’d like to type inference in go. Can you tell me what languages do it better?
- wk_end 3y agoIn ML-lineage languages (including Haskell) you almost never need any type annotations whatsoever, at least not unless you’re poking around at the fringes of those languages (GADTs, various GHC extensions). Type annotations for top-level definitions are often encouraged for readability and better error messages, but the compiler can almost always figure everything out itself.
- Mawr 3y agoFrom my experience, such type inference systems are awful in practice. Rust designers tried to do something like that initially but quickly realized understandability suffered greatly. You really do want to specify types manually, at least at boundaries, e.g. in function definitions. > Type annotations for top-level definitions are often encouraged for readability and better error messages, but the compiler can almost always figure everything out itself. See? That's not a good thing at all. If the compiler's capability makes the code less understandable, then it's undesirable. Doesn't matter how fancy and cool, or state-of-the-art it may be. You probably don't want to strap a jet engine to a car, no matter how cool you may think it would be.
- tialaramex 3y agoRight, global inference turns out to be too much inference. Function boundaries are a convenient place to draw a line. As usual C++ choose to something much weirder and more dangerous. Instead of inference C++ can deduce types, in some cases there's no way to write a type's name so you have to deduce types, and they can be deduced at the edges of functions however unlike inference it's not an error to have ambiguity, in some cases deduction may choose one of the possibilities that it liked better even if that's astonishing for you. Because Rust's functions must tell you their types explicitly, and because some types can't be named specifically, the result is that in Rust you have to write these functions polymorphically, even if in practice there's only one possibility. In C++ you can write the non-polymorphic function, despite not being able to say the name of the type. How do you document that? It's OK, C++ doesn't require you to provide even halfway usable documentation.
- tsss 3y agoGo has "swept up entire markets" because they have an unlimited marketing budget. It has nothing to do with the merits of the language itself.
- philosopher1234 3y agoCan you point to something Go has spent this hypothetical marketing budget on?
- pjmlp 3y agoDocker, Kubernetes and key CNCF projects.
- philosopher1234 3y agoWhat was the marketing investment here..?
- pjmlp 3y agoGoogle is using Go to implement Kubernetes. Kubernetes is cool, I want to play with Kubernetes. Maybe I should lean Go to play.
- philosopher1234 3y agoOk, but calling this a marketing spend that has nothing to do with the language seems ridiculous.
- worik 3y ago> PLT community What is that?
- wk_end 3y ago“Programming Language Theory”
- cheriot 3y agoI'd phrase it as: ruby, python, and javascript created a generation of programmers that didn't know how to use a type system. When they needed something more light weight and performant, they migrated to the language with the most primitive type system. Typescript and swift have shown a better type system can appeal to the masses.
- LinXitoW 3y agoGo has succeeded because it's not horrible and supported and used by one of the biggest companies out there. That means you end up with a long list of decent libraries, which to me feels like the main factor of success for a language.
- sethammons 3y agoWhy has Dart not taken off?
- pjmlp 3y agoBecause politics, Google wanted to do an hostile takeover JavaScript, it backfired, Chrome dropped DartiumVM, and they only got rescued thanks AdWords. Key language designers left after this. However it seems to have enough management support, that since it found an home in Flutter, I would assert there are having more adoption than Xamarin, React Native or Cordova.
- lenkite 3y agoDart is advertised as a client-optimized language. Optimized for UI is what the home page says. Say Goodbye to convincing people to use it on the server.
- soulbadguy 3y ago> And Go has succeeded despite these condescending diatribes on how a language needs to have a Hindley-Milner type system with ADTs and type classes to be useful. And nothing says that go wouldn't have been more successful had they added those features. In the final analysis, the relationship between the success of a language and any intrinsic qualities is very hard to qualify. But IMO, the success is not a good measure of wether or not the criticism of go were/are valid. > Go made me truly realize how insufferable the PLT community is Agree PLT folks can be a passionate bunch, i am not sure they are any worst to any other online community. > and why they are so absolutely lost when it comes to creating successful languages. Depends on who you include in the PLT group : - C# and typescript were design by Anders Hejlsberg , arguably the most successful language designer - Scala is also pretty successful and really tied to the PLT community - Kotlin by JetBrain, Dart started with Gilan Bracha Not to mentioned the wide range of features seen in most recent language (async-await, reactive programming for msft research) etc... etc... The fight between pragmatic and simple language vs complex and expressive language is not happening outside the PLT, we have proponent of both ways of thinking inside the community. Not everyone in the PLT is pushing for overly complex theoretical approaches. But more importantly, let's not forget the 1000's of engineer quietly implementing the compiler, libraries etc... that make go, or any other language possible. Back to go, my personal gripe with go wasn't the decisions they made, but the rational given for those decisions. Take the most famous example of not including generics. Designing a good generic type system is a very complicated task, and if the team had come out and say they didn't want generics because they didn't have the bandwidth or the know-how to do so, i wouldn't have care. But the rational given, describing generics as border line useless, or somehow too hard for the average programmer to grasp not only fly against basically 25 years of programming language history, but were just plain rediculous.
- Mawr 3y ago> In the final analysis, the relationship between the success of a language and any intrinsic qualities is very hard to qualify. Not at all. It's the same as with literally any other product. If it's good, people will use it. Outliers are rare. Now, you may disagree with what most people consider good, but that's another discussion ;)
- pjmlp 3y agoAs proven by Oberon-2 and Limbo ancestors, it helps to have a good godfather.
- curryhoward 3y ago> and why they are so absolutely lost when it comes to creating successful languages They aren't lost—they're just more interested in actually good ideas than in popularity. Popular languages must appeal to all kinds of programmers with varying backgrounds, so they are heavily constrained. Your argument is basically that mathematicians don't know what they're doing because their most advanced theories aren't used by mechanical engineers.
- deleted 3y ago[deleted]
- Tainnor 3y agoWhat do you mean by "Go has succeeded"? It has found its niche, yes, but so have those HM languages (maybe the Go niche is a bit bigger), and a bunch of other languages that people also like to hate. Meanwhile, most code is still written in languages like Java, C and PHP. That's no value judgement or anything, I don't think Java is an amazing language (neither do I think it's a terrible one), but it's not like Go has revolutionised anything. It's just become a new option among many.
- EspressoGPT 3y agoThe fact that you mention Go, an 11-year-old language, alongside a 27-year-old, a 51-year-old and a 28-year-old language proves that it has succeeded.
- Tainnor 3y agoThen so has Ruby, Haskell, Erlang, and a bunch of other languages that espouse virtues completely contrary to Go. So I'm not sure what your point is? Also you didn't even get my point because I explictly contrasted Go, as a niche language, with the big languages that most things are written in.
- sharts 3y agoPart of that success may have to do with "Wow, Google invented this...let's use it." Kubernetes adoption seems to be going up but does it really add value for most that adopt it? I would say, no.
- gaganyaan 3y agoNah mate, sorry. Go is a language already past its prime, which is laughable given how young it is, and how it was modeled on better, long-lived languages. Take a look at Google trends if you disbelieve me. There was a slight bump in interest when generics finally got pushed out, but that's died off, and Go is entering the same decline as other has-beens like Ruby. Good riddance to a language designed for people that aren't good at programming (you'll have to look up the quote yourself, I'm too lazy).
- EspressoGPT 3y agoMost SWEs aren't particularly good at programming. It's not a shame to embrace that.
- btilly 3y agoEven back when Go first came out, anyone who knew anything about programming languages rolled their eyes at pretty much everything about Go's type system, including the inference. The Go team was populated by people who had created one of the most influential languages of all time, C. Who created the new language based on theories about how to encourage good engineering practice. Theories that they were able to test through internal access to a very large and actively maintained codebase at Google. A codebase into which they had inserted several other languages that they had devised for various purposes. I'm pretty sure that nobody in the external programming languages community had the same depth of experience in the practical use of programming languages that the Go team had. And so it was bizarre to them to see the Go team deliberately leave features out because of concerns about how those features are used in practice. Few of the critics who "knew about programming languages" have created any language that ever made it into the top 10 programming languages in the world. It is therefore funny to me that they were complaining about exactly the kinds of choices that lead to Go becoming popular. I'll generally take the design choices of a team with 2 popular languages under their belt over academics in the ivory tower.
- valenterry 3y agoC is also a very low-level and close to the machine language. Just because you can build a microchip doesn't mean you can build a spaceship and vice versa. So I'm not surprised about that they e.g. left out generics and said they did so because they didn't know a good or right way to add them to the language. They were honest at least which I value a lot. As to the success of Go that you mention. Well, let's be honest: it targets junior developers, or at least that was originally a major goal. It is backed by Google and is marketed. There are just currently way more junior developers due to the demand and the developement of the field. However, you can already see that a lot of junior developers that started with Go are not so junior anymore and now that they got more experienced, they demand language features that make them more productive - like generics. And they will be added and in the end Go will be a language that is not simple anymore, it will be the new python. Go is a very practical and pragmatic language, no doubt. It's one if its strengths. But it is not by any means an advanced high-level language in any sense that I would know of.
- Mawr 3y ago> Even back when Go first came out, anyone who knew anything about programming languages rolled their eyes at pretty much everything about Go's type system, including the inference. The fact that it was even a point of concern shows how misguided the PL community is. Advancing the state of the art is not the goal, producing a tight, clean design is. > Just because Sun couldn't figure out how to do it in the 90s doesn't mean that type inference wasn't mostly solved in the 70s. Theory's only as useful as its implementation. If there's no sensible implementation of type inference out there, but then a new language comes out with it, is that not a significant improvement to the status quo, even if the theory behind it may be decades old? Code autoformatters were not exactly dark PL magic when Go came out either. But somehow the impact gofmt has had on the PL space has been immense. Funny how that works.
- Tainnor 3y ago> The fact that it was even a point of concern shows how misguided the PL community is. Advancing the state of the art is not the goal, producing a tight, clean design is. Why should there be only one goal of "the PL community" (whatever that is)? Maybe you need people who advance the state of the art and others who make things ready for production. > Theory's only as useful as its implementation. If there's no sensible implementation of type inference out there, but then a new language comes out with it, is that not a significant improvement to the status quo, even if the theory behind it may be decades old? That would be a fine argument if Go had been the first major language with type inference, but even if you're willing to ignore ML languages (because you think they're too niche and/or weird), Scala is almost 10 years older than Go.
- sophacles 3y ago> The fact that it was even a point of concern shows how misguided the PL community is. Advancing the state of the art is not the goal, producing a tight, clean design is. I don't see how having better type inference interferes with the "tight clean design"? If anything I'd argue that not having it is a hinderance. Why do i need to `x :=make([]foo)` or `var x []foo` when I could just `x := []` and let the type system infer that its `[]foo` by the fact that I keep `append`ing `foo`s to it?
- 3y ago