Live data from Hacker News

Why We Switched from Python to Go (2021)

softwareengineeringdaily.com

31–40 of 301 posts

Re: Why We Switched from Python to Go (2021)

#31
post #9

So they switched to Go from Python, because of following advantages: #1 Performance #2 Performance (to make the list longer I guess?) #5 Fast compile time... which is an advantage over Python how exactly? #7 Strong ecosystem... which brings us to disadvantage #1 - lack of frameworks (?)

You really don't need frameworks on go. You go and pick whatever tools you need like ORMS, http routers or loggers. It is only a disadvantage if you want to have a framework.

you don't need frameworks in any language - the frameworks (for mature frameworks) are almost always modular enough that you can use the parts without the whole.

I prefer frameworks the same way I prefer code linters and formatters. Which is to say they are annoying, but far less annoying than working with a team that spends obscene amounts of time discussing/rewriting code based on opinions. Frameworks come with their own opinions and can help remove a lot of those barriers.

Re: Why We Switched from Python to Go (2021)

#32

So they switched to Go from Python, because of following advantages: #1 Performance #2 Performance (to make the list longer I guess?) #5 Fast compile time... which is an advantage over Python how exactly? #7 Strong ecosystem... which brings us to disadvantage #1 - lack of frameworks (?)

> #5 Fast compile time... which is an advantage over Python how exactly? Compiled code can have fewer runtime errors, that's a big win. I read this as golang is better than python because it's compiled and golang is better than Java and C++ because the compiler is fast.

The advantage then is "the type system", not "fast compile time".

And as far as type systems go, Go is one of the worst in mainstream usage.

Re: Why We Switched from Python to Go (2021)

#33
post #25

Earlier quoted context omitted.

I prefer Go when I want more safety/performance than Python but less ceremony than Rust.

I think the latter point about "less ceremony" is extremely debatable especially on a larger project.

How does Go have more ceremony than Rust without a borrow checker, lifetime annotations and all?

Re: Why We Switched from Python to Go (2021)

#34

So they switched to Go from Python, because of following advantages: #1 Performance #2 Performance (to make the list longer I guess?) #5 Fast compile time... which is an advantage over Python how exactly? #7 Strong ecosystem... which brings us to disadvantage #1 - lack of frameworks (?)

Why skip on the other reasons listed? At least a few of them are technical in nature and don't warrant being omitted from your list.

Re: Why We Switched from Python to Go (2021)

#35

So they switched to Go from Python, because of following advantages: #1 Performance #2 Performance (to make the list longer I guess?) #5 Fast compile time... which is an advantage over Python how exactly? #7 Strong ecosystem... which brings us to disadvantage #1 - lack of frameworks (?)

> #5 Fast compile time... which is an advantage over Python how exactly? Compiled code can have fewer runtime errors, that's a big win. I read this as golang is better than python because it's compiled and golang is better than Java and C++ because the compiler is fast.

I can understand the point - compiling will do the same checks a type hint checker such as MyPy will do and it's a bit faster. I have that in my pre-push hooks, but a lot of people isn't used to the 90's when a compile could take minutes and demand a far less relaxed development pace.

Re: Why We Switched from Python to Go (2021)

#36

So they switched to Go from Python, because of following advantages: #1 Performance #2 Performance (to make the list longer I guess?) #5 Fast compile time... which is an advantage over Python how exactly? #7 Strong ecosystem... which brings us to disadvantage #1 - lack of frameworks (?)

“Performance” - looks like “I bought Ferrari instead of Hyundai because it faster”.

Re: Why We Switched from Python to Go (2021)

#37
I'm considering moving away from Python as well, to compiled language also. Performance and single executable are my primary motivation. I'm tired of venv, PYTHONPATH and OS package dependency issues.

I'm however very much reliant on Pandas and Pyarrow for custom ETL works. Does anyone have suggestion what language and ecosystem I can switch to? Preferably something simple that does not require cluster or JVM to avoid deployment hassles.

Re: Why We Switched from Python to Go (2021)

#38
post #23

Earlier quoted context omitted.

#7 given Go can't compare to Python on ecosystem breadth and depth, its a curious choice of "reason to switch"

It's been a while since I wanted something in Go that wasn't available, other than the obvious big-ticket items like NumPy which are ecosystems unto themselves. (Or, to put it another way, yeah, Go doesn't have NumPy, but neither does anybody else other than Python at this point.) YMMV, of course, but it's certainly not a routine occurrence.

The other packages I've missed are all Rust or C packages that manage to create absurdly compact or performant versions of low level structures and blocks like tries, probabilistic filters, encryption primitives, or custom binary storage solutions.

All things that Java, Go, C# and others just can't be the best at because of the overhead or GC.

Re: Why We Switched from Python to Go (2021)

#39
post #14

>[Go] is almost as fast as languages like C++ and Java. It seems like only a couple of years ago when Java's speed was the butt of many a joke. The JVM has come a long way. As someone who doesn't work in Java and doesn't have a horse in this race, I find their turnaround impressive.

The JVM has already been quite impressive for the last two decades for backend computing workloads.

First of all, there are plenty of implementations to chose from, everyone is now talking about GraalVM, because the basic version is free beer, yet AOT has been a thing in commercial Java compilers for quite some time.

Nowadays OpenJDK and OpenJ9 offer JIT caches with PGO feedback across executions, well, OpenJDK one started in J/Rockit, and OpenJ9 traces back to Metrome/Websphere Real Time/J9.

My first large scale Java project was done in 2005, when our team at Nokia Networks started the transition of a C++ infrastruture used for base stations reporting into Java.

Did Java win against C++ in microbenchmarks back in 2006, not at all, yet Java 5 JIT compiler in IBM J9 and Sun's JVM already provided enough performance juice that we could perform such endevour, while keeping the system responsive.

Eventually some other issues plagued the project, however they were related with politics between the C++/CORBA folks and us bringing up the new platform.

Re: Why We Switched from Python to Go (2021)

#40
post #14

>[Go] is almost as fast as languages like C++ and Java. It seems like only a couple of years ago when Java's speed was the butt of many a joke. The JVM has come a long way. As someone who doesn't work in Java and doesn't have a horse in this race, I find their turnaround impressive.

Hmm, I feel like that’s been the case for more than a couple of years. Java has been fast for well over 10 years, I’d say.

But I think Java also still has the problem that it tends to use a ton of memory (unless you use it the fintech way, manually wrangling your data in arrays rather than using lots of objects).

My subjective impression is that garbage collected languages have gone through a bit of a rise and fall over time -- “GC is bad because it’s slow!” “huh, GC is fast now” “Java is the way forward!” “GC uses a lot of memory” “Rust [or Swift] is the way forward!”

Post reply on HN