4 ms·
Or maybe keep things the way they are.If you really need performance python is not the language you should be looking for. Instead of breaking decades of code,
by IceWreck 4y ago
Or maybe keep things the way they are.If you really need performance python is not the language you should be looking for.
Instead of breaking decades of code, maybe use a language like Go or Rust for performance instead.
- xwdv 4y agoI would have thought convincing people they’ll just have to use Go or Rust or Elixir would have been an easy sell around here. Turns out they just want a better Python.
- fnord123 4y ago>Turns out they just want a better Python. That's Go. It gives actual types[1] and structs (so you dont have to wonder about dict, class, class with slots, dataclasses, pydantic, attrs, cattrs, marshmallow, etc). It removes exceptions and monkeypatching. It's async-first (a bit like gevent). It's inherently multicore. And you can package and distribute it without marking a pentagram on the ground and sacrificing an intern to Apep. You just need to stop being friends with C FFI. Which is fine for web and sysadmin tools. For data science and ML/AI/DL, it's less ok. [1] And the types are actually checked! I think a lot of people aren't really using python type checking given how slow it is and no one seems to complain. Or maybe everyone is using pyright and pyre and are satisfied with how slow these are.
- kaba0 4y agoGoing to the very unexpressive Go from the expressivity of python is a goddamn huge jump though. Going to JS or even TS for performance would be saner, and it has a same-ish object model even.
- fnord123 4y agoThe expressivity in Python is a problem that needs to be solved though. Moving to JS goes the wrong way.
- pjmlp 4y agoIt already exists, but they don't want to learn other languages.
- Mehdi2277 4y agoPython is also the dominant language for machine learning which does care for performance. The person who made recent nogil work is one of the core maintainers of key ML library. The standard workaround is ML libraries, the performance sensitive stuff is written in C/C++ (either manually or with cython) and then uses python bindings. But it would be much friendlier if we could just use python directly. It's also commonly used language for numerical work in general. Most of the time numpy is enough and then occasionally you'll need something not already implemented and then have to do your own bindings.
- cycomanic 4y ago> Python is also the dominant language for machine learning which does care for performance. The person who made recent nogil work is one of the core maintainers of key ML library. The standard workaround is ML libraries, the performance sensitive stuff is written in C/C++ (either manually or with cython) and then uses python bindings. But it would be much friendlier if we could just use python directly. Multithreading is not really the reason why things get written in cython etc., you can easily see 100x improvements in single threaded performance (compared to maybe a factor of 2-8x for multithreading). If you care about performance you'd definitely write the performance critical stuff in cython/pythran/c.
- pjmlp 4y agoNope, C++ and Fortran are. The bindings available in Python can also be used from other languages.
- shepardrtc 4y ago> Instead of breaking decades of code Pin your version.
- Dangisshit 4y agoSo you are essentially saying Python is obsolete. It's used for decade old code and for new code you should use go or rust.
- bayindirh 4y agoConcurrency is not solely required for performance. I'm designing a small tool (a file ingester/processor) for myself, which gonna need several, really concurrent threads. I love Python, but I can't use that, so I'm learning Go.
- kaba0 4y agoWhy put Go and Rust in the same category? I never really understood that. Either include like almost every language from JS, Java, C# to Haskell, or just list C++ and Rust. But Go is in the former category.
- chaps 4y agoPython has basically already done exactly that with 2.7 to 3 and we came out of that relatively fine. I say bring it.