Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> it is hard not to see the power that comes from simplicity

Actually, it is quite hard for anyone who's not already versed in Lisp and equipped with some reasonable knowledge of basic FP constructs such as folds.

It's also important to look at the whole picture, and the author of the paper (and FP advocates in general) have this interesting tendency to completely ignore the opportunity cost of using FP and to dismiss the advantages of alternative approaches over FP.

Personally, I think laziness and immutability come at a very heavy price that explains why only the superficial aspects of FP (lambdas) have been adopted while the rest of FP remains the realm of research papers and conferences.



> the author of the paper (and FP advocates in general) have this interesting tendency to completely ignore the opportunity cost of using FP […]

Are you referring to the disadvantages of using a non-mainstream style? That's not relevant here. We're comparing the styles themselves, not their popularity.

> Personally, I think laziness and immutability come at a very heavy price that explains why only the superficial aspects of FP (lambdas) have been adopted while the rest of FP remains the realm of research papers and conferences.

I have a much simpler explanation: first class procedures are compatible with imperative programming, while immutability is not. (And laziness needs immutability to be workable.)

People don't adopt FP because old habits die hard.


> first class procedures are compatible with imperative programming, while immutability is not

But immutability is not is not incompatible with imperative programming, otherwise people wouldn't be writing things like Guy Steele's "Lambda: the ultimate imperative" paper [1]. And of course, monads.

> People don't adopt FP because old habits die hard.

People don't adopt FP for the same reason they don't wear hair shirts; it is presented and marketed as an "eat your vegetables" affair.

[1] http://repository.readscheme.org/ftp/papers/ai-lab-pubs/AIM-...


Most reasonable definitions of imperative programming include the pervasive use of mutable variables, `while` and `for` loops, procedures that have effects beyond their return values, or plain don't return the same values for the same arguments…

You could de-sugar your way out of those (Turing completeness and all that), but then it wouldn't be imperative programming any more. You could isolate those things in a monad, but (i) the monadic part is not functional, and (ii) the rest of the program don't use those things. I stand by my incompatibility claim.

Your marketing argument is better, but I don't see any other way. No matter how you cut it, FP is big about not using some features, and what benefits we get from this restraint.


Haskell has been called one of the best languages for imperative programming [1]. Even in a pure language, we still NEED imperative code at some point where the program hits the real world of time and state (even in FRP a stepper is often needed!). By lifting state and sequencing into a monad, continuation, map or whatever, it is still there even if handled better.

Now, you don't need to use imperative programming everywhere, and in a functional language you have the option to easily not fall into it (well, in Haskell, most other popular FPs are way less pure).

> No matter how you cut it, FP is big about not using some features, and what benefits we get from this restraint.

And that is really why FP will be niche (especially pure FP). Like very powerful static type systems that are really good at saying no...it adds to the resistance of writing code while claiming benefits further down the line. "Worse is better" wins out over and over again (why dynamic languages, imperative programming, OOP continue to be popular; we aren't Vulcans after all!).

[1] http://stackoverflow.com/questions/6622524/why-is-haskell-so...


> Like very powerful static type systems that are really good at saying no...it adds to the resistance of writing code while claiming benefits further down the line.

My experience is the exact opposite: having a compiler that is good at saying no means I correct my errors earlier. With a dynamic typing, my errors are revealed later, and further from the root cause. So, static typing removes to the resistance of writing correct code. It speeds me up.

Static typing would indeed add to the resistance if it required you to jump through hoops. But it doesn't. Bad type systems have significant limitations, but the good ones have very few. Unless you go crazy with Smalltalk-like hot-plug live systems (and even then, see Yi and Xmonad), static typing is permissive enough.

> we aren't Vulcans after all!

I have two theories. The first is, some of us are Vulcans. And somehow, Vulcan brains function better with static typing and functional programming. In other words, Vulcans are better at "math", and put programming into the "math" bucket. Then there are humans, who see programming and mathematics as two quite separate disciplines, ran away from math, and function better with procedural programming and dynamic typing.

My second theory is that everyone could adapt to anything, if only they would bother to learn. Anyone can think like a Vulcan.

I currently lean towards the second theory, though frankly I'm not sure which theory is closest to reality.


> Static typing would indeed add to the resistance if it required you to jump through hoops.

No arguments there. Haskell makes some interesting tradeoffs in this regard, I'm not sure they are optimal but they are definitely valid.

> Unless you go crazy with Smalltalk-like hot-plug live systems (and even then, see Yi and Xmonad), static typing is permissive enough.

The PL community is just really bad at exploring incremental type checking technology. It is totally possible (and I'm doing it with the live programming language I'm working on).

I only claimed that: if static typing feels like it is resisting too much, programmers won't like it. How fluid is programming in Haskell? Ever try using it in a REPL?

> The first is, some of us are Vulcans.

Yep. Take SPJ, the guy is brilliant and I feel like we are from different planets when we talk.

> In other words, Vulcans are better at "math", and put programming into the "math" bucket.

Some programmers like to treat programming as math, but definitely not all of them or even a majority of them.

> My second theory is that everyone could adapt to anything, if only they would bother to learn. Anyone can think like a Vulcan.

Spock was never able to convert Kirk. And I doubt we ever wanted him to.


> How fluid is programming in Haskell? Ever try using it in a REPL?

I program in Haskell using the repl as well as any other languages that make it possible.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: