I am considering turning a C # application into a Haskell as my first “real" Haskell project. However, I want to make sure that the project makes sense. The application collects data packets from ~ 15 consecutive streams that reach about 1 kHz, downloads these values to the corresponding circular buffers on my "context" object, each with ~ 25000 elements, and then sends these arrays to OpenGL at 60 Hz to display the waveform . (Thus, it must be saved as an array, or at least converted to an array every 16 ms). My context object also has about 70 fields that only support the current (last) value, and not the flow waveform.
There are several aspects of this project that display Haskell well, but I'm worried about performance. If for each new datapoint in any of the threads I have to clone the entire context object with 70 fields and 15 arrays of 25,000 elements, it is obvious that there will be performance problems.
Is it possible to get around this by putting everything in the IO monad? But then this seems to belittle the purpose of using Haskell, right? Also, all my C # code is event driven; is there an idiom for this in Haskell? It seems that adding a listener creates a “side effect”, and I'm not sure exactly how this will be done.
lobsterism
source share