3 ms·
Oh, Prolog. I once wrote a hardware configuration in Prolog. (Dependency resolution - rules like "An A requires a B or a C".) The configuration part was fine.
by Animats 10y ago
Oh, Prolog. I once wrote a hardware configuration in Prolog. (Dependency resolution - rules like "An A requires a B or a C".) The configuration part was fine. Trying to write a menu system in pure Prolog, though...
Most of the troubles with functional programming come when you actually have to do something. The imperative/functional boundary remains a problem.
- agumonkey 10y agoThat was Backus conclusion after his FP forray.
- tome 10y ago> Most of the troubles with functional programming come when you actually have to do something. The imperative/functional boundary remains a problem. How does it remain a problem? I've been writing commercial Haskell programs that do something for years now.
- Animats 10y agoMonads are kind of a hack.[1] [1] http://research.microsoft.com/en-us/um/people/simonpj/papers/marktoberdorf/mark.pdf http://research.microsoft.com/en-us/um/people/simonpj/papers...
- dllthomas 10y ago"X is a solution to problem Y" doesn't imply that X is a hack. You'll need to be more verbose if you were making a more specific argument.
- pron 10y ago(User-visible, generic) monads are absolutely terrible for expressing effects. That so many people have a hard time understanding them fully shows that it's a real problem of the most serious kind (aside from their inherent shortcomings). That just a vanishingly small portion of developers enjoys working with them is not an indication of a lack of a problem, but rather of its presence. That people in PL research are actively trying to find alternatives to monads (and you have people like Martin Odersky publicly saying they don't like monads) is yet another (though less powerful) indication. That some pure languages like Haskell decided to treat mutation as a side-effect like IO (requiring monads) only exacerbates matters.
- carterehsmith 10y ago> Most of the troubles with functional programming come when you actually have to do something. Nah, when you say "do something", you are referring to something we call "side effects" and is generally frowned upon. Your program should consist of pure functions only, be side-effects free, and there should be no state. Of course, such a program can't do anything useful, but you see, that is not the point. And if you don't see the point, you can't be helped. Am I doing this right?
- gavinpc 10y agoBackus himself admitted this, in an interview circa 1995: > Doing a functional language and combining it with the ability to do real things is very hard. And everybody has had a problem with it.[0] Or, as the editors nonsensically summarize it: > FP [the language] is not suited to many mundane programming tasks, particularly those that consist primarily of fetching data, updating it, and returning it to some database. Tasks such as updating an account balance are naturally suited to the von Neumann paradigm. This book is for a general audience, but that's a particularly bad example since ledger accounts are just about the oldest form of append-only database. (edit, Like old enough that Chaucer makes a very raunchy joke about "double entry" bookkeeping.) [0] From chapter 1 of _Out of Their Minds_, by Shasha and Lazere.