[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ESPResSo-devel] Thoughts from the last coding day
From: |
Ulf Schiller |
Subject: |
Re: [ESPResSo-devel] Thoughts from the last coding day |
Date: |
Tue, 30 Jun 2015 22:12:54 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
On 06/30/2015 03:11 PM, Gary Davies wrote:
> Issue 2) The potential over-use of Cython.
>
> In my opinion, one of the big attractions of using Python as the
> espresso interface is the increased readability and simplicity of python
> code. Cython significantly reduces this readability and simplicity, IMO.
> However, it seems that everything is written in Cython by default
> without regard for whether it actually speeds up the code significantly.
> Ideally we should be writing everything in native python and only
> cythonising the performance bottlenecks.
>
> Is there a reason that everything is by default cython and not native
> python? Perhaps I have misunderstood something fundamental to the python
> interface here.
As someone who thinks that the difference between compiled and
interpreted programming languages is best expressed in terms of the
formal mapping of a program (i.e. syntax) onto the mapping from input to
output (i.e. semantics), I am tempted to consider a compiler for a
language that was designed to be an interpreted language as art for
art's sake.
On a more practical note, I'll just throw in a quote from
docs.cython.org (emphasis added): "It must be noted, however, that type
declarations can make the source code more verbose and thus less
readable. It is therefore *discouraged to use them without good reason*,
such as *where benchmarks prove that they really make the code
substantially faster* in a performance critical section."
Just my 2p,
Ulf
--
Ulf D. Schiller
Centre for Computational Science
University College London
20 Gordon Street
London WC1H 0AJ
United Kingdom
Phone: +44 (0)20 7679 5300