3 ms·
There are middle grounds between c++ and interpreted Python that have the same productivity as python and better performance.
by jackmott 10y ago
There are middle grounds between c++ and interpreted Python that have the same productivity as python and better performance.
- nhumrich 10y agoCorrect. Like writting in python, but optimizing the "bottlenecks" in C/C++/Cython
- kajecounterhack 10y agoOr choosing a language that's inherently somewhere in the middle (go).
- jackmott 10y agoWhy not just compile/JIT the python, always? I feel like I'm taking crazy pills! :) Even when you write the hot bits in C++ you still have a python interpreter thrashing the CPU caches and using up ram. and now you have to context switch in your head more often, and the build process is more complex, and usually there is a cost when you do the FFI.
- poikniok 10y agoIf you are talking about PyPy (I presume you are?), then two issues are that it can in some cases be slower, and also C libraries such as Numpy / SciPy are not simple to use with PyPy (I think some of Numpy has been translated, but there are many useful C libraries for Python).
- sfilargi 10y agoAbsolutely, but in the end it all depends what problem you are trying to solve, and which stage you are on. If you are starting a new startup, with Python or Ruby or PHP you may be able to try 2-3x ideas in the same time. Which means 2-3x more chances of succeeding. If you are adding a new service to an existing businesses, it may worth the time investing in some middle-ground. If you are google or facebook, I guess rewriting everything makes sense from financial point of view.