3 ms·
"explain why they are better than Erlang or Akka's actors, STM in Clojure or Haskell," They aren't. I analyzed Go for my personal use, and I have a high degree
by jerf 14y ago
"explain why they are better than Erlang or Akka's actors, STM in Clojure or Haskell,"
They aren't. I analyzed Go for my personal use, and I have a high degree of familiarity with Erlang and Haskell. The conclusion I came to was that it is a step back from Erlang and Haskell's concurrency support, and that I didn't care to step back into those problems. It's easier to do concurrency correctly in Go than it is in Python or C, but it's still pretty easy to make it blow up in your face and take down your whole program. You to both learn Go, and then learn all the implicit (and to some extent still forming) rules about exactly how you can safely handle channels, which the compiler can't help with.
(I tried to keep an open mind, but I'm still of the opinion Erlang's processes with asynchronous mailboxes is better than Go's synchronous channels. Note that's two differences, not one; sync vs. async, and mailboxes vs. channels. And they are effectively synchronous, even when you set a buffer size, because there's still a hard cap on when the channel is full; semantically the difference between a 1-element sync channel and a 10-element sync channel is pretty minimal, you get the same crashes and failures either way if you misuse them, it just takes a bit longer in the 10-element case. Oh, and since "synchronous" seems to have had its meaning mangled here in the past few years, in this case it means that the writing and reading of a channel must coordinate.)
But if you're coming from a traditional Algol language, it's a big step forward. I'm sure coming to Go from Python or Lisp feels like a blast of fresh air, because it really is an improvement. And it gives you this without having to abandon your Algol roots, which most of the rest of your alternatives do (except Akka, though I don't how hard those are to use correctly since they're in a mutable language), and that is saying something.
- voidlogic 14y agoDoesn't some of this depend on the performance needs of your application. Go appears to be faster and use less memory the Erlang in this popular microbenchmark: http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?test=all&lang=go&lang2=erlang&data=u64q http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t... Go vs Haskell/Erlang has a similar showing in TechEmpower's Web Framework Benchmarks: http://www.techempower.com/benchmarks/ http://www.techempower.com/benchmarks/
- jerf 14y agoI didn't say anything about performance, and that's because I don't think performance has much to do with it. If Go used asynchronous mailboxes, its performance at most would be ever so slightly worse, it would still be much better than Erlang, and Go's performance loss would probably entirely disappear in microbenchmarks anyhow. Indeed, that's one of my frustrations with Go, one of the big reasons I chose to leave it alone. The ways in which it is much less safe to use concurrently than Erlang or Haskell aren't performance related, they're related to the choice of primitives. (In particular, I can't see how to build an OTP equivalent for Go. This is a big problem for me, since I was looking at it to replace Erlang, but I'm not ripping out something that has demonstrated how bullet-proof it is to replace it with something more fragile like Go, when performance is not my problem.) To be clear, I'm just talking about the concurrency primitives, and I do not believe that Go's concurrency primitives are better than Haskell or Erlang's, full stop. That does not mean Go is not a better language for some tasks, and I further believe Go's concurrency primitives are a step up over most current "conventional" languages, equally full stop. For one thing, to program in Erlang or Haskell requires programming in Erlang or Haskell, which is why I mentioned the fact that Go is still an Algol-esque language. That's a legitimate advantage. I've paid the price of learning the alternate paradigms, but I would generally recommend Go to a larger corporate deployment before I'd recommend trying to convince a couple dozen people to learn Erlang. So much... whining.
- voidlogic 14y ago>>I didn't say anything about performance, and that's because I don't think performance has much to do with it. Sure but that is why I brought it up. Performance and safety are very often two sides to the same tradeoff. You were saying you thought the concurrency of Erlang was safer, and I was proposing that depending on the problem domain, a little risk can be worth the performance gain. That being said, I think Go makes concurrency easy to get right (much less risky than say C/C++), it just doesn't ensure correctness. >>...Go is still an Algol-esque language. That's a legitimate advantage. I've paid the price of learning the alternate paradigms, but I would generally recommend Go to a larger corporate deployment before I'd recommend trying to convince a couple dozen people to learn Erlang. Wise man :)
- orangethirty 14y agoBut if you're coming from a traditional Algol language, it's a big step forward. I'm sure coming to Go from Python or Lisp feels like a blast of fresh air, because it really is an improvement. And it gives you this without having to abandon your Algol roots, which most of the rest of your alternatives do (except Akka, though I don't how hard those are to use correctly since they're in a mutable language), and that is saying something. You hit the nail on the head. It does feel like a blast of fresh air. I've been eyeing Erlang and Haskell, but have not had to chance to do something worthwhile with them.
- jerf 14y agoYes. I guess it's a bit late, but let me be clear: I'm critical of Go, but it is a good language (and from me that's saying something, I have a high bar), it has great potential, and I wouldn't be surprised I still find myself working in it in a few years. It's either at or very quickly approaching "bet your startup on it" status. The tooling is fantastic and there are a lot of other great ideas in it. My personal experience base is freaking weird, and if you don't have Erlang or Haskell already under your belt, then I recommend considering Go quite strongly. You won't be bothered by some of the things I'm bothered by. And I will find some fresher story to say this on at some point, to be fair.
- happy_dino 14y ago> The tooling is fantastic and there are a lot of other great ideas in it. Which IDE would you recommend for it?
- orangethirty 14y agoI use textmate. Works very well.
- happy_dino 14y agoThat's not an IDE. What's the value of static typing if you have you don't have any tools which make use of it to provide code analysis, completion and refactoring options?