Live data from Hacker News

Backend of Meta Threads is built with Python 3.10

twitter.com

361–370 of 458 posts

Re: Backend of Meta Threads is built with Python 3.10

#361
post #148
post #54

Earlier quoted context omitted.

You can link to it, what are you talking about? An example fetched from a verge article -> https://www.threads.net/t/CuVaOg1PgU4/

That link doesn't work for me - just get a splash page

Same. Worked when I tried Chrome, but apparently they did not test Firefox.

Re: Backend of Meta Threads is built with Python 3.10

#362

For the “Python isn’t fast enough for production backend” crowd from the same company that brought you the largest social network built on PHP + MySQL.

Earlyish facebook engineer here. Early days FB php was nothing like the php used to template websites. All kinds of specialized libraries to enable a much more sophisticated programming style. Think functional helpers, and asynchronous execution on thousands of cores, spanning trees across data centers using ssh etc. As a tangent a lot of the good stuff I used was written by Evan Priestley, who also did Phabricator a…

>Early days FB php was nothing like the php used to template websites. All kinds of specialized libraries to enable a much more sophisticated programming style.

No idea if this was a credible leak of actual 2007-ish FB php, but it doesn't look like what you're describing.

https://gist.github.com/nikcub/3833406

Re: Backend of Meta Threads is built with Python 3.10

#363
post #266

Earlier quoted context omitted.

> Facebook had hundreds of millions daily active users before writing a compiler. In other words, Facebook felt compelled to write a compiler when they had hundreds of millions daily active users.

If you have hundreds of millions of daily active users then needing to write a compiler isn't the end of the world.

> If you have hundreds of millions of daily active users then needing to write a compiler isn't the end of the world.

It's not the end of the world because they have deep pockets and a problem domain where preserving the interface (I.e., keep everything still running on PHP) and optimizing the infrastructure that provides it is more cost effective and least disruptive than switching to a tech stack that is more performant.

Re: Backend of Meta Threads is built with Python 3.10

#364

Earlier quoted context omitted.

Compiling PHP into machine code sounds pretty much impossible, are they using some subset of the language? Does the compiled code use a garbage collector? Or reference counting?

[flagged]

> This may be shocking to you, but _all_ code is effectively compiled to "machine code" eventually.

I'm not sure you understood the point. It means nothing to claim that deep down it's all opcodes or electrons flowing. What matters is being able to transform the code targeting the high level interface to the lowest level interface in a way that remains usable and regression-free. Sometimes compilers for widely popular languages introduce bugs and weird behavior too.

Re: Backend of Meta Threads is built with Python 3.10

#365
post #179

Earlier quoted context omitted.

Remember when Twitter was written in Ruby?

Remember how Shopify is still processing hundreds of millions of transactions in Ruby on Rails without an issue currently?

Except that Shopify is actually paying a couple of enginners to write a Ruby JIT compiler.

Not only that, the community felt the pressure to write several JIT compilers already.

So....

Re: Backend of Meta Threads is built with Python 3.10

#366

Earlier quoted context omitted.

You simply can't beat Django's ORM for general stuff. It's too awesome. This alone makes it so hard to choose anything else. I know django doesn't have that "shiny factor" to it these days - but it's very reliable. > mixed messaging on best practices for scalable apps The WSGI stuff can be kinda confusing and is used across a lot of python frameworks including django and I think flask? My advice for "simple scaling"…

> Use celery immediately if you have any "long lived" tasks such as email Hey, quick question from a relative newbie who is currently trying to solve this exact problem. Besides Celery, what are good options for handling long-running requests with Django? I see 3 options: - Use Celery or django Q to offload processing to worker nodes (how do you deliver results from the worker node back to the FE client?) - Use a lib…

Django ORM has supported async syntax for some time now, and it can work fully async starting with Django 4.2 (and psycopg3). There are still a few rough edges (such as not being able to access deferred attributes from async contexts) but there are workarounds.

I usually use `asyncio.create_task` from async views for small, non-critical background tasks. Because they run in a thread you will lose them if the service crashes (or Kubernetes decides to restart the pod), but that's fine for some use cases. If you need persistency use Celery or something similar.

Django combined with an async-ready REST framework such as Django Ninja is very powerful these days.

Re: Backend of Meta Threads is built with Python 3.10

#367
post #177
post #122

Earlier quoted context omitted.

Is your problem that the c part of GDAL isn't concurrent and you are calling it multiple times, or are you blocking on something you shouldn't? Python calling a concurrent c thing is super common. For more complex things there is multiprocessing, but that essentially is simplification of IPC.

Had a massive amount of images that I was trying to process for a specific purpose. I wound up spinning up multiple python processes within a java wrapper using concurrent linked queues. Got the job done but it's not the proudest moment of my life.

Multiprocessing does basically the same thing, but in python.

Re: Backend of Meta Threads is built with Python 3.10

#368
post #365

Earlier quoted context omitted.

Remember how Shopify is still processing hundreds of millions of transactions in Ruby on Rails without an issue currently?

Except that Shopify is actually paying a couple of enginners to write a Ruby JIT compiler. Not only that, the community felt the pressure to write several JIT compilers already. So....

So what? A company is trying to streamline their process and save costs?

Is there any large company at all that hasn't invested in making their tool chain better?

You talk about it like they are a failure. Lol

Re: Backend of Meta Threads is built with Python 3.10

#369
post #331
post #328

Earlier quoted context omitted.

There is no web interface, but they will almost certainly add one. MVP baby!

Got it, thanks. But that's really odd because most mobile MVPs are either just PWAs or some React Native shit compiled to binaries. Why the hell wouldn't they just release it on the web?

Focusing on native mobile apps over web for launch is a completely sound strategy. 80% of Twitter use is from mobile, and probably near 100% for Instagram since they barely have a web version. But I’d expect them to do a web version relatively quickly to appeal to Twitter refugees.

Re: Backend of Meta Threads is built with Python 3.10

#370

Earlier quoted context omitted.

The difference between C++ and Python is not nanoseconds. And I have definitely seen projects fail due - in part - to language choice. Of course projects can succeed in almost any language but that doesn't mean the language choice is irrelevant.

Example? I'm curious

Python is generally around 50 times slower than C++. Obviously it varies massively with the benchmark but that's a good ballpark.

Just Google "python vs c++ speed" and you will find hundreds of examples (or "python vs rust speed" - Rust is essentially the same speed as C++).

Here's the first result - they got a 25x speedup:

https://towardsdatascience.com/how-fast-is-c-compared-to-pyt...

Post reply on HN