Hacker News new | ask | show | jobs
by star-techate 2847 days ago
Laziness is a superficially useful anti-feature.

I'd suggest waiting with OCaml until dependently-typed languages become more practical.

1 comments

This is simply false. One can debate laziness as a default, but pure immutable languages need laziness.
> pure immutable languages need laziness

https://mercurylang.org/

If you put the most valuable thing in the universe inside a box that can't be opened or permeated by any force in the universe--then that thing is no longer valuable. Go find the former #2. If you have a programming ideal and that ideal requires laziness--then you've messed up. You have to conclude that there was something flawed about the ideal.

I'm a lot more confident about laziness being bad than about what you're thinking of as "a pure immutable language" being bad, but part of the problem about laziness is that it's a feature apart from the language it's in. If you implement a cache with a hash table in any normal language, then you can later on check and see how much data you have cached, keep track of your cache hit rate, empty the cache, pre-load your cache from a previous run, and so on. To work with your cache, you have the language itself at your disposal. If you implement a cache with a lazy list in language X, then language X can't help you. You'll need to hope that whatever Gods dangled laziness before you, also have some tools dangled elsewhere.

> If you put the most valuable thing in the universe inside a box that can't be opened or permeated by any force in the universe--then that thing is no longer valuable. Go find the former #2. If you have a programming ideal and that ideal requires laziness--then you've messed up. You have to conclude that there was something flawed about the ideal.

Not at all what I am talking about.

Please consult the literature on the subject and then we can continue this conversation as equals.

> I'll just bet that you haven't read anything, because you disagree with people I think are, like, super-duper smart :)

Maybe if I read enough Foucault, or drink enough bleach, we'll be able to continue this conversation as equals :)

> I'll just bet that you haven't read anything, because you disagree with people I think are, like, super-duper smart :)

It is quite obvious from what you have said you are not aware of the literature surrounding laziness.

Please do not cross into incivility regardless of how wrong someone is or you feel they are.

https://news.ycombinator.com/newsguidelines.html

Yeah, there's no amount of bigoted "Haskell uber alles" posturing that can replace a simple, supported argument. None of the reading you think you've done, and I haven't, has succeeded in distinguishing your output from that of a complete poser.
Why do you think so? I don't even remember the last time that I used lazyness myself. Not to mention that there are other pure functional languages (such as Idris) that are strict.
You can consult Okasaki's thesis (regrettably it is somewhat out of date) for a list of functional data structures. Some of them are lazy, some of them are strict. But being able to use all them is essential to getting good asymptotic complexity.