News for hackers. Stuff that matters.
Re:Bloomberg Runs on 25M lines of Fortran (2006) by baldfat on Thursday September 10, 2015 @10:22AM (#10198180)
How is Python even being mentioned as a replacement for Fortran? That is like replacing C code with Python just because ...

Sorry I really love Python but I see it as a slow weighing beast that is always a good second best choice for everything it does. Great if you only know Python or only want to know Python but for production? Speed issues is the main reason why Python is not more widely used.

Re:Bloomberg Runs on 25M lines of Fortran (2006) by dragonwriter on Thursday September 10, 2015 @11:13AM (#10198529)
> How is Python even being mentioned as a replacement for Fortran?

Its probably being mentioned as such because a lot of the reason people use Fortran is because of key high-performance libraries for particular numeric application domains -- not because Fortran is necessarily the best language, aside from the existence of the those libraries, to express higher-level solutions in those domains. And because Python has convenient wrappers for those libraries, such that where that is the motivation for using Fortran, Python is a reasonable alternative.

> Speed issues is the main reason why Python is not more widely used.

Sure, and that's why you wouldn't (with the current implementations available) want to write the low-level numeric routines underlying NumPy in Python.

OTOH, once you have NumPy, a lot of time Python makes perfect sense as the language to use for higher-level solutions that rely on the functionality provided by those libraries.

Re:Bloomberg Runs on 25M lines of Fortran (2006) by baldfat on Thursday September 10, 2015 @11:39AM (#10198684)
You are looking at a ten fold slow down to use Numpy. This is a extremely time sensitive software. Mentioning wrappers even adds to the over head.

Here is NASA's benchmarks using Fortan vs MATLAB vs Numpy vs Java. pretty evident that Fortran blew everything away. https://modelingguru.nasa.gov/docs/DOC-1762

Re:Bloomberg Runs on 25M lines of Fortran (2006) by kragen on Thursday September 10, 2015 @12:11PM (#10198871)
The slowdown from using Numpy (or Octave or whatever) instead of Fortran can be anywhere from 100× to 1.0000000001×. It depends almost entirely on how much of your compute time is spent inside standard computations on large arrays. If your arrays are tiny, or you're doing irregular things to them and can't figure out how to vectorize them, figure 100×. But there are lots of Numpy programs that fire off a few dozen Numpy calls per second, so the bulk of the code executed is Fortran (or maybe C) in any case. The extra microsecond to interpret the Python bytecodes to fire off the call just isn't significant.

More typical is about 3× or 5×, due to iterating over the data many times (once per Numpy call) instead of once, thus bottlenecking on main-memory bandwidth.