Hacker News new | ask | show | jobs
by dsuch 591 days ago
Python is fast and it's a good choice as a career language for sure.

Now that the GIL will be removed and adding a JIT is an inevitable step as well, we're looking into replacing everything written in Java with Python in the perspective of the next 10-20 years, depending on how soon people retire in a specific geographic region around the world.

The generation of people who, between 1995-2010, rewrote everything from C++ and COBOL into Java is now in their late 40s and 50s, so it's safe to assume there will be plenty of work for Python people until the next generation begins to mature around 2035-2040.

Now, whether it makes sense today to rewrite in Python something like a proxy, which is not a very complex type of software in itself?

If, starting today, you'd like to build within a year a proxy for something like StackOverflow, it's better to leave it for lower-level languages, like Go and Rust. These are replacements for C and C++, rather than Java, so they would likely be a better choice.

That said, my real message is, don't stick to writing such simple software for too long anyway.

If it's for educational purposes, to learn how all the various protocols work, or how to design server-side software, or to learn how to build an online community, that's a different story.

But you have this high level language in Python that lets you easily accomplish things that the lower-level languages just aren't best suited for, so once you wrote your first proxy and it can handle a few hundred or thousand requests/s, pick a high-level goal and work towards that instead! :-)

2 comments

I mostly agree with you, I learned java at university but dropped it because python (mostly scripts) are very useful for DevOps / SysAdmin work. I definitely agree that writing proxies in Python is not the best idea, but it is the language I know best. And yes, it's not a high-level goal, but as I replied to someone earlier in this comments section. I don't want to make a career out of this, I just wrote a tool that was needed in my organisation and brought it here because I thought it might be useful to someone. Thank you for the extended comment.

P.S: Yes I am looking for some high-level project to participate in or just help with the knowledge I have.

> Python is fast

Compared to compiled languages and JIT languages CPython is not fast, and removing the GIL does not improve the single thread performance of the language, right now it causes a 1-2% performance regression of single thread. Something like request validation seems like it wouldn’t benefit from more threads much; or if you need N threads to validate a request in 1ms in Python, it’s likely you could validate the same request in 1 thread in 1ms with another language.

Your analysis is very much correct, and that's why it doesn't make much sense today to rewrite reverse proxies in Python if your goal is raw performance.

Whether it's going to be a worthy goal in the future, I'm not quite sure. I consider this class of software an already well-researched subject in a congested space, and I'd just move on to something more interesting, to a greener field.