Writing an OS in Haskell - agniv sarkar : r/haskell
In GHC, IO (Maybe a) would allocate and pattern match at every step, so forall r. r -> (a -> r) -> IO r is more efficient. Does MicroHS have the same issue? MicroHs allocates all the time. There is no way to avoid it. It's part of the paradigm when using combinators. It's one of the big drawbacks. Even the simplest execution allocates. Are you sure? I haven't checked, but I'm pretty sure your case just trades it for closure allocation. 🤷 I'm mostly speaking from common talking points of using CPS to avoid pattern matching at every bind: https://wiki.haskell.org/Performance/Monads Well, the wiki page has this: MaybeCPS should be faster than using Maybe in most cases and should be almost a drop in replacement for Maybe. Unfortunately, this may not necessarily be true. And the conversation from the link seems to confirm my suspicion. I wonder if it's specific to Maybe, and maybe the optimization only works for Either 300% penalty is a lot. Do effect systems have a similar performance hit
Reddit - Please wait for verification
related reading
- Reddit - Please wait for verificationreddit.com
- performance - Why is Haskell (GHC) so darn fast? - Stack Overflowstackoverflow.com
- Speed mattersscattered-thoughts.net
- Strangely, Matrix Multiplications on GPUs Run Faster When Given "Predictable" Data! [short]thonking.ai
- Compiler Optimizations Are Hard Because They Forget - Faultlorefaultlore.com
- combinators in Rubymooreniemi.github.io
- Reddit - Please wait for verificationreddit.com
- Why (most) High Level Languages are Slow // A Random Walk Through Geek-Spacesebastiansylvan.com
- A Concurrency Cost Hierarchytravisdowns.github.io
- Beating the fastest lexer generator in Rustalic.dev
- Leaving Haskell behind - Infinite Negative Utilityjournal.infinitenegativeutility.com
- Measuring Mutexes, Spinlocks and how Bad the Linux Scheduler Really is | Probably Danceprobablydance.com