Live data from Hacker News

Why we switched from Python to Go

getstream.io

221–230 of 406 posts

Re: Why we switched from Python to Go

#221

Why does anyone write web apps in Python? PHP? Ruby? Modern Java and Go are so much faster than the alternatives that it's stupid to consider anything else if performance is important. Golang and Java can manage over a half million HTTP responses a second. Node is pretty fast but why bother when Java is many times more mature in features, tooling, and and supports concurrency... And uses less ram and is usually faste…

Most of the time, runtime speed is far, far less important than developer speed.

Speed and memory usage don’t matter until you need to rent servers on AWS

Re: Why we switched from Python to Go

#222
post #213

Earlier quoted context omitted.

I've occasionally had things spontaneously break. Most recently the cryptography package just stopped installing on deployment. Had to add a pip upgrade on deploy, which somehow prevented the AMI I was using from installing some of its requirements. Had to add those packages to my project requirements. Also some of the data analysis packages don't work with virtualenv.

> Most recently the cryptography package just stopped installing on deployment. Had to add a pip upgrade on deploy, [...] Erm... Why the heck are you running pip when deploying software? O_o It should be a build step, not a deployment step.

For a number of reasons, I haven't bothered to do a complex build/deploy process. I write in python, I freeze the requirements into requirements.txt, and I type "eb deploy". Anything else is overkill for me.

Re: Why we switched from Python to Go

#224

Why does anyone write web apps in Python? PHP? Ruby? Modern Java and Go are so much faster than the alternatives that it's stupid to consider anything else if performance is important. Golang and Java can manage over a half million HTTP responses a second. Node is pretty fast but why bother when Java is many times more mature in features, tooling, and and supports concurrency... And uses less ram and is usually faste…

Can you point a clueless (about Java web dev) person to a nice, lightweight framework that's easy to learn and to set up? Please no XML configuration files and other such nonsense. For me as a Python/Rails/C++ dev Java has a reputation of being too large, too complex and otherwise.. unwieldy. Hearing things like "To test a bug I had to start 6 services on my computer and then I ran out of memory (computer had 16GB)"…

How much of a framework do you want?

These days, i write most of my applications using the JDK's built-in web server. They're intended for internal use by single-digit numbers of people, and it works fine. It doesn't give you anything except the ability to serve HTTP, though.

Before that, i was writing apps using Spring Boot, which is a framework covering pretty much everything. It's easy to get started with, and requires no XML, but gets complicated fast as soon as you want to do anything even slightly unusual.

A more production-grade alternative to the built-in web server is Undertow, which again just does HTTP, but is fast and scalable, and fairly simple:

http://undertow.io/undertow-docs/undertow-docs-1.4.0/index.h...

Some people swear by Dropwizard as a more lightweight but still framework-sized alternative to Spring:

http://www.dropwizard.io/1.2.0/docs/getting-started.html

The tutorial there uses a smidgen of XML for Maven, but that's all. You can use Gradle instead of Maven, which lets you avoid XML and is generally much better, but you'd have to work that out yourself, or find someone else who has, perhaps this person:

http://automationrhapsody.com/build-dropwizard-project-gradl...

There's also Java EE, the 'offical' framework for Java. It's actually not bad to program with, but you need an application server to run your apps, and although those are miracles of engineering, the user experience is still stuck in the dark ages.

> Hearing things like "To test a bug I had to start 6 services on my computer and then I ran out of memory (computer had 16GB)" doesn't encourage me to try to do web dev in Java.

If you need to start six services, you must be doing some kind of microservice / SOA thing, and if you need >2 GB for each service, you must be using some very heavy-weight application server. Neither of those things are smart, and in combination, they're deadly!

Re: Why we switched from Python to Go

#225
post #32

A thing that REALLY turned me off in go... The fact that go's Math functions only work with floats. Idiotic. You have so many packages that have to add the same freaking min(int a, int b) function.

Does Go have templating?

Templating is built right into the Stdlib https://golang.org/pkg/text/template/

The only 3rd party library I pull in to build web servers is gorilla (routing, sessions) and a database driver .

Everything else you need is in the go standard library .

Re: Why we switched from Python to Go

#227
post #28

> Our largest micro service written in Go currently takes 6 seconds to compile. What's the biggest, beefiest real world program yet written in Go, and how long does it take to compile it?

Docker takes about 10m to build: https://jenkins.dockerproject.org/job/docker/job/docker.gith... Kubernetes takes about 16m: https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/...

On a not-too-old notebook, building k8s needs less than one minute.

Re: Why we switched from Python to Go

#228
post #183

Wait just one minute, Thierry... Are you telling me that Python helped you create a viable tech-oriented newsfeed and activity stream business, serving 500 companies and more than 200Million "end users"? That sounds like a great incentive for any entrepreneur to get started with Python. You've gotten this far by using the language you've turned away from! Further, I'm confident you didn't solve every challenge you've…

It reads like a reasonable rationale for why they switched to Go. Uninteresting maybe, but certainly no village burning. You sound indignant for some reason that isn't related to the content of the article.

Indeed the author even:

1) recommends Django or Rails for CRUD apps 2) mentions a lack of frameworks in Go as a negative

It's a good article and not a rant about which language is "better"

Re: Why we switched from Python to Go

#229
post #21

Earlier quoted context omitted.

> Go also doesn't have the problem of conflicting system level packages. Sure, as long as you're not using CGO and dynamic linking. Otherwise you'll get the exact same problems as the others. > Go doesn't have to deal with interpreter dependencies As long as Go is forward compatible this will old true, but I don't think this was the point of the comment. 'go get' is a half-baked package manager and yes it fetch packa…

> Sure, as long as you're not using CGO and dynamic linking. Otherwise you'll get the exact same problems as the others. Not even then, to be honest. I wrote a product that is deployed on many thousands of servers, and all of a sudden a not-insignificant population just started experiencing SIGABRTs on process start. Turns out Amazon Linux (and some others) had removed a syscall that i386 Go on Linux was relying on (…

Was the system call part of POSIX or the standard Linux interface? Because if so, that sounds like the fault belongs to Amazon, not Go. The same thing could happen to the Python interpreter.

Re: Why we switched from Python to Go

#230

How do these shallow articles get upvoted so much ? they don't have much specific information except very generic "developer productivity". Let me give a specific example where moving to Go really helped our tooling: Go has some great interfaces, specifically their net & ssh client. In order to perform operations against some machines, we have to tunnel through bastions, however we'd also like the tool to work when a…

Did you read the article? It certainly wasn't shallow nor was it negative.

You are right in 90% of these post they are shallow this one was really a good read.

Post reply on HN