Im currently doing a machinelerning course where we implement every algorithm using vectorization. The concept of vectorization seems to be most applicable to imperative programming to make the code more compact and to use the highly optimized numerical libraries for the language. However when looking in ml books for functional programming the algorithms are implemented declarative not using vectorization. You win the readability for programmers that are not experts in linear algebra but can this implementation in haskell get close to a vectorization implementation in an imperative language?
My question is how does the concept of vectorization apply in functional languages?
Deriving from work in http://research.microsoft.com/en-us/um/people/simonpj/papers/ndp/haskell-beats-C.pdf there is a SIMD branch of GHC at https://ghc.haskell.org/trac/ghc/wiki/SIMD and ongoing work at bringing those instructions in as primitive suitable for use by libraries such as vector
.
The research described in (https://dorchard.wordpress.com/2013/10/14/automatic-simd-vectorization-for-haskell-and-icfp-2013/) describes another approach that uses vectorization directly in code generation. That sort of approach has not yet landed in any usable form.
This is a kind of theoretical question, but in general, vectorization is used for speeding up the procedures in terms of optimization. The algorithms may be implemented declarative but in the actual implementations they usually are vectorized as well as the functions they use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With