Re:Multicore OCaml: Feb 2020 update
by __s on Friday February 28, 2020 @03:51PM
(#22446248)
It isn't entirely false. Haskell's GC can take some shortcuts when dealing with immutable objects as they can't reference objects older than themselves, including referencing themselves
[ Parent
| on HN ]
If objects can't reference themselves, do you think recursion is impossible in Haskell?
powersOf2 = 0 : scanl (+) 1 (tail powersOf2)
fibonacci = 0 : scanl (+) 1 fibonacci
As I have already explained, immutable objects in Haskell often use laziness. And laziness requires mutability.
Re:Multicore OCaml: Feb 2020 update
by hope-striker on Friday February 28, 2020 @05:29PM
(#22447009)
Really? I have no experience with Haskell's internals, but self-referential objects are fairly common in Haskell thanks to its non-strictness. The simplest one is probably the list with one element repeated forever.
ones = 1:ones