News for hackers. Stuff that matters.
Re:How We Went from 30 Servers to 2: Go by jbooth on Tuesday March 12, 2013 @07:12PM (#5365641)
Go has first-class functions, so you could write a library do the same thing with, yes, a few more declarations around it. In your example, .map { |i| i + 9 } is .map( func(i int) int { return i + 9 }), or .map(myFuncDefinedElsewhere) in most real-world scenarios.

As a commenter upthread pointed out, Go and serverside Javascript are aimed at very different use cases and audiences.

Re:How We Went from 30 Servers to 2: Go by paddyforan on Tuesday March 12, 2013 @09:50PM (#5366303)
I thought this would be a fun exercise, so I implemented the Go equivalent. Can anyone get it to fewer lines? It abandoned all pretenses of readability long ago.

http://play.golang.org/p/M5VaeIgQ-q

Re:How We Went from 30 Servers to 2: Go by paddyforan on Tuesday March 12, 2013 @09:56PM (#5366323)
Updated to generalise a bit more. If this ever came up in code review, I'd probably facepalm pretty hard.

http://play.golang.org/p/YUQSZgFx_b

Re:How We Went from 30 Servers to 2: Go by jbooth on Tuesday March 12, 2013 @10:48PM (#5366496)
Ha. Yeah, the map() and reject() function defs are fine but the actual usage is a little eye-bleed inducing :)
Re:How We Went from 30 Servers to 2: Go by paddyforan on Wednesday March 13, 2013 @10:26AM (#5368576)
So now that we've established Ruby is better at being Ruby than Go is, I wonder if there's an actual use case for this kind of thing, so I can demonstrate the "Go way" of handling it...
Re:How We Went from 30 Servers to 2: Go by TresAmiga on Tuesday March 12, 2013 @09:36PM (#5366247)
Wrong and you know it. Go does not have generics so you have to use void* (interface{}) and casting. It ends up being about an order of magnitude uglier and more verbose. Which is why map, fold, etc don't exist in Go.

You go fanatics are incorrigible.

Re:How We Went from 30 Servers to 2: Go by drivebyacct2 on Tuesday March 12, 2013 @10:20PM (#5366398)
Seriously? Is this just a coincidence that another throwaway named "TakeTwo" and then "TresAmiga" are both making throw aways and dismissing all Go users? Jesus.

What he's describing is far more than possible using interfaces. I have plenty of code that does so.

How is that "wrong and he knows it". Your worse than any Go fan here. Where the hell does someone get off being vitriolic about a language or someone's preference for that language. Pathetic, at least have the balls to post under your real account.

That having been said, as an "incorrigible Go fan", I would love to see proper generics. It's something I'm enjoying in Rust. It's also something that everyone is open to adding in Go 2, so it doesn't necessarily have to be a permanent absence from Go.

Re:How We Went from 30 Servers to 2: Go by jbooth on Tuesday March 12, 2013 @10:36PM (#5366451)
There's some idiots who troll the #golang-nuts freenode channel occasionally with a bunch of spam saying 'node is way better!'.

I assume they're not gainfully employed, or else they would understand that the two languages/platforms have very different goals and principles.

Re:How We Went from 30 Servers to 2: Go by drivebyacct2 on Tuesday March 12, 2013 @10:45PM (#5366485)
`chord`? Yeah, I was in there and was one of the people feeding him/her, I'm ashamed to say. I'd had a few beers and wasn't on my best behavior.

Chord was on about "Rails" is better, couldn't fathom a web world without MVC and failed to understand that Rails was just a framework on Ruby and that one could write similar helpers in Go.

It was the perfect example of Dunning-Kruger. Painful to witness.

Re:How We Went from 30 Servers to 2: Go by jlgreco on Tuesday March 12, 2013 @10:53PM (#5366513)
I think there is honestly something wrong with that guy in a mild "losethos" sort of way. He started spamming me trollish nonsense in PMs because I dared utter a single line while he was active.

Something about golang just seems to attract a certain flavor of nutters.

Re:How We Went from 30 Servers to 2: Go by drivebyacct2 on Tuesday March 12, 2013 @11:02PM (#5366549)
He stalked me too. Mocked my parents, my sexuality (lolironic), my job, etc. Classy fella.
Re:How We Went from 30 Servers to 2: Go by paddyforan on Wednesday March 13, 2013 @10:30AM (#5368601)
I'm starting to feel so left out. Why do crazy Go-haters never harass me? Am I not good enough?