News for hackers. Stuff that matters.
Re:Learning Go by porting a medium-sized web back end from P... by fellowmartian on Thursday November 09, 2017 @06:54AM (#15661655)
Using a compiled language is not a premature optimization if you're not sacrificing expressiveness. With that said, Go is not the best choice. Like, for anything.
Re:Learning Go by porting a medium-sized web back end from P... by acdha on Thursday November 09, 2017 @09:49AM (#15662810)
Go isn't my first choice but “like, for anything” reeks of dogma. Can you explain your rationale?
Re:Learning Go by porting a medium-sized web back end from P... by fellowmartian on Thursday November 09, 2017 @10:38AM (#15663259)
That was just a harmless (I hope) hyperbole. I've actually used Go a couple of times for image processing workers and such. And that's when I developed my distaste for this language.

I mean, I get it, it's easy to pick up and use. Coroutines and channels are useful, and make easy to write async stuff.

But god damn, it's so dull and boring, there's no joy in it. We're programmers, we're supposed to extract abstractions and express them in the code we write. And IMO your language should definitely try to help with that.

Instead, Go wants you to do err, value = ..., if err == nil { ... } on almost every single line. You can't adequately compose stuff. Well, you can try, but you quickly run into its ugly, verbose syntax for anonymous functions or lack of generics.

Maybe I'm not getting something, maybe it's just not for me, I dunno. But next time I need high performance compiled language, I'll use Swift or maybe even Rust. Also I think Scala Native is somewhat stable already, gotta look into that.

Re:Learning Go by porting a medium-sized web back end from P... by skj on Thursday November 09, 2017 @12:45PM (#15664283)
I pull my joy from the task being accomplished rather than the syntactic swirls I sketch out while accomplishing it.
Re:Learning Go by porting a medium-sized web back end from P... by hasenj on Thursday November 09, 2017 @08:49AM (#15662302)
What would you choose instead?
Re:Learning Go by porting a medium-sized web back end from P... by didibus on Thursday November 09, 2017 @12:10PM (#15664038)
OP was saying porting a project to Go sounds like premature optimization. The alternative is obviously to continue to use the original language.

The question to be answered is why are you porting it? Fun and giggles? Hoping to achieve better performance? Scale? Portability? Correctness? Simplicity? Support?

I'd say most of the time its for fun and giggles. Which I think is as fine a reason as all the others, but when its costing someone's elses money, maybe you should be more considerate.

Re:Learning Go by porting a medium-sized web back end from P... by hasenj on Thursday November 09, 2017 @09:28PM (#15667495)
I think it's the opposite. Choosing python in the first place is mostly for fun and giggles.

People want to switch away from python because of all the pain they feel from it.

Re:Learning Go by porting a medium-sized web back end from P... by didibus on Thursday November 09, 2017 @09:42PM (#15667539)
Ya, maybe for some. I think for businesses part of it is familiarity, as its now a lot of people's first language. I also think its a choice made often when you start, because it allows you to go faster in the beginning. Which is where a lot of new projects need to be the fastest. Its still a great choice for projects that are short lived, that's why ML works so well on it, most of ML is just quick iterations on prototypes until you find a solid model.
Re:Learning Go by porting a medium-sized web back end from P... by fellowmartian on Thursday November 09, 2017 @10:44AM (#15663312)
Depends. If we're talking about high performance, yet expressive language without a steep learning curve, I say Swift. The only major drawback right now is lack of pure Swift AWS SDK. And unfortunately, AWS team has no plans to write one, yet.
Re:Learning Go by porting a medium-sized web back end from P... by didibus on Thursday November 09, 2017 @12:17PM (#15664075)
I think any of the JVM languages like Java, Kotlin, Clojure, Scala, Eta, etc.

The JVM as far as I know is still the runtime king, faster then Go.

Re:Learning Go by porting a medium-sized web back end from P... by wolco on Thursday November 09, 2017 @10:14AM (#15663043)
For a website? PHP or Ruby. If you feel you have low level needs move to rust. If you want microservices use node. Go is a compromise of everything.
Re:Learning Go by porting a medium-sized web back end from P... by ssijak on Thursday November 09, 2017 @10:24AM (#15663130)
Those languages that you mentioned compromise on much more than go.
Re:Learning Go by porting a medium-sized web back end from P... by plexicle on Thursday November 09, 2017 @01:11PM (#15664481)
That is.. backwards in almost every way.
Re:Learning Go by porting a medium-sized web back end from P... by lmm on Thursday November 09, 2017 @11:22AM (#15663644)
The most general answer is OCaml, though in practice I'd probably use something else depending on the details. For most cases there's a better pick than OCaml, but I don't think OCaml is ever a worse choice than Go.