Live data from Hacker News

Instagram Makes a Smooth Move to Python 3

thenewstack.io

21–30 of 62 posts

Re: Instagram Makes a Smooth Move to Python 3

#21

Right, you hear a lot of griping about moving from Python 2 to 3 but I personally didn't have as much trouble as expected. Some of my projects just worked. One small tip I don't think they mentioned. Start using the logging module instead of print and it will eliminate one class of potential issues.

This is what I encourage all of our team to do, it just seems like a no brainer. Having stray "testing" strings pop up in our logs without any source is hella annoying.

Re: Instagram Makes a Smooth Move to Python 3

#22
post #17
post #14

Earlier quoted context omitted.

And at that scale you can make additional microservices for the critical path where it matters.

Not really. You'll notice a pattern in most tech bigcos where they move from dynamic lang X to a statically typed language that can multithread properly. A few examples: Ruby on rails to java (twitter). Java & c++ (google). Java (linked in). Python/Node -> Java/Go (uber). Or they start doing silly things like make a new VM (facebook).

I heard through the grapevine that Go was only chosen at Uber to help with hiring.

Re: Instagram Makes a Smooth Move to Python 3

#23
post #17
post #14

Earlier quoted context omitted.

And at that scale you can make additional microservices for the critical path where it matters.

Not really. You'll notice a pattern in most tech bigcos where they move from dynamic lang X to a statically typed language that can multithread properly. A few examples: Ruby on rails to java (twitter). Java & c++ (google). Java (linked in). Python/Node -> Java/Go (uber). Or they start doing silly things like make a new VM (facebook).

There is RoR for Jruby which has native threads, plus you can call Java methods from Ruby.

Re: Instagram Makes a Smooth Move to Python 3

#24

“Yeah, Python is great in so many ways, too bad it’s not really scalable.” I'm not even sure what this means anymore. I guess I'm just not sure how any language, when used correctly, could be inherently unscalable. My guess is statements like this came from a time when monoliths were the application design of choice? Now, assuming Instagram has just 1,000 photo handling servers, each one is only responsible for 95,00…

It's old but still useful: https://www.techempower.com/benchmarks/

Almost every language can handle typical performance requirements. But when people say slow or unscalable it's almost always in relation to other languages.

Re: Instagram Makes a Smooth Move to Python 3

#25
post #17
post #14

Earlier quoted context omitted.

And at that scale you can make additional microservices for the critical path where it matters.

Not really. You'll notice a pattern in most tech bigcos where they move from dynamic lang X to a statically typed language that can multithread properly. A few examples: Ruby on rails to java (twitter). Java & c++ (google). Java (linked in). Python/Node -> Java/Go (uber). Or they start doing silly things like make a new VM (facebook).

Plus Facebook has a lot of C++ and some Java services as well, in addition to the Hack/HHVM stuff.

Re: Instagram Makes a Smooth Move to Python 3

#26
post #16
post #7

types in python 3.5?! I had no idea -- that's exciting.

Note they are type annotations . They are for tooling/development only; the runtime doesn't care about the types at all.

That's not entirely true. The information from the type annotations is available at runtime. ApiStar takes advantage of this, for example.

Re: Instagram Makes a Smooth Move to Python 3

#27
post #16
post #7

types in python 3.5?! I had no idea -- that's exciting.

Note they are type annotations . They are for tooling/development only; the runtime doesn't care about the types at all.

Hmm, Perl6 has real types, although they're completely optional.

Re: Instagram Makes a Smooth Move to Python 3

#28
post #11

“Yeah, Python is great in so many ways, too bad it’s not really scalable.” I'm not even sure what this means anymore. I guess I'm just not sure how any language, when used correctly, could be inherently unscalable. My guess is statements like this came from a time when monoliths were the application design of choice? Now, assuming Instagram has just 1,000 photo handling servers, each one is only responsible for 95,00…

The threading story isn't great. It's not statically typed, which can make working on a large codebase with more people more painful. It also forces you to write more unit testing code coverage to make up for the lack of a static compiler checking things for you. Raw performance is not good compared to golang or java. When you start getting to a certain scale, developers are cheaper than your server costs in some cas…

All of these are decades-old talking points which have been largely shown to be factually incorrect. Why are you repeating them without justification?

Re: Instagram Makes a Smooth Move to Python 3

#29
post #26
post #16

Earlier quoted context omitted.

Note they are type annotations . They are for tooling/development only; the runtime doesn't care about the types at all.

That's not entirely true. The information from the type annotations is available at runtime. ApiStar takes advantage of this, for example.

The information from annotations is exposed to the runtime, but nothing in the runtime treats them as types or performs any type checking. The feature was introduced as a generic way to annotate functions, without being constrained to a single use case (type checking), and all the tools which actually do type-checking based on annotations are third-party.
Post reply on HN