News for hackers. Stuff that matters.
Re:I'm Not Mutable, I'm Partially Instantiated (Prolog) by skybrian on Thursday November 07, 2024 @01:01PM (#42079110)
Haskell has cyclic data structures, which also can’t be implemented without a mutable reference somewhere, though it may be buried in the implementation.

The difference is being able to define an incomplete data structure (with a forward reference) and then defining the target of the reference at runtime. Most languages will complain about an undefined reference if it’s not defined by the end of a module.

You could do it with soft references, though. Use a symbol or string to refer to something and define it later.

Re:I'm Not Mutable, I'm Partially Instantiated (Prolog) by bmacho on Thursday November 07, 2024 @01:33PM (#42079445)
I rather think the fact the the same symbol/string always denotes the same thing is especially helpful for cyclic structures.

Anyway I think I misunderstood the article, I thought they added things to a dictionary in the prolog repl, which would be impossible in haskell/ghci afaik.