Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For most applications, moving to modern C++ is going to be a better option than rewriting in Rust.

I wouldn't bet on that.

Companies which go with a language like C++ don't do it for "safety" or "performance" or reasons like that (at least, most of the time they don't). They go with it because they can get something written once, then run it for the next half-century and only have to spend engineering time on new features and the occasional critical bug. Telling them they need an intrusive rewrite of their entire codebase to use modern practices will simply result in either (A) no action taken (most likely) or (B) the rewrite happening in a language that isn't C++.

This is incidentally what happened with quite a few significant Python codebases in the 2/3 transition -- rather than rewrite their code to Python 3 standards, they said "eh, we're rewriting anyway, let's go to Lua" (most often, though some other languages were the "let's go to" option as well).




I don't know that people don't choose C++ for performance reasons or for easy manipulation of low level stuff. Games, high performance computing, embedded and legacy software are the main applications of C++, aren't they?

Some people on this website seem to blow the python 2/3 transition fairly out of proporotions.. Python 3 is really extremely similar to Python 2, and there are great tools to convert Python 2 code to Python 3 and vice versa.


Is there a great tool to convert Python 3 to Python 2?

I've tried Pasteurize (part of python-future) but it just leaves the "yield from" statements in place, giving syntax errors. And 3to2 does even less, and seems to mostly be a framework for building tools like Pasteurize.

I know this isn't easy, but JavaScript people do it with ES6 transpilers, and ES6 is more different from ES5 than Python 3 is from Python 2.


The two libraries I've created both use a combination of 3to2 and pasteurize to convert the python 3 code to python 2. The only issues I've run into are new error types that I could not use. But there seem to be quite some issues open: https://bitbucket.org/amentajo/lib3to2/issues?status=new&sta...

In case you want to see the scripts I use to change the python3 code to python 2 and make it work with pip:

https://github.com/JelteF/PyLaTeX/blob/master/convert_to_py2...

https://github.com/JelteF/PyLaTeX/blob/master/setup.py


Who rewrote in Lua instead of Python?


Judging from comments I've seen here in discussions about Python 3, mostly companies who bet on a "write once, run forever" strategy and thought Python would never change.


Should have used C++ if they wanted that :D


To be fair it's better than "rewrite everything in Rust"




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: