3 ms·
Its not just that shared mutable state is hard, I'm thinking of the whole reasoning apparatus you get at your disposal: http://www.haskellforall.com/2013/12/eq
by spion 11y ago
Its not just that shared mutable state is hard, I'm thinking of the whole reasoning apparatus you get at your disposal:
http://www.haskellforall.com/2013/12/equational-reasoning.html http://www.haskellforall.com/2013/12/equational-reasoning.ht...
That indeed seems very much like something that can be called the "right way". If all functions in a given subset of the code are pure I can even imagine a tool that combines hoogle with your function's type signature and existing types to suggest how to finish writing your function (its just a graph search with nodes being the types and functions as the links). edit: seems like I don't need to imagine it - https://github.com/lspitzner/exference https://github.com/lspitzner/exference
Rust's way seems to me like they encode all the tediousness of dealing with shared mutable state into the type system. This is good, I guess, if you need to keep doing what you've always been doing but in a much safer way.
- burntsushi 11y ago> That indeed seems very much like something that can be called the "right way". No. It's just another useful tool in the toolbox. It comes with costs. Sometimes you don't want to pay them. Stop trying to monopolize "the right way."
- spion 11y agoI am not trying to monopolize "the right way". We were originally talking about Go, a language with a garbage collector made for writing concurrent servers. This is an area where immutable data structures are a no-brainer "right way" to avoid data races in the majority of cases, and I was expressing my frustration at the inability to write them in Go. I really have no idea how the conversation became one about writing browser engines, embedded systems or systems with realtime constraints in Rust :)
- burntsushi 11y ago> This is an area where immutable data structures are a no-brainer "right way" to avoid data races in the majority of cases I continue to find your phrasing extremely off-putting, condescending and snobbish. I suggested a few ways of wording your concerns better, but it seems you're intent on remaining a snob. I disagree that anything about your suggestion is a "no-brainer."
- spion 11y ago> I continue to find your phrasing extremely off-putting, condescending and snobbish. I suggested a few ways of wording your concerns better, but it seems you're intent on remaining a snob. Thats a bit over the top, but I'll concede that my wording needs work. I enjoy discussing concrete problems and projects - hopefully fixing this will help get more of that. You did make some very good points as to why we avoid mutation, and I will try and evaluate Rust in more depth.