News for hackers. Stuff that matters.
Re:Why I'm still using Python by pphysch on Friday December 30, 2022 @02:09PM (#34188687)
Unless you have a clear specification for what you are going to build (as in, you have most of your data schemas and processes sketched out), stick with Python and benefit from the development velocity as you figure things out.

Then rewrite it later when you need to scale.

Re:Why I'm still using Python by nnadams on Friday December 30, 2022 @02:27PM (#34188913)
I have embraced this workflow completely. I used to be more concerned about which language, but now I find I much more useful to just start immediately in Python. I spend most of the time working out the kinks and edge cases, instead of memory management or other logistics. Maybe ~75% of the time, that's it, no need for further improvement.

Recently I chose to rewrite several thousands of lines of Python in Go, because we needed more speed and improved concurrency. Already having a working program and tests in Python was great. After figuring out a few Go-isms, it was a quick couple of days to port it all for big improvements.

Re:Why I'm still using Python by hsbauauvhabzb on Friday December 30, 2022 @11:41PM (#34193648)
When you say tests are you referring to end to end tests, did you rewrite unit tests or did you do some cross language magic?
Re:Why I'm still using Python by nnadams on Saturday December 31, 2022 @04:55PM (#34201170)
End to end tests mostly. Those were kept static throughout the process as a baseline and for benchmarking. That let us have simple metrics like "test 1 had a 100x speed up" and "test 3 took a way too long to finish before the rewrite."

Any unit tests got rewritten along with the test's relevant code. Now that we are sticking with this Go based solution, adding more unit and regression feels more reasonable now.

Re:Why I'm still using Python by alar44 on Friday December 30, 2022 @04:27PM (#34190313)
This is what I do. Hack it together in Python to get something running, then rewrite everything in C++.
Re:Why I'm still using Python by JonChesterfield on Friday December 30, 2022 @05:51PM (#34191074)
This works especially well if you test the python version as you go, then run the same python tests against the C++ replacement. The up front bother of pybind or similar is minor relative to not having to recompile the C++ to iterate on test scripts.
Re:Why I'm still using Python by trenchgun on Friday December 30, 2022 @07:59PM (#34192081)
Or even better, rewrite the python code in Rust! Like Asahi Lina did. https://asahilinux.org/2022/11/tales-of-the-m1-gpu/
Re:Why I'm still using Python by therealdrag0 on Saturday December 31, 2022 @03:17AM (#34194638)
Gp was saying their biggest complaint is better in JS and Ruby, so aren’t those just as good for velocity and not for scale?
Re:Why I'm still using Python by nine_k on Saturday December 31, 2022 @05:11AM (#34195134)
The same thing can be said about Lisp, Ruby, or JS/TS. Start a REPL, shape things as you would clay.

What Python gives you, and what's not easy to get elsewhere, is access to really high performance numerical code, wrapped into quite ergonomic interfaces: Numpy, Scipy, Pytorch, etc. Many other things choose to make Python the glue language, like above, or to embed it (from Gimp to Blender).

This makes Python stand out, despite its shortcomings (which are well-known), and make it an even more reasonable interface language for whatever next big thing. Network effect in action.

Re:Why I'm still using Python by mmcnl on Saturday December 31, 2022 @11:55AM (#34198247)
Notice the rewrite most often will never come when you do this because it will probably not be needed. And if it comes to it that you do need a rewrite, celebrate the success of your project!