zlacker

[parent] [thread] 4 comments
1. XorNot+(OP)[view] [source] 2024-01-20 00:19:44
This is very much not free though. Predicting memory usage in Haskell programs is notoriously tricky (and all the memory copies aren't free either).
replies(3): >>c-cube+o1 >>bippih+W6 >>whatev+1Y1
2. c-cube+o1[view] [source] 2024-01-20 00:33:03
>>XorNot+(OP)
It's also the case with OCaml, Elixir, clojure, etc. Non lazy languages can also have a rich collection of immutable data structures and have more predictable memory usage than Haskell. On the other hand, Go doesn't have a culture or features that encourage immutability.
3. bippih+W6[view] [source] 2024-01-20 01:25:55
>>XorNot+(OP)
it's not free, but it is explicit. it's nice for the code to explicitly define how the memory is being modified. there are copies in java too, you just have to know how the runtime works to know what each line does.
replies(1): >>ric2b+t9
◧◩
4. ric2b+t9[view] [source] [discussion] 2024-01-20 01:51:12
>>bippih+W6
Copies in haskell are not explicit at all, though?
5. whatev+1Y1[view] [source] 2024-01-20 18:40:02
>>XorNot+(OP)
Predicting memory usage in Haskell programs isn't actually tricky. At least, I stopped thinking so once I became an intermediate Haskeller. It's not that hard to have a mental model of the Haskell RTS the same as you'd have the JVM.

Having the ability to do so generally is tablestakes for being an intermediate professional programmer imo. In university, I had to draw diagrams explaining the state of the C stack and heap after each line of code. That's the same thing. And I was 19 lmao. It's not hard.

Maybe you're referring to space leaks? I've run into like 2 in my ten year Haskell career, and neither hit prod

I've actually seem more Go and Java space leaks/OoM bugs hit prod than Haskell - despite having fewer total years using those languages than Haskell! Nobody blamed the language for those though :/

[go to top]