4 ms·
>but the current CPU model isn’t necessarily serial either, anymore. It is still largely serial. If you are concerned about the dependencies of the actual inst
by charcircuit 5y ago
>but the current CPU model isn’t necessarily serial either, anymore.
It is still largely serial. If you are concerned about the dependencies of the actual instructions themselves (since the CPU can use this information to execute multiple instructions at the same time) in order to optimize something you will be very concerned about being able to predict / look at / influence the code generation.
>a parallel algorithm may well be in the “worth it to implement” category for Haskell
>“no way that we can make it work” category for some lower level language.
I disagree. It is mainly a matter of having libraries available that makes it easy. If a library was made for Haskell that makes parallel algorithms easy to implement a similar library could be made for C++ or whatever to do the same thing.
- kaba0 5y agoAnd who owns what, when will it be deallocated, etc? Even in rust it is not as comfortable as in a higher level language - it is not accidental that where maximal performance isn’t needed GC-d languages are used predominantly in the industry.
- penteract 5y ago>>a parallel algorithm may well be in the “worth it to implement” category for Haskell >>“no way that we can make it work” category for some lower level language. > I disagree. It is mainly a matter of having libraries available that makes it easy. If a library was made for Haskell that makes parallel algorithms easy to implement a similar library could be made for C++ or whatever to do the same thing. This does not match my experience. Haskell encourages you to write code in a way that makes parallelism much easier and less likely to bite you (pure functions and immutability everywhere). I've added parallelism to Haskell code that was written without really thinking about parallelism by changing 2 important lines (and trivial changes to a few places in the same file). I can't imagine it being that straightforward if the code had been in C++.