Re:OCaml Programming: Correct and Efficient and Beautiful
by AnimalMuppet on Saturday July 26, 2025 @07:12PM
(#44697636)
Is OCaml lazy? I'm not an expert, but if you want ultra high throughput, you might not want lazy. If I understand correctly, in Haskell some nonobvious things can slow you down because of the laziness.
Re:OCaml Programming: Correct and Efficient and Beautiful
by KiranRao0 on Saturday July 26, 2025 @07:26PM
(#44697724)
OCaml is not lazy.
Re:OCaml Programming: Correct and Efficient and Beautiful
by sestep on Saturday July 26, 2025 @07:19PM
(#44697679)
No, OCaml is not lazy.
Re:OCaml Programming: Correct and Efficient and Beautiful
by teiferer on Monday July 28, 2025 @04:37AM
(#44708651)
How does laziness cause a slowdown? It merely reorders work done, it doesn't necessarily create more work.
Re:OCaml Programming: Correct and Efficient and Beautiful
by dev_hugepages on Tuesday July 29, 2025 @05:02AM
(#44720913)
To do lazyness, you need to accumulate "intermediate computation objects" called thunks. These take space and time to store.
See: https://wiki.haskell.org/index.php?title=Thunk https://wiki.haskell.org/index.php?title=Performance/Strictn...
So my guess would be less that Haskell is not these things (nor couldn't it be) but rather that OCaml has had the external forces necessary to optimise for these things above all else.