Re: announcing fython

2016-10-01 Thread Raoul Fleckman
On 2016-10-01, Chris Angelico  wrote:
> On Sat, Oct 1, 2016 at 11:41 PM,   wrote:
>> Fython permits to write numerical code with the same syntax then Python.
>> Under the hood, the code is transpiled to Fortran and run at top speed.
>
> How does this compare to Python+Numpy? How much faster is Fython, and
> what are the restrictions on the Python code?
>
> ChrisA

Interested to hear the answers to those questions, and whether Fython is
pass by reference (Fortran) or value (python, unless passing a list, for
example); and then there's the 'little' matter of one-based (Fortran) or
zero-based (python) arrays?

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: announcing fython

2016-10-01 Thread Raoul Fleckman
On 2016-10-02, nicolasessisbre...@gmail.com :
> **How does this compare to Python+Numpy? 
> **How much faster is Fython, and what are the restrictions on the
> **Python code? 
>
> Python+Numpy allows easy processing of vector, but there is a limit to
> how much user-defined logic can be used with Numpy.  For example,
> operating on three different arrays to do something like
>
>   if x[i]  > 0 :
>   temp = get_value( y[i] )
>
>   if temp > 0:
>   z[i] = another_operation( z[i] )
>
> may require three different Numpy calls.
> With Fython, the if statements and the loop around them is directly
>  compiled to machine code.

> Fython speed is the same as Fortran speed.
>
> In some applications, I get a speed-up of 100 compared to Cython, and
>  a speed-up of 10 compared to C.
>
> I'm not a Cython nor a C expert, and I know that with some good
> compiler flags, one may make the performance of these two languages
> similar two Fortran.  The advantage of Fython is that everything is
> tune out-of-box because of its connection to Fortran.
>
> There is no restriction on the Python code.
> Once a Fython program is avalaible, Python can throw any scalar or
>  Numpy array at it.
>
> **whether Fython is pass by reference (Fortran) or value 
> **and then there's the 'little' matter of one-based (Fortran) or
> **zero-based (python) arrays? 
>
> Fython is passed by reference, so that any modification made to a
>  variable in Fython is propagated back to Python.
>
> Fython follows Fortran syntax and is one-based by default.

> This doesn't give any interop problem with Python, because what
>  matters is to know the pointer to the first element of an array, and
>  Fython knows it.
>
> For the programmer convenience, like Fortran, Fython allows the choice
>  between one-based and zero-based indexing at array declaration.

Thank you!  it sounds very interesting indeed, particularly for those of
us with a substantial Fortran code base which needs to be updated.
Please keep us posted on your progress!

-- 
https://mail.python.org/mailman/listinfo/python-list