4 ms·
Welp there is Mojo so looks like soon you will not really need to care that much. Prob will get better performance than C too.
by qaq 1y ago
Welp there is Mojo so looks like soon you will not really need to care that much. Prob will get better performance than C too.
- jerf 1y agoI've been hearing promises about "better than C" performance from Python for over 25 years. I remember them on comp.lang.python, back on that Usenet thing most people reading this have only heard about. At this point, you just shouldn't be making that promise. Decent chance that promise is already older than you are. Just let the performance be what it is, and if you need better performance today, be aware that there are a wide variety of languages of all shapes and sizes standing by to give you ~25-50x better single threaded performance and even more on multi-core performance today if you need it. If you need it, waiting for Python to provide it is not a sensible bet.
- hnfong 1y agoYou're probably right, Mojo seems to be more "python-like" than actually source-compatible with python. Bunch of features notably classes are missing.
- qaq 1y agoGive em a bit of time it's pretty young lang
- qaq 1y agoI am a bit older than Python :). I imagine creator of clang and LLVM has fairly good grasp on making things performant. Think of Mojo as Rust with better ergonomics and more advanced compiler that you can mix and match with regular python.
- sevensor 1y agoI maintain a program written in Python that is faster than the program written in C that it replaces. The C version can do a lot more operations, but it amounts to enumerating 2^N alternatives when you could enumerate N alternatives instead. Certainly my version would be even faster if I implemented it in C, but the gains of going from exponential to linear completely dominate the language difference.
- vhantz 1y agoYeah let's just compare apple to oranges
- igouy 1y agoOn sweetness? On sharp acidity? On weight?
- patmorgan23 1y agoSo you're saying two different programs implementing two different algorithms perform differently and that lets you draw a conclusion about how the underlying language/compliers/interpreters behave? Have you ever heard of a controlled variable?
- sevensor 1y agoI must have been unclear. C is faster. The Python program would be faster if I reimplemented it in C. However, Python makes it so much easier to transform the problem into a linear form that it’s a bigger win to use Python than to continue maintaining the C version. And that’s my point: raw execution speed is only helpful when you’re executing the right thing. Don’t discount how much easier it can be to implement the right thing in Python.
- lenkite 1y agoMojo feels less like a real programming language for humans and primarily a language for AI's. The docs for the language immediately dive into chatbots and AI prompts.
- qaq 1y agoI mean thats the use case they care about for obvious reasons but it's not the only use case