[Pharo-users] Numerical Methods in Pharo without FFI ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Pharo-users] Numerical Methods in Pharo without FFI ?

Nicolas Cellier

Can you add enhancement issues in the SciSmalltalk issue tracker :
https://github.com/SergeStinckwich/SciSmalltalk/issues
in order to keep them in mind ?

We are trying to create a pure Smalltalk library, so we try to avoid
FFI as much as possible :-)

snip...
--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/


I agree with using Smalltalk when we can, and avoid FFI, except maybe one thing...

In Smalltalk, we could completely eliminate the Float primitives and emulate them with Integer arithmetic.
But we don't.

IMO we should adopt same pragmatic approach with basic operations on vectors/matrices, and maybe also for more involved algebra.

The guys of LAPACK decided to use a "primitive" layer BLAS because the FORTRAN compiler was too naive to compete with specially crafted optimizations like that of MKL.
It does not make sense to compete in this area, our language is not taylored for number crunching whatever the JIT efforts we can make,

So let's use some kind of numeric primitives.
That's how Matlab, NumPy, R or evry other interpreter would do it, don't they?

It may be interesting to have some fallback code written in Smalltalk, but it ain't gonna scale.

So don't forget that Smallapack could leverage number crunching, that's what it's made for...
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-users] Numerical Methods in Pharo without FFI ?

stepharo

> I agree with using Smalltalk when we can, and avoid FFI, except maybe
> one thing...
>
> In Smalltalk, we could completely eliminate the Float primitives and
> emulate them with Integer arithmetic.
> But we don't.
>
> IMO we should adopt same pragmatic approach with basic operations on
> vectors/matrices, and maybe also for more involved algebra.
I think so too.
A bit in the direction of WordArray or FloatArray?
>
> The guys of LAPACK decided to use a "primitive" layer BLAS because the
> FORTRAN compiler was too naive to compete with specially crafted
> optimizations like that of MKL.
What is MKL?
Marcus is telling to me since years that we should use a good math
libraries like the one developed by some inria groups.
> It does not make sense to compete in this area, our language is not
> taylored for number crunching whatever the JIT efforts we can make,
Agreed.
Now what would be interesting to know is: what kind of operations do we
need to attack vectorised CPU
I do not remember their name but I was talking with Philippe Mougin the
father of F-Script and he wanted
to map his F-Script messages to vector on CPU to get all the power for
crunching numbers.
>
> So let's use some kind of numeric primitives.
Which ones?
Do you have some cycles to produce a prototype so that we can learn?
> That's how Matlab, NumPy, R or evry other interpreter would do it,
> don't they?
I would love to have
     - knowledge
     - and time

Sadly I just have the energy for simple things.
> It may be interesting to have some fallback code written in Smalltalk,
> but it ain't gonna scale.
Indeed.
> So don't forget that Smallapack could leverage number crunching,
> that's what it's made for...
Should we put under the umbrella once we clean SciPharo?
Because it should be reorganized first.

stef