News for hackers. Stuff that matters.
Re:Suppose I wanted to write a C++ based web application... by ii on Sunday October 05, 2008 @08:16AM (#324056)
Try to rewrite something simple written in Python in C++ first and measure the differences in speed/dev time first.

Chances are you may end up with a story like this: http://groups.google.com/group/comp.lang.python/browse_threa...

Albeit micro-benchmarks may indicate that Python is 100-200 times slower than C++, they may not be applicable to the real world. Python can be very efficient. And when combined with libraries like NumPy, beating it's performance with hand-crafted C++ is difficult.

Emperor has no clothes.

Re:Suppose I wanted to write a C++ based web application... by hugh on Sunday October 05, 2008 @11:47AM (#324133)
Interestingly, I tried rewriting one of my C++ codes in Python one day, using numpy. It was mostly manipulation of largish (~1000 x 1000) matrices.

On the upside, it was 100 lines instead of several thousand.

On the downside, it was several hundred times slower.

I didn't bother trying to write serious simulation codes in Python after that.

Re:Suppose I wanted to write a C++ based web application... by ii on Sunday October 05, 2008 @04:14PM (#324300)
Of course C++ will beat Python in speed if you invest enough time in it. And assembly will beat C/C++ if you invest even more time.

My point is that some people assume that if they would just sit and write something in C++ without putting enough time and effort and skill in it, it would be somehow magically faster and better than high-level language, just because it's C++. They are mistaken.

Python standard library is extremely fast. For example 'list.sort()' in Pytohn could run 3 times faster than C++ 'sort(vector<string>)'.

Here are few examples when simple Python code runs faster than the same code in C++: http://groups.google.com/group/comp.lang.python/browse_threa...

Re:Suppose I wanted to write a C++ based web application... by salaam on Monday October 06, 2008 @05:35PM (#325333)
"For example 'list.sort()' in Pytohn could run 3 times faster than C++ 'sort(vector<string>)'"

Again comparing apples to oranges.

Re:Suppose I wanted to write a C++ based web application... by riobard on Sunday October 05, 2008 @12:19PM (#324155)
every tried NumPy? guess that's what you need for the matrices stuff ...
Re:Suppose I wanted to write a C++ based web application... by quasimojo on Sunday October 05, 2008 @11:57AM (#324140)
indeed. and lets remember that all of the built-ins in perl, php, python etc are written in c and compiled and optimized and debugged.
Re:Suppose I wanted to write a C++ based web application... by alecco on Sunday October 05, 2008 @07:53PM (#324459)
Python's pypy is written in RPython (it is python but with less features.) And it is already getting close to the main interpreter in C.

I can't wait for them to finally get the on the fly compiler working. Good times coming in the language competition.