[IPOL discuss] Best Practices for Scientific Computing

Nicolas Limare nicolas.limare at cmla.ens-cachan.fr
Tue Oct 9 06:41:31 CEST 2012


Hi,

>   - Write code in the highest-level language possible.:
> Are we doing that?

Even it this is a simplification, I would say that C or Fortran are
low-level and Python or Matlab are high-level[1]. So, IPOL does not
currently allow high-level languages to be used for the programs
published.

I think this is because the use of these high-level languages would
conflict with other goals of IPOL: high-level programs are not
mutually compatible (you can't mix a Python script with a MATLAB
code), they have more usage requirements (low-level languages only
need a compiler), and they have efficiency problems for some
algorithms (I have not yet seen a MATLAB implementation of SIFT or
NL-Means without a low-level backend).

The original article mentions high-level languages in the chapter
about optimization:

    8. Optimize software only after it works correctly.
    [...]
    Research has confirmed that most programmers write roughly the
    same number of lines of code per unit time regardless of the
    language they use [53]. Since faster, lower level, languages
    require more lines of code to accomplish the same task, scientists
    should write code in the highest-level language possible (8.2),
    and shift to low-level languages like C and Fortran only when they
    are sure the performance boost is needed. Taking this approach
    allows more code to be written (and tested) in the same amount of
    time.
    Even when it is known before coding begins that a low-level
    language will ultimately be necessary, rapid prototyping in a
    high-level language helps programmers make and evaluate design
    decisions quickly.

It does not say "you should publish MATLAB code", but "you should
*start* your prototypes and tests with MATLAB, then move to C if
needed." And C/C++ is currently needed to publish in IPOL.

So, the question "Are we using the highest-level language possible?"
is not really a question for the IPOL editorial policies; it is a
question for every individual researcher: "Are you using a high-level
language for your prototypes and tests?"

Best,

[1] About the "is C++ a high-level language?" debate, my *opinion* is
that C++ is low-level and STL is high-level. But I have the impression
(to be corrected?) that writing a program in pure STL is full of
tricks related to the compiler or STL implementation, and this
conflicts with the abstraction of details I would expect from a
high-level programming language. The vector initialization problem[2]
mentioned by Pascal G. is a great example: this simple high-level
programming goal requires a low-level array, the Boost library, or the
latest C++ version not implemented yet in every major
compiler... Replies to these remarks don't need to be on the list :)

[2]http://stackoverflow.com/q/2236197

-- 
Nicolas LIMARE - CMLA - ENS Cachan         http://limare.perso.math.cnrs.fr/
IPOL - image processing on line                          http://www.ipol.im/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://tools.ipol.im/mailman/archive/discuss/attachments/20121009/66af0544/attachment.pgp>


More information about the discuss mailing list