News for hackers. Stuff that matters.
Re:New stable release of Go by swannodette on Thursday May 05, 2011 @01:43PM (#2518222)
What's the appeal of Go when something like OCaml exists and seems to cover much of the same territory and delivers better performance? Not trolling here, I'm genuinely curious.
Re:New stable release of Go by uriel on Thursday May 05, 2011 @02:00PM (#2518299)
First of all, it is quite obvious that Go and OCaml are completely different languages designed around very different philosophies and styles.

Also saying that you are not trolling doesn't make your comment any less trollish, specially given that your only claim is false, Go, despite still being much younger and greatly unoptimized is already considerably faster than OCaml: http://shootout.alioth.debian.org/u64/benchmark.php?test=all...

Re:New stable release of Go by swannodette on Thursday May 05, 2011 @02:54PM (#2518507)
I'm asking about technical merits of one over the other, which you didn't respond to at all. And look at the overall scores on the 64bit one-core and quad-core benchmarks. OCaml is ahead.
Re:New stable release of Go by chc on Thursday May 05, 2011 @03:38PM (#2518653)
I'm looking at the overall scores on the 64-bit single-core and Go is six places ahead of OCaml. On the 64-bit quad, Go is five places ahead. The only one where OCaml appears to come close is single-core 32-bit, in which Go comes out one place ahead of OCaml.

(And just so we're clear: I actually like OCaml and have never used Go. So I'm not trying to wave some Go fanboy flag or anything. Those are just the numbers.)

Re:New stable release of Go by igouy on Thursday May 05, 2011 @04:16PM (#2518755)
> six places ahead ... five places ahead ...

Those tables do not show a rank # by each programming language implementation because that might encourage people to make a completely bogus comparison!

(For example, six places rather than five just because one table includes an extra programming language - Clean.)

You're both being silly! "The numbers" for Go 6g and OCaml overlap and are quite similar.

Re:New stable release of Go by uriel on Thursday May 05, 2011 @04:09PM (#2518741)
I thought you were talking about performance, in which case the relevant chart is:

http://shootout.alioth.debian.org/u64/which-programming-lang...

Which shows Go is well ahead of OCaml.

The "which language is best" chart you linked has rather arbitrary weighting.

Re:New stable release of Go by igouy on Thursday May 05, 2011 @04:30PM (#2518795)
Both pages show "performance" - they show 2 different summary statistics of "performance".

> The "which language is best" chart you linked has rather arbitrary weighting.

That chart has exactly the same "weighting" as the chart you say is "the relevant chart"!

> Which shows Go is well ahead of OCaml.

Which shows the time measurements for those programs with Go 6g and OCaml completely overlap

http://shootout.alioth.debian.org/u64/which-programming-lang...

The time measurements are similar for both Go 6g and OCaml -

http://shootout.alioth.debian.org/u64/benchmark.php?test=all...

Re:New stable release of Go by igouy on Thursday May 05, 2011 @05:14PM (#2518934)
Did you downvote my reply instead of trying to justify your own comments ?
Re:New stable release of Go by chc on Thursday May 05, 2011 @05:21PM (#2518960)
You can't downvote replies to your own comments on Hacker News, so that seems unlikely unless he's sock-puppeting.
Re:New stable release of Go by burgerbrain on Thursday May 05, 2011 @04:56PM (#2518866)
You seem to be under the misunderstanding that simply because you asked a question that has a technical response it is not a troll.
Re:New stable release of Go by swannodette on Thursday May 05, 2011 @05:31PM (#2518988)
Half the responses were of the reasonable variety - "Not really much to say as far as technical merits - but it feels better to program in Go for me". Some brought up interesting similar projects. And others corrected my errors. Since when is sparking reasoned debate/discussion trolling?
Re:New stable release of Go by smosher on Thursday May 05, 2011 @02:55PM (#2518514)
You can learn to be useful in Go in about 5 minutes, and it has some extremely convenient support for concurrency.

On the flipside, I think learning OCaml (if you've no experience with that family) will make you smarter in a way that Go won't. Of the two, given someone that knew neither: if you want to learn something learn OCaml, if you want to do something use Go.

Aside: speaking of OCaml and new languages, have you looked at Rust? https://github.com/graydon/rust/wiki - it was bootstrapped in OCaml.

Re:New stable release of Go by swannodette on Thursday May 05, 2011 @03:00PM (#2518529)
I have looked at Rust. Rust looks like it has the potential to be a much bigger game changer than Go in the systems programming space, in my humble opinion. But only time will tell.
Re:New stable release of Go by icey on Thursday May 05, 2011 @03:28PM (#2518625)
Why do you think Rust has the potential to be a much bigger game changer than Go in the systems programming space? I assume you have technical reasons for this opinion?
Re:New stable release of Go by swannodette on Thursday May 05, 2011 @03:46PM (#2518685)
Typestate for checking a much larger class of invariants.
Re:New stable release of Go by supersillyus on Thursday May 05, 2011 @02:21PM (#2518372)
OCaml delivers better performance? It was my impression that they're currently neck-and-neck, and the current Go compiler does pretty much no optimization.

That aside, personal preference is a one reason to choose Go over OCaml. I happen to like Go's syntax better, and I rather like the design of various bits of the language. Go also has better concurrency support. Also, for some tasks it can be quite useful to be able to control the memory layout of your data structures, and (to my knowledge) OCaml can't do that.

There are other points to make on both sides, but really, it's a tricky question. Which langauge is best is a per-task and per-person question, so unqualified comparisons aren't terribly useful.

Re:New stable release of Go by sambeau on Thursday May 05, 2011 @07:58PM (#2519419)
There are two Go compilers gc and gccgo. gc is based on the Plan 9 C compilers and has very little optimisation; gccgo is a front-end to gcc and as such has all of its optimisation. gcc's concurrency support is thread-based so slower than gc's which is coroutine based.

tl;dr:

gc: slower code, faster concurrency.

gccgo: faster code, slower concurrency.

Re:New stable release of Go by txxxxd on Thursday May 05, 2011 @03:27PM (#2518621)
Most of the appeal for me is not the features that Go has, but rather the features that have been intentionally left out.
Re:New stable release of Go by uriel on Thursday May 05, 2011 @05:51PM (#2519042)
And this is the fundamental point all the people saying there is nothing 'new' about Go miss.
Re:New stable release of Go by lefessan on Monday May 09, 2011 @07:22AM (#2528304)
You are comparing different things. OCaml strength is safety, it verifies at compile time that your program is safe, correct apart algorithmic errors. Once it compiles, you are almost sure it is going to work. Go does not give any such guarantee.

And among "safe" languages, OCaml is probably the most efficient, generating fast code running with a small memory footprint.

Moreover, although its development was a little slow in the last years, they have recently restarted working on it, on optimizations and soon multicore support, so I would wait a little before making more comparisons.

Re:New stable release of Go by mr1900 on Thursday May 05, 2011 @03:00PM (#2518528)
since we are comparing go and ocaml, why did they not add more functional programming support in go? It would at a lot of expressiveness to the language. Just wondering.
Re:New stable release of Go by Hemospectrum on Thursday May 05, 2011 @03:25PM (#2518611)
Call me crazy but it seems like Go is really just a munging-together of C and Limbo with a bunch of ideas from Python, and literally every feature that "supports functional programming" is only there as a result of being in Python. And obviously Python is not really designed to be a functional language....
Re:New stable release of Go by uriel on Thursday May 05, 2011 @04:27PM (#2518785)
If you think Python was a significant influence in Go's design you probably have not worked with much with Go or its ancestors.

Yes, Go is not a 'purely functional' language, or 'purely' anything, Go is a pragmatic language following from a very long tradition mostly at Bell Labs.

Re:New stable release of Go by Hemospectrum on Saturday May 07, 2011 @12:29PM (#2523978)
> If you think Python was a significant influence in Go's design you probably have not worked with much with Go or its ancestors.

You're correct. I haven't used Go particularly much and I've only heard third-party descriptions of Limbo et al. Regardless, a number of the semantic and syntactic differences between Limbo and Go strike me as Python-influenced (obviously not goroutines or the defer statement) but if you have evidence to the contrary I'd love to see it.

> Yes, Go is not a 'purely functional' language, or 'purely' anything

Whoa buddy. That's not what I meant at all. There's no technical value in being able to say your language "purely" implements some programming style or other. Now, it would be nice if higher-order functions became a little easier to work with in Go; it is also unlikely that this will happen, because that's not one of the design goals. I can't fault them for that, but is there really any harm in pointing out a true fact such as this one?

And anyway, a "purely functional" language is just one where there's no built-in support for mutable state. Obviously this does not describe either Go or OCaml.