News for hackers. Stuff that matters.
Re:Half a decade with Go by ansible on Monday November 10, 2014 @04:17PM (#8586511)
At launch, there was a flurry of attention. Google had produced a new programming language, and everyone was eager to check it out. Some programmers were turned off by Go's conservative feature set—at first glance they saw "nothing to see here"...

This was totally me. I am very much a programming language aficionado (or maybe just a dilettante), and when I first read about Go, I dismissed it quickly. I'd mostly been using Lua at the time, and didn't really understand what was different with goroutines vs. coroutines.

After the initial release, it took us a while to properly communicate the goals and design ethos behind Go. Rob Pike did so eloquently in his 2012 essay Go at Google: Language Design in the Service of Software Engineering and more personally in his blog post Less is exponentially more. Andrew Gerrand's Code that grows with grace (slides) and Go for Gophers (slides) give a more in-depth, technical take on Go's design philosophy.

It was Rob Pike's essay that caused me to investigate it again.

I have been quite impressed with lots of little details that have been 'fixed' (relative to C) in Go. Such as how variables are declared, the module system, and much more. And I was and continue to be impressed with the associated tooling.

I hope that if Go has just one lasting legacy in the history of programming, it will be how it pushed forward people's expectations of what a good language ecosystem should provide.

Re:Half a decade with Go by wyager on Monday November 10, 2014 @04:32PM (#8586623)
What do you think is worthwhile about Go? I agree that the tooling is nice, but beyond that, there is nothing interesting to me. Goroutines aren't interesting; languages like Erlang and Haskell got green threads right many years before Go was on the scene.
Re:Half a decade with Go by kjksf on Monday November 10, 2014 @04:53PM (#8586767)
You should ponder why Erlang or Haskell achieved a fraction of Go's adoption despite being on the market 20+ years longer.

Some people see languages as a bag of features (immutability! generic programming! laziness! operator overloading! algebraic types! hindley-miller type inference! pattern matching! exceptions! manual memory management!). See http://yager.io/programming/go.html for an example of that line of thinking.

Those people won't get Go.

Designing a language is not about cramming every feature you can think of. It's about making good trade offs.

A trade off is: you get something but you also loose something.

I use Go because it made the biggest number of good trade offs.

Or to put it differently: I program in Go because when writing code, it irritates me less than other languages.

If you want a longer explanation of that: http://commandcenter.blogspot.com/2012/06/less-is-exponentia...

Re:Half a decade with Go by wwweston on Monday November 10, 2014 @06:03PM (#8587213)
> You should ponder why Erlang or Haskell achieved a fraction of Go's adoption despite being on the market 20+ years longer.

This line of thinking serves more to call in to question the engineering and management cultures we have than it does to reflect poorly on Haskell and Erlang, and if it's true that Go's essential strength compared to them is that it is well-fitted to these cultures, that's not particularly flattering, however locally practical it may be.

Re:Half a decade with Go by AnimalMuppet on Tuesday November 11, 2014 @03:11PM (#8591877)
That sounds almost like denial to me. "If everybody doesn't adopt what I think they should, it has to be because they're dysfunctional! It can't be because the stuff I like is less generally applicable than I think it is!"

If people disagree with you, your default assumption should be that they are looking at different evidence than you, not that they are incompetent or stupid.

Re:Half a decade with Go by jshen on Tuesday November 11, 2014 @02:41AM (#8588755)
If languages like Haskell and Erlang gave a competitive advantage, wouldn't we see companies which used them succeeding over those that don't?

Maybe Go is fitting into the cultures that succeed, and if that's the case, well it's the better choice, right?

Re:Half a decade with Go by lmm on Tuesday November 11, 2014 @03:09AM (#8588827)
> If languages like Haskell and Erlang gave a competitive advantage, wouldn't we see companies which used them succeeding over those that don't?

We are. WhatsApp generated a flurry of interest around Erlang. Heroku uses it. I'm sure there are more examples.

Google is at this point already a large corporation and probably already in decline (IMO). The tools they use are optimized for interchangeability of mediocre programmers, not for high productivity from a small team. Go is a perfectly good Java 1.4.

(There's Docker using Go, but I think their whole approach is a bad idea).

Re:Half a decade with Go by jshen on Tuesday November 11, 2014 @11:28AM (#8590627)
You are seeing companies that use those languages suceeding at a higher rate than those that don't? I bet I can find 10 succeeding that use ruby or node for everyone that uses Erlang.

We could also look at the open source world. For every riak there are 10 java sucesses of a similar kind.

We'd need to do some real statistics but my bet is that we see no benefit from those languages in terms of success of the business.

Re:Half a decade with Go by lmm on Tuesday November 11, 2014 @02:01PM (#8591527)
> I bet I can find 10 succeeding that use ruby or node for everyone that uses Erlang.

But that's not the question, is it? There are a lot of companies succeeding with ruby or node, but also a lot of companies failing with them. I'll bet the strike rate is better for Erlang companies.

Re:Half a decade with Go by jshen on Tuesday November 11, 2014 @03:32PM (#8591974)
Il bet that the choice of language has no impact on success.
Re:Half a decade with Go by codygman on Tuesday November 11, 2014 @07:50PM (#8593328)
What about whitespace? Do you think choosing it or brainfuck has an impact on success?
Re:Half a decade with Go by jshen on Wednesday November 12, 2014 @01:06AM (#8594235)
Not relevant. I'm sure there are bad choices, but the difference between Go and Haskell is probably negligible or in Go's favor.
Re:Half a decade with Go by lmm on Wednesday November 12, 2014 @05:01AM (#8594701)
So you think Go is a better language because companies that use Go are more likely to be successful because... Go is a better language? That's just circular reasoning. Do you have any numbers or experience here?

(In my limited experience I've seen a 100% success rate for companies that use Haskell and a 0% success rate for companies that use Go, though as you can imagine I don't have a statistically valid sample size)

Re:Half a decade with Go by jshen on Wednesday November 12, 2014 @10:32AM (#8595858)
Right, there is no good data at all suggesting that languages like Haskell are better for teams. Yet we are constantly served peoples overly confident opinions that they are.
Re:Half a decade with Go by tome on Wednesday November 12, 2014 @11:18AM (#8596253)
We are? Links please.
Re:Half a decade with Go by codygman on Wednesday November 12, 2014 @07:35AM (#8595128)
As someone with experience in both languages I disagree. Try parsing json in both languages and you'll see a difference. Composing functions that use channels simply isn't possible in Go (please prove me wrong).

Go gives you kind of safe concurrency, Haskell gives you actual safe concurrency.

Re:Half a decade with Go by pjmlp on Tuesday November 11, 2014 @07:11AM (#8589434)
> If languages like Haskell and Erlang gave a competitive advantage, wouldn't we see companies which used them succeeding over those that don't?

Like these?

https://www.haskell.org/haskellwiki/Haskell_in_industry

https://www.erlang-solutions.com/industries

https://ocaml.org/learn/companies.html

http://fsharp.org/testimonials/

Re:Half a decade with Go by codygman on Tuesday November 11, 2014 @08:37AM (#8589689)
The stock price of Standard Chartered is 939 GBX currently.
Re:Half a decade with Go by wcummings on Monday November 10, 2014 @04:59PM (#8586815)
I get the impression some of the folks in the Golang crowd are "Blub" programmers [1]. It's not so much a matter of simplicity and trade-offs as it is a matter of "I don't need things I don't know about", which isn't a good argument to use Golang.

[1] http://www.paulgraham.com/avg.html

Re:Half a decade with Go by timtadh on Monday November 10, 2014 @05:26PM (#8586996)
I feel like you haven't met a lot of Go programmers in that case. The programmers I have met who use Go or are interested in it are often genuinely good programmers. Of course there are "crowd" followers in any language as popular in Go but Go is not a "Blub" language nor does it attract Blub programmers.

Do I as a Go programmer sometimes wish that Go had feature X. Of course I do! I want that feature when I want that feature. But, I find Go to occupy an extremely practical position in my personal programming language continuum do to its fairly unique mix of features. Note, it is not the features themselves that are unique many languages individually have them. Indeed, they often also include features I miss in Go. Rather, it is the particular mixture which is useful.

EDIT: To respond directly to the Blub article.

Features pg calls out for LISP:

    Garbage collection, introduced by Lisp in about 1960, is now widely
    considered to be a good thing. Runtime typing, ditto, is growing in
    popularity. Lexical closures, introduced by Lisp in the early 1970s, are
    now, just barely, on the radar screen. Macros, introduced by Lisp in the mid
    1960s, are still terra incognita.
 
Go score card:

    Garbage Collection [x]
    Runtime Typing [p]*
    Lexical Clusures [x]
    Macros [ ]

    * Go has some dynamic typing capabilities but nothing like Python or LISP.
      Many would consider that a "good thing". It partially depends on what you
      are doing.
Go has a 3/4 on the score card of features. Macros are of course enormously useful but also very difficult to shoe horn into a c-family language properly since they need to be expanded at compile time (unless you just go ahead and embed you compiler backend into the runtime system of your language. That would be kinda of crazy/awesome but you could do it). Rust has of course proven the utility of such a choice.

I can't speak for pg, but Go has many fantastic features and is not a Blub. The features which are missing are not, by and large, features of LISP.

EDIT 2: To add some more fuel to this fire...

pg concludes the article with:

    During the years we worked on Viaweb I read a lot of job descriptions. A new
    competitor seemed to emerge out of the woodwork every month or so. The first
    thing I would do, after checking to see if they had a live online demo, was
    look at their job listings. After a couple years of this I could tell which
    companies to worry about and which not to. The more of an IT flavor the job
    descriptions had, the less dangerous the company was. The safest kind were
    the ones that wanted Oracle experience. You never had to worry about those.
    You were also safe if they said they wanted C++ or Java developers. If they
    wanted Perl or Python programmers, that would be a bit frightening-- that's
    starting to sound like a company where the technical side, at least, is run
    by real hackers. If I had ever seen a job posting looking for Lisp hackers,
    I would have been really worried.
Note, he explicitly says here: not all languages are the same. He would worry when a company wanted Python programmers. Why? Because to him Python mixture of features represented a nice chunk of what LISP is providing him. Let's do another score card:

Python Score Card

    Garbage Collection [x]
    Runtime Typing [x]
    Lexical Clusures [x]
    Macros [ ]*

    * It is somewhat possible through black magic hackery to create an AST level
      macro in Python. It is messy. It is cool. It's kinda crunky. And I am not
      sure anyone has ever seriously used this ability. It certainly isn't main
      stream. Checkout https://github.com/lihaoyi/macropy for inspiration.
Norvig agrees with this assessment: http://norvig.com/python-lisp.html . Given that many people are ok with moving from Python to Go <https://www.reddit.com/r/golang/comments/2aup1g/why_are_peop... it seems reasonable to conclude that Go is an exceptible replacement for Python. Something no one has concluded about Java (for instance).

Therefore, I believe pg would have been equally worried or almost as concerned about Go programmers as Python programmers.

Re:Half a decade with Go by TheHydroImpulse on Monday November 10, 2014 @06:02PM (#8587204)
> Macros are of course enormously useful but also very difficult to shoe horn into a c-family language properly since they need to be expanded at compile time (unless you just go ahead and embed you compiler backend into the runtime system of your language. That would be kinda of crazy/awesome but you could do it). Rust has of course proven the utility of such a choice.

Rust doesn't do that. Rust expands the macros at compile-time. Integrating the whole compiler into the runtime wouldn't make much sense considering what area Rust is targeting.

It's also recommended to not link a crate that is used during runtime with the compiler or parser because they're fairly big and would bloat your final build by a large amount.

Re:Half a decade with Go by timtadh on Monday November 10, 2014 @08:37PM (#8587761)
yep. I never meant to imply that rust macros were expanded at runtime. I was trying to use rust as an example of a c-style langauge with a nice macro system.
Re:Half a decade with Go by lmm on Wednesday November 12, 2014 @05:06AM (#8594713)
Actually, to be a little more constructive about this: I'd be really interested to hear from anyone who's used Go after doing a serious project in any of Haskell, Scala, F# or OCaml. All the Go advocacy I read seems to ignore that this language segment exists, and all the Go programmers I speak to seem to take a very "blub" position on features like pattern matching, ADTs, and the various things I'd summarize as "good type systems". So it would be great to hear from someone who's used these things seriously, understands their advantages, but still thinks Go is making the correct tradeoff.
Re:Half a decade with Go by timtadh on Wednesday November 12, 2014 @11:17AM (#8596248)
I use Scala at work. I would rather write in Go than in Scala. While there are many things to like in Scala there are also many misfeatures such as the `implicit` key word which can create a lot of spooky action at a distance. Scala is an engineering tour de force and has many interesting ideas. However, I find that it has too many features and has a syntax with encourages obscure code. In contrast Go may be verbose at times but it is always very easy for me to read and follow.

I recently needed to dive into a legacy Scala code base which had not been worked on in a year. The engineer who had written it had moved on from the company and no one knew how it worked. The code was extremely difficult to read and reason about. Some of this was do to the programmer who wrote it but some of it was also do to language features. Is it possible write clear and concise Scala? Absolutely! But, the language does not necessarily encourage that style at this time.

Other functional languages I have used include: Scheme and SML. I want to check out OCaml next. I have also played around a bit with F* (not F#).

Re:Half a decade with Go by lmm on Tuesday November 11, 2014 @03:03AM (#8588810)
Languages without decent compile-time type systems are pg's own blub.
Re:Half a decade with Go by vorg on Tuesday November 11, 2014 @06:25AM (#8589314)
pg writes about macros as the top of the blub ladder whereas you mention compile-time type systems, but I'd say it isn't a ladder but a twin-peaked hill, i.e. strongly-typed lazy functional code (e.g. Haskell) and dynamically-typed variadic homoiconic code (Lisp). They have an "impedance mismatch" such that they don't inter-translate very well, unless they use clunky addons like Template Haskell macros or Typed Clojure annotations. The pure form of each language, however, is based on two mutually exclusive foundations, i.e. strongly typed auto-curried parameters vs variadic untyped macro parameters.

The strong typing and lazy evaluation of Haskell makes it easy for functions to take only one argument at a time. Although a function could take a tuple parameter, it is usually rewritten to take each component of the tuple as a separate parameter, which makes the strong typing and built-in currying simple, higher structures like monads possible, and a syntax to suit this style. Lisp functions and macros, on the other hand, must be variadic to enable the homoiconicity of the language. It's therefore much more difficult for parameters to be typed, or to curry them. The syntax requires explicit visual nesting.

The poster child of each style, monads and macros, are thus two peaks in language abstraction simply because of these different required foundations of each, and if you, lmm, have achieved Haskell-style enlightenment, then dynamic variadic homoiconic languages are your blub.

Re:Half a decade with Go by lmm on Tuesday November 11, 2014 @06:59AM (#8589398)
I use scala so I have both (somewhat clunky) macros and types. I am not unaware of the costs of clunkiness or the merits of the lisp approach, and I have not stopped looking for a language that can combine both advantages - in contrast to pg, who seems to dismiss the value of strong types without ever having used them seriously.
Re:Half a decade with Go by AnimalMuppet on Tuesday November 11, 2014 @03:20PM (#8591910)
You're right, but don't assume that there are only two peaks. That's making the same mistake you're arguing against.
Re:Half a decade with Go by eudox on Monday November 10, 2014 @06:25PM (#8587310)
>Macros are of course enormously useful but also very difficult to shoe horn into a c-family language properly since they need to be expanded at compile time (unless you just go ahead and embed you compiler backend into the runtime system of your language.

No, that's not necessary at all, with Rust-like macros which are simple pattern->template things. Macros have zero runtime cost.

Re:Half a decade with Go by timtadh on Monday November 10, 2014 @08:35PM (#8587754)
I totally agree I made this point badly.
Re:Half a decade with Go by enneff on Monday November 10, 2014 @05:04PM (#8586866)
Most Go programmers I know, including the language designers themselves, have a lot of experience in more feature rich and expressive languages. What appeals is the simplicity of Go, which gives you a lot less of a language to think about, so you can just think about solving problems instead.

“I like a lot of the design decisions they made in the [Go] language. Basically, I like all of them.” – Martin Odersky, creator of Scala.

I don't think anyone would accuse Odersky of being a "blub programmer."

Re:Half a decade with Go by jeremyjh on Monday November 10, 2014 @08:28PM (#8587740)
Martin has something nice to say about everyone's project. I seriously doubt he likes that a new language was created in 2009 that allows null references. But we'll never hear about it if he doesn't. Still, that doesn't make him a Go programmer.
Re:Half a decade with Go by tree_of_item on Monday November 10, 2014 @05:06PM (#8586879)
This is a great way to insult a bunch of people and start a fight.

"Beating the averages" is not a very good essay, I don't think you need to drag it in here.

Re:Half a decade with Go by djur on Monday November 10, 2014 @06:51PM (#8587422)
"Blub" as a concept isn't really useful anymore. I've seen people attacked as "blub programmers" for criticizing Go for its lack of features. At worst it's a personal attack ("you are a short-sighted programmer"), at best it's kind of supercilious ("language X is great, it's just over your head").
Re:Half a decade with Go by Dewie on Monday November 10, 2014 @07:22PM (#8587534)
I think "blub" is just another example of "you don't know what you don't know", which is always going to be relevant. And not everyone have tried, or intend on trying, obscure/sophisticated/mind-bending programming languages. And that's fine, since we all have different interests (as long as we don't try and pretend that we are very knowledgeable about something which we don't really have an interest in pursuing).

But to call someone a "blub programmer" does come off as quite rude.

Re:Half a decade with Go by cbp on Monday November 10, 2014 @05:01PM (#8586832)
Some people look at a new language and don't see anything that proves it was made after the 1970s.
Re:Half a decade with Go by zzzcpan on Monday November 10, 2014 @05:27PM (#8587006)
And I hope it stays that way. We don't need more features, we need to address psychological issue of mistake-making.
Re:Half a decade with Go by wyager on Monday November 10, 2014 @05:40PM (#8587085)
> We don't need more features

You may be a victim of the Blub paradox. There are many useful and powerful features missing from languages like Go, and many of them (like powerful type systems) exactly address human mistake-making.

Re:Half a decade with Go by zzzcpan on Monday November 10, 2014 @06:47PM (#8587410)
No need to get personal. I was talking about all the features in all the languages, not the ones in Go. And yes, we don't need more new features, we have plenty.

However, none of the languages I know of address psychological issues. Does type system reduce mistakes or introduce? Certainly both, don't know which one more though. But the question itself is wrong. It's not the type system who makes mistakes, humans do. And humans have brains. And brains are limited in their ability to do some thing while keeping other things in mind. And if among other things types happen to be present and mistake was made, than one could say types added to that mistake. And if types were not something programmer needed to think than type system certainly didn't add to that mistake. Things are not as simple as most programmers tend to think. Features don't matter how they think they matter. And research in language design was broken since the beginning of times and, sadly, still is.

(if you read "no silver bullet", "out of the tar pit" papers and couple of recent ones on bugs you should get the idea of how bad things are with mistake-making research)

Re:Half a decade with Go by tomp on Tuesday November 11, 2014 @07:50AM (#8589532)
How does a type system introduce mistakes? Unless it's unsound, of course (as is Java's and Dart's).
Re:Half a decade with Go by samth on Tuesday November 11, 2014 @09:49AM (#8590019)
Java's type system is sound. There are even machine-verified proofs of this.
Re:Half a decade with Go by tomp on Tuesday November 11, 2014 @10:10AM (#8590128)
Oops, you're right. I thought you could override methods with more specific argument types, but it appears I was wrong.
Re:Half a decade with Go by f2f on Monday November 10, 2014 @06:12PM (#8587250)
well, rust has all those powerful features. it's been out in the open for exactly as long as Go has.
Re:Half a decade with Go by djur on Monday November 10, 2014 @06:46PM (#8587406)
Rust isn't nearly as stable as Go. It still hasn't reached the state that Go was in when it was released outside Google. That's not a judgment of Rust, just a result of it being developed in the open instead of inside a company, and it being much more ambitious than Go.
Re:Half a decade with Go by davecheney on Monday November 10, 2014 @07:25PM (#8587542)
Go was released as an open source project on the 10th of November 2009. Which part of that is _not_ open to you in a way that Rust is ?
Re:Half a decade with Go by bjz_ on Tuesday November 11, 2014 @02:46AM (#8588767)
Go seems to be an iteration of Rob Pike's previous languages, Limbo and Newsqueak - perhaps with a sprinkling of other ideas, but not much.

Rust on the other hand has been a far more ambitious project, with very lofty goals. This has meant that the Rust team has needed to do a huge amount of experimentation and iteration, culminating in the tight set of core semantics that you see in the language today. It's not been an easy journey for the them, but a great deal has been learned in the process, and even if Rust never 'makes it' into widespread usage, its contributions to the field of programming language design will be felt for years to come.

This is not to diminish the efforts of the Go team - they have produced a really tight, polished language, with an excellent set of bundled libraries. All I'm saying is that they weren't starting from scratch, and had different goals to the Rust team. That has meant they could get to a stable language much faster.

Re:Half a decade with Go by erikstmartin on Tuesday November 11, 2014 @09:51AM (#8590028)
Rob Pike's keynote at GopherCon 2014 does a great walkthrough of the evolution of the design of the language, where ideas were borrowed from and why: https://www.youtube.com/watch?v=VoS7DsT1rdM
Re:Half a decade with Go by bjz_ on Tuesday November 11, 2014 @10:44AM (#8590342)
Oh nice, I'll check it out. It's always good to see where things come from.
Re:Half a decade with Go by djur on Monday November 10, 2014 @08:43PM (#8587788)
Both of them are open now. In 2009, it was possible to write a guide to writing software in Go:

https://web.archive.org/web/20091113154825/http://golang.org...

That looks a lot like today's Go. All of the major design decisions were made, distinctive Go concepts (slices, maps, interfaces, goroutines, switching on concrete type, etc.) are all present. Most of the code examples would compile today with only a few tweaks (if any).

Suffice it to say that Rust was not in that state in 2010. It was barely in that state by 2014. Go was released as a beta; Rust was released as a pre-alpha. That isn't a judgment of either language or community.

Re:Half a decade with Go by dbaupp on Monday November 10, 2014 @08:09PM (#8587692)
Externally, it certainly seems that Go was open sourced in a far more finished state, with only relatively small tweaks after the initial release, while Rust was quite raw and has had most of its fundamental design work done in the open (with significant contribution from volunteers, both code and design) after being placed on github in 2010.
Re:Half a decade with Go by Dewie on Monday November 10, 2014 @06:46PM (#8587407)
Rust 0.1 came out in the beginning of 2012, about 3 months before Go 1.0 game out (or go1). In the meantime, Rust has changed a lot and is only now close to a 1.0 release.
Re:Half a decade with Go by dbaupp on Monday November 10, 2014 @08:07PM (#8587688)
FWIW, Rust has been on github since June 2010.
Re:Half a decade with Go by f2f on Monday November 10, 2014 @11:24PM (#8588281)
rust was announced the same week Go was. it took a while to bring to the open, but it got the "swoon" demographic under its wing almost immediately.
Re:Half a decade with Go by ansible on Monday November 10, 2014 @05:10PM (#8586902)
Designing a language is not about cramming every feature you can think of. It's about making good trade offs.

Indeed. And the hallmark of the really good design is to examine the interactions of those features and see how well they mesh together. And what they imply about how actual programs are designed and maintained.

Re:Half a decade with Go by thirsteh on Monday November 10, 2014 @06:05PM (#8587219)
While I agree with these arguments, the purpose of Go is to Get Stuff Done (TM), and the main purpose of Haskell is to foster PL research and semi-formal methods. It's not really fair to say Haskell is unpopular because it crammed a bunch of things inthere: It is very popular in the niche it was designed for. Go just has a wider appeal.

And remember not to equate popularity with quality. We're all using JavaScript because that's what you need to do in the browser, not because it's a particularly good language. (Not that Go doesn't deserve the adoption it's gotten. It's great to see people ditching clunky Python/Ruby/C++/JavaScript stuff for Go.)

Re:Half a decade with Go by macu on Monday November 10, 2014 @09:35PM (#8587979)
> I program in Go because when writing code, it irritates me less than other languages.

This is how I feel too. There are countless styles of prose, but some styles are restricted deliberately for aesthetics or practical reasons. I prefer to write prose in plain terms, and Go enables me to write code the same way. Some languages more than others have parts that stick out in odd ways, and add unwelcome personality to my code.

Yet sometimes I wish to put higher concepts into abstract terms, and Go is less expressive here. You can't always shape things the way you want, and you can't build reusable parts with the same flexibility as in other languages. But, when it comes to tinkering and giving form to ideas, I am more productive working with a basic set of LEGO than a box of all the specialized pieces someone may have thought I might ever find a use for.

Re:Half a decade with Go by dragonwriter on Tuesday November 11, 2014 @10:34AM (#8590278)
> You should ponder why Erlang or Haskell achieved a fraction of Go's adoption despite being on the market 20+ years longer.

Because Google.

In longer form, because Google is big and Go is well-enough-adapted for problems Google has (there may or may not be better solutions, and there may be some NIH factor going on in Google favoring it, but its at least good enough), and because the fact that Google is big and behind Go, that gets it lots of attention and interest and use even in places where it may not be as well suited as alternatives or what it is replacing.

Re:Half a decade with Go by coldtea on Tuesday November 11, 2014 @04:18AM (#8589011)
>You should ponder why Erlang or Haskell achieved a fraction of Go's adoption despite being on the market 20+ years longer.

Programmers liking confortable algol like syntax, and Google pushing it?

Re:Half a decade with Go by tptacek on Monday November 10, 2014 @05:06PM (#8586877)
That's a reductive summary of goroutines. I don't doubt other languages have competitive features, but let's be clear about what the feature is:

* Lightweight threads with a scheduling and state overhead low enough to run hundreds of thousands of threads at a time.

* Seamless integration with the language, without any rituals or incantations needed to invoke them; you can, for instance, trivially pass closures from goroutine to goroutine.

* A data sharing scheme that makes sense with promiscuous threading ("synchronized" data structures often don't, because they'll end up serializing threads)

Lots of languages have green threads, but not all these properties.

I'm guessing Haskell does? I don't write Haskell, but my impression is that it has everything.

Re:Half a decade with Go by lobster_johnson on Monday November 10, 2014 @05:33PM (#8587036)
Erlang has the first two concepts nailed down.

I don't know what "data sharing ... with promiscuous threading" is, but Erlang is functional and immutable, so data sharing only exists in the sense of passing immutable data structures around. Synchronization issues associatied with mutations don't exist for in-memory structures since it's all read-only access.

I don't know Haskell's concurrency tools very well, but I believe it can provide much of the same functionality as Erlang, but the whole OTP toolset is missing — just as it is in Go. (Certain aspects of OTP can't be implemented in Go at all without additional changes to language/runtime.)

Re:Half a decade with Go by tptacek on Monday November 10, 2014 @05:35PM (#8587044)
Neat. You can start an Erlang process (or whatever they're called) with an anonymous function, and pass it another anonymous function that closes over another lexical environment?
Re:Half a decade with Go by jerf on Monday November 10, 2014 @05:52PM (#8587152)
Yes, both in Haskell and Erlang.

For me, Go's big win is that I can finally bring this, the right way to do it, to work, because it's the first time this paradigm is present in a conventional imperative language, not that it is the first in general. Many other languages got it right in theory before Go, but there was always some practical stopper, involving some obscure programming paradigm that I stood no chance of getting buy-in on (from engineering or management) or an ecosystem that simply couldn't be reasonably be called production-ready across the set of tasks I needed to accomplish. Go finally gave me almost everything I wanted for work. If it isn't everything, well, that's life sometimes, you know?

Re:Half a decade with Go by hyp0 on Monday November 10, 2014 @06:38PM (#8587371)
Like Java's strategy (http://www.win.tue.nl/~evink/education/avp/pdf/feel-of-java....)

  Java is a blue collar language. It's not PhD thesis
  material but a language for a job.  Java feels very
  familiar to many different programmers because we
  preferred tried-and-tested things.
Re:Half a decade with Go by lobster_johnson on Monday November 10, 2014 @05:53PM (#8587157)
Absolutely:

    do_stuff() ->
      GetAnswer = fun() -> 42 end,
      spawn(fun() -> io:format("The answer is ~p\n", [GetAnswer()]) end).
Here, GetAnswer is a closure, as is the anonymous function given to spawn() function.
Re:Half a decade with Go by jussij on Tuesday November 11, 2014 @05:53AM (#8589250)
And here is why these functional langauges will never make main stream.

I've, been programming for 20+ years and I look at that code and say what the f*k?

Ooh, it's the functional stuff. Ok, move on.

Re:Half a decade with Go by lobster_johnson on Tuesday November 11, 2014 @11:14AM (#8590552)
Seriously? I mean, Erlang has some gnarly syntax, but this is really basic, and translates directly to anything you'll find in JavaScript, Go, Ruby, Scala, C++, even Java.

Let me take you through it:

    do_stuff() ->
This declares a function do_stuff(). It's exactly like:

    function do_stuff() { ... }
Everything after is the body. Unlike many languages, Erlang uses comma, not semicolons, as statement separators, function bodies end with a "." so a function follows the form:

    do_stuff() -> a, b, c.
Here, a, b and c are statements. The last statement provides the return value. This directly translates to:

    function do_stuff() { a; b; return c; }
Next line defines a variable:

    GetAnswer = fun() -> 42 end,
This just defines a variable which is an anonymous, inline function, sometimes called a closure or a lambda (all three are technically correct). In Erlang, anonymous functions end with "end", not ".". This is equivalent to JavaScript:

    var GetAnswer = function() { return 42; };
The next line is therefore easy to understand, as it uses the same inline function syntax; it calls spawn() with this function as an argument. So it's this:

    spawn(...)
The argument is this function:

    fun() -> io:format("The answer is ~p\n", [GetAnswer()]) end
JavaScript version:

    function() { return io.format(
      "The answer is ~p\n", [GetAnswer()]); }
(Of course, JS doesn't have spawn() or io.format(); this is just syntax.)

Complete version:

    function do_stuff() {
      var GetAnswer = function() { return 42; };     
      spawn(function() {
        io.format("The answer is ~p\n", [GetAnswer()]); });
    }
In some ways, the JavaScript version is actually gnarlier. Look at all those braces and semicolons.

The thing is, the syntax we found nice is usually nice because it's familiar. Many languages could seem like an incomprehensible mess if you're used to C-style brace syntax. But that's purely a question of familiarity. If you don't know what all the bits and pieces mean, you're going to be alienated by it. A developer who has grown up on COBOL and Forth will not find JavaScript syntax familiar any more than you find Erlang syntax familiar.

I suggest stepping out of your comfortable protective shell and trying it out. It's not rocket science. After 30-60 minutes reading this book you'll no longer find it alien, I bet:

http://learnyousomeerlang.com

Re:Half a decade with Go by brickcap on Monday November 10, 2014 @11:14PM (#8588267)
Also don't ets tables do that, #3 I mean? Where different processes can access the same data structure? You can even control what process read or write to it. It is pretty neat.
Re:Half a decade with Go by thirsteh on Monday November 10, 2014 @05:58PM (#8587192)
Yeah, you could have said the same about Haskell. 'forkIO' in Haskell and 'go' in Go are essentially identical. You could also argue that Haskell's STM is even safer than using CSP channels (which also exist in Haskell) since you greatly decrease your chance of data races (while sacrificing some performance in cases where a transaction is often retried.)

But in the end it doesn't really matter that much. Go and Haskell are completely different languages for different purposes (getting stuff done in regular companies vs. doing interesting PL research or more advanced development in companies with little turnover.)

Re:Half a decade with Go by coolsunglasses on Monday November 10, 2014 @07:26PM (#8587546)
>You could also argue that Haskell's STM is even safer than using CSP channels (which also exist in Haskell) since you greatly decrease your chance of data races

We actually have transactional and non-transactional channels as well, which is pretty cool.

Also the reason for using STM instead of channels is that they compose without the possibility of deadlock. You can have deadlocks with channels.

Re:Half a decade with Go by tel on Monday November 10, 2014 @06:00PM (#8587196)
I'll try to represent Haskell here.

1. Totally, definitely. The new Haskell IO manager in GHC 7.8 completely blows this out of the water. It's wonderful.

2. You fork or async IO procedures which can be considered immutable values in their own right and passed around without the slightest concern. There is a small difficulty in that Haskell's laziness makes it a small trick to ensure that work gets done in the right place, which is undoubtedly a mark against Haskell, though perhaps not a huge one.

3. Things like STM, MVars, and (now) LVish let this happen in all kinds of ways. The only problem might be picking the right option due to the wealth of choices. Fortunately, the right answer is almost always STM.

I'd be more than happy to translate a task to demonstrate these things.

Re:Half a decade with Go by asdf1234 on Monday November 10, 2014 @06:49PM (#8587416)
> The new Haskell IO manager in GHC 7.8 completely blows this out of the water.

Go will still outperform Haskell by a huge margin and the typical Go process will have a much smaller memory footprint.

I don't even like Go, but nobody choosing Go is realistically considering Haskell as an alternative.

Re:Half a decade with Go by samth on Monday November 10, 2014 @07:28PM (#8587557)
I encourage you to look a the benchmarks published here: http://haskell.cs.yale.edu/wp-content/uploads/2013/08/hask03... which includes Haskell beating nginx and Haskell beating SDN controllers written in C++ and in Java.
Re:Half a decade with Go by tel on Monday November 10, 2014 @07:10PM (#8587491)
I'm not so sure that is true. I'd love to see some benchmarking, though.
Re:Half a decade with Go by platz on Monday November 10, 2014 @07:09PM (#8587488)
I don't like go either, but I won't believe that a ghc webserver is a fast as a go webserver until we can see it in the techempower benchmarks.
Re:Half a decade with Go by coolsunglasses on Monday November 10, 2014 @07:24PM (#8587539)
The Techempower benchmarks are using the old version of GHC, 7.6, and the Golang devs have been tuning Go's core libraries to win at this specific benchmark.
Re:Half a decade with Go by jlouis on Monday November 10, 2014 @08:51PM (#8587821)
Even then, it is only a factor of 2 slower. That is next to nothing.
Re:Half a decade with Go by coolsunglasses on Monday November 10, 2014 @09:03PM (#8587864)
Right, precisely, and this is at a very silly tier of microbenchmarking where you're doing little to no actual work, something you virtually won't ever find in the "real world".
Re:Half a decade with Go by fjh on Tuesday November 11, 2014 @06:17AM (#8589299)
> The Techempower benchmarks are using the old version of GHC, 7.6

7.4, last time I checked.

Re:Half a decade with Go by Mikera on Tuesday November 11, 2014 @12:38AM (#8588488)
Clojure has all of this in core.async - which is just a library, it doesn't need special support from the underlying language.

goroutines are certainly nice and CSP is a good mental model for solving many problems, but I don't think a feature like this should be used to justify switching to a whole new language.

Re:Half a decade with Go by Blackthorn on Tuesday November 11, 2014 @12:44AM (#8588506)
What? No. You could not be more wrong. core.async does not support the first point in the least.

Don't believe me? Make a go block in core.async and have it call another function, then have that function block. Do it 10,000 times. I'll wait. And wait. And wait. And wait...get the picture?

Clojure has this in Pulsar, which is a library...that happens to perform bytecode modification to support this (which I consider to be on the same level as special support from the underlying level). Pulsar is an absolutely amazing project and I'm not trying to take anything away from it with this comment, but merely trying to illustrate how far off you are.

Re:Half a decade with Go by enneff on Monday November 10, 2014 @04:35PM (#8586643)
This talk (mentioned in the article) captures a lot of the value that I see in Go: https://www.youtube.com/watch?v=dKGmK_Z1Zl0
Re:Half a decade with Go by grey-area on Tuesday November 11, 2014 @01:57AM (#8588652)
What do you think is worthwhile about Go?

Simplicity - the main feature is all the interesting things they left out.

Re:Half a decade with Go by camgunz on Monday November 10, 2014 @10:45PM (#8588173)
The difference is I can read Go code while having no experience with it. Erlang and Haskell are inscrutable to 90% of programmers.

If you think this isn't important, I will point out that Rust has been frantically trying to look more like Go and less like garbage in every release. Or, I will also point out that the Elixir project exists, which basically does the same thing for Erlang.

Re:Half a decade with Go by pcwalton on Tuesday November 11, 2014 @01:29AM (#8588584)
Rust is not "frantically trying to look more like Go". There are places where Rust's syntax deliberately differs from that of Go (for example, putting colons between values and types), and that will not change.