Live data from Hacker News

Why we switched from Python to Go

getstream.io

361–370 of 406 posts

Re: Why we switched from Python to Go

#361
post #313

Earlier quoted context omitted.

> It'd be great if there were better benchmarks for common use cases of various languages Somebody should make those. (People may have different ideas about which use cases are common).

There are some: https://www.techempower.com/benchmarks/ As you can see, erlang is far from the top there.

I don't see Erlang listed at-all on that "Fortunes" page ?

Re: Why we switched from Python to Go

#362

Earlier quoted context omitted.

Really? How does it work?

Google mypy for an introduction. Pycharm has good support for it if you want IDE integration. The stdlib is globally well annoted now. However, most 3rd party libs are not.

mixing untyped libraries with typed basically makes the whole monolith behave as if it was untyped. Once they get the major libraries typed, python projects will become much more robust.

Re: Why we switched from Python to Go

#363
post #361

Earlier quoted context omitted.

There are some: https://www.techempower.com/benchmarks/ As you can see, erlang is far from the top there.

I don't see Erlang listed at-all on that "Fortunes" page ?

They have elixir there, which is another language for Erlang VM, and they have erlang for other benchmarks.

Re: Why we switched from Python to Go

#364
post #358

Earlier quoted context omitted.

I'm talking about API calls where you make a few database queries, not local or batched. Java/Go with pretty much any database can manage about 50,000 individual queries+REST calls a second.

Ah I see. I still think if you're measuring that way, there's no reason languages like Python et al. can't accomplish similar too. And if they can't, well, there's always adding more machines. Horizontal scaling tends to occur no matter what you're using, so is the argument just that with less productive (probably a matter of taste for many at this point) languages you'll have to scale out later? That's a tradeoff to…

True, horizontal scaling will always save you no matter how slow the front end is. Cost becomes significant at a certain level too though. For example, Google estimates each search query goes to over a thousand machines. If you need 100x 1000 machines to serve a query because the back end is PHP it adds up.

And you can make Python or even PHP fast if you try hard enough.

My argument is that the engineer overhead for Go and new breeds of Java frameworks are small enough that it makes no sense to use anything else if you're planning on scaling for real.

If you start with something else the cost of making a slow language fast and the multiples of extra machines you need costs far more than just using the faster language to start with

For the benchmark you posted, take a good look at the "realistic" vs "stripped" implementations and whether the test used an ORM. You'll quickly see that the realistic test applications with any kind of ORM are exclusively C#, Java, Go, and C++

Re: Why we switched from Python to Go

#365
post #323

Earlier quoted context omitted.

And most of those other companies like Facebook are writing endless hacks, VM's, or entire languages to fix the slow runtime :)

Sorry, I have no interest in getting into a religious flamewar. I will only say that I find it weird that you think that there aren't endless hacks and VMs in [insert here the languages you like].

Eh, vanilla Java or Go is at least an order of magnitude faster than those other languages without messing with anything. You can mess around with the JVM and interfacing to native code but it's rarely needed because it's already within a low multiple of C performance writing things normally.

Arguments about what language is better are pretty flamey but it's hard to argue that performance is not an advantage of Go/Java

Re: Why we switched from Python to Go

#366
post #83

Earlier quoted context omitted.

I wonder the opposite. Hardly any system needs to process 500k response per second. But nearly all of them benefit from the developer productivity that Python/Rails offer. My current company has 15 Java & React engineers where 2 or 3 Rails would suffice. Load tops out at maybe a dozen requests/second. Feature development is super-slow. System complexity is off the charts.

> Feature development is super-slow. System complexity is off the charts. That probably has little to do with language/stack and everything to do with constantly changing requirements/system growth. To your required engineers comment, Spring Boot + jOOQ is easily one of the most productive backend stacks I've ever used. A single engineer could easily build a large API leveraging the stack.

Take a look a vert.x and Dropwizard. Spring Boot can handle maybe 10k requests per second, but Dropwizard is around 200k and vert.x maybe a million.

If you're only using them for a REST API they offer similar features. Spring Boot supports loads of other stuff you probably don't need for something API driven

Re: Why we switched from Python to Go

#367
post #82

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…

> All the big companies are using Java and Go almost exclusively for high volume endpoints Please cite “all the big companies.” Also exclusively? No seriously, that is a bold claim. Google isn’t one of them because most of those hotepots are still written in C++. I don’t know how you can claim this. Based on some occaion company blog posts, changing just one or two endpoints out of say 100? What about Rust? I also kn…

Google has a huge amount of code written in Java, I would say the majority of their systems. Just look at their open sourced projects and job listings. Over 50% Java easily.

Re: Why we switched from Python to Go

#368
post #137
post #82

Earlier quoted context omitted.

> All the big companies are using Java and Go almost exclusively for high volume endpoints Please cite “all the big companies.” Also exclusively? No seriously, that is a bold claim. Google isn’t one of them because most of those hotepots are still written in C++. I don’t know how you can claim this. Based on some occaion company blog posts, changing just one or two endpoints out of say 100? What about Rust? I also kn…

Pick the Fortune 500 list, take out the SV darlings, the majority of their backend stacks will be a mix of Java and .NET deployments. Easy to find out just by looking at their open job positions.

This is true even with most SV darlings. Netflix, Google, Uber, and Amazon use tons of Java. Probably the majority of their systems.

Microsoft is an exception because they built C# which is basically a more modern but less popular variant of Java. There was even a project for a long time that let you use Java code in C# projects by converting the bytecode, they're that similar.

The notable exception is Facebook. They were stuck in PHP hell for so long that they redesigned the language to make it work.

Re: Why we switched from Python to Go

#369
post #49

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…

High quality Java and Go developers are more expensive than Ruby and JS webdevs, partly because there are just so many of the latter.

Java and Go are much harder to learn. Much more complex from a language perspective, more complicated build process, bigger standard libraries.

This leads to a lot of "first languages" being the latter and a perpetual glut of recent grads that know nothing else so will do those jobs for less

Re: Why we switched from Python to Go

#370
post #224

Earlier quoted context omitted.

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 req…

I want an orm, a template engine, form validation, sessions and some authentication mechanism. I'm currently doing a system for a robotics competition - team registration, match results entry and point calculations, rankings and so on. Doing it in Python and Pyramid is quite easy, though sometimes I have to fight with the framework to do things the way I want to. One especially useful feature in Pyramid (and some oth…

Spring MVC is probably what you want then.

Really though, you should invest some time in learning typescript and react. These days most apps are just API calls on the back end and you deal with templating, forms, and other bs in the frontend.

Because most apps are built this way now, you won't find any "modern" Java frameworks that support what you want, and you're pretty much gonna be stuck with the older clunkier stuff.

The learning curve for new SPA frontend stuff is high but I've found it much more productive now that I'm into it. With HTML generated on the server it's too damn hard to get pages to do what you want

Post reply on HN