Author here. Glad to see this on HN! Happy to answer any questions.
Distributed Systems in Haskell
11–19 of 19 posts
Re: Distributed Systems in Haskell
#12http://stackoverflow.com/questions/25280852/space-leak-in-pi...
It's often better to just include the writer part you need in a larder State type (lenses make this really seamless)/
Re: Distributed Systems in Haskell
#13Excellent write up. One point though: watch out for WriterT and RWST leaking memory: http://stackoverflow.com/questions/25280852/space-leak-in-pi... It's often better to just include the writer part you need in a larder State type (lenses make this really seamless)/
It seems to be a matter of laziness. If you're writing some small piece of state like an Int, this can be a real problem. If you're writing out a lazy data structure like a list (as happens in the article), I think the extra laziness should be fine or even desired. (I've never used Writer in practice, so take my comments with a grain of salt!)
[1]: http://comments.gmane.org/gmane.comp.lang.haskell.libraries/...
Re: Distributed Systems in Haskell
#14Author here. Glad to see this on HN! Happy to answer any questions.
Re: Distributed Systems in Haskell
#15Excellent write up. One point though: watch out for WriterT and RWST leaking memory: http://stackoverflow.com/questions/25280852/space-leak-in-pi... It's often better to just include the writer part you need in a larder State type (lenses make this really seamless)/
That's a good point, but it was also mentioned in the article, with a link to a useful mailing list thread[1] on the matter. It seems to be a matter of laziness. If you're writing some small piece of state like an Int, this can be a real problem. If you're writing out a lazy data structure like a list (as happens in the article), I think the extra laziness should be fine or even desired. (I've never used Writer in pr…
AFAIR the problem with WriterT was the use of mappend within is always lazy, regardless of the strictness of the w in WriterT w m a.
Re: Distributed Systems in Haskell
#16Excellent write up. One point though: watch out for WriterT and RWST leaking memory: http://stackoverflow.com/questions/25280852/space-leak-in-pi... It's often better to just include the writer part you need in a larder State type (lenses make this really seamless)/
Re: Distributed Systems in Haskell
#17Author here. Glad to see this on HN! Happy to answer any questions.
Shouldn't the type of the monadic serverStep be "Message -> m ()" to match the type of the explicit "serverStep :: Config -> State -> Message -> (State, [Message])" ? Aka, serverStep isn't a monadic object, it's a Kleisli arrow.
Re: Distributed Systems in Haskell
#18Distributed Programming was one of the things flagged "Immature" in State of the Haskell Ecosystem [1]. Just out of curiosity, was that a motivation behind the project, or do you have any other thoughts on that post-project? [1] https://github.com/Gabriel439/post-rfc/blob/master/sotu.md#d...
If the current state of Distributed Programming in Haskell is "Immature", then I can't wait to see "Mature" :)
Re: Distributed Systems in Haskell
#19Author here. Glad to see this on HN! Happy to answer any questions.
Great post. How much knowledge and experience of haskell did you have before starting this project?
Probably my most significant previous use was in my second-semester computer architecture class as a substitute for Verilog. Using Christiaan Baaij's Cλash project, one can transform a (large) subset of Haskell into VHDL/Verilog/SystemVerilog and slap it on an FPGA. There's a rundown of that project on my blog too.
My project partner had never really used Haskell before, so he was learning as we went. By the end of the semester he was writing code no problem. "Immersion learning" seemed to work quite well here.