Live data from Hacker News

“Mostly functional” programming does not work

queue.acm.org

121–130 of 205 posts

Re: “Mostly functional” programming does not work

#121

Earlier quoted context omitted.

Haskell's community is a bit more thoughtful and less prone to self-promotion. That combined with the fact that you're not a Haskeller, you're not familiar with what they've built. Another issue is that Haskell is somewhat weighted towards finance and they're a bunch that tends to be somewhat proprietary about their IP. Some exceptions (Ermine) exist. Some notable projects that come to mind include git-annex and Pars…

> xmonad is stable. > haskell + smart programming practices guarantee a crash > free experience. Yeah dwm, crashes all the time. Why don't you try another approach to functional programming, like http://www.shenlanguage.org/ ? If you think Haskell is The One True Way™, get a new pair of sun glasses.

[deleted]

Re: “Mostly functional” programming does not work

#122
post #5

The software engineering world is in danger of repeating the mistake it made with objects two decades ago. Back then there were legacy "structured" languages like C and Ada, and new exciting "object oriented" languages like Smalltalk and Eiffel. C++ was promoted as a "middle way" that let you "choose the best tool for the job". This made the pure OO languages look extremist. So, it was argued, if you had a problem be…

C++ and Java did not fail. Their goal was adoption, and they made compromises to achieve it. Scala is no different.

Re: “Mostly functional” programming does not work

#123

Earlier quoted context omitted.

>For instance, in Haskell a value is a value. If I have a value of type Integer then it definitely exists; x,y::Integer x = x + 1 y = undefined

That's an important point, but since you can't test for undefined-ness it's not quite the same thing as carrying around something that's actually a Maybe Int but just hopes you'll check before implicitly using fromJust everywhere.

We just don't want to forget that exceptions and termination are effects, and that Haskell isn't perfectly pure...

    a,b::Integer
    a = div 1 0
    b = sum [1..]

Re: “Mostly functional” programming does not work

#124

Earlier quoted context omitted.

I find it funny to hear such grandiose claims about a language that can has yet to create a major killer project. That's why I can never bring myself to write Haskell. Show me the Storm, OTP, Datomic, Netflix, Whatsapp, etc. written in Haskell and perhaps I'll have a reason to change my mind. But until then all I see is C#, Scala, Erlang and Clojure shipping awesome products and the Haskell guys sitting in the corner…

Haskell's community is a bit more thoughtful and less prone to self-promotion. That combined with the fact that you're not a Haskeller, you're not familiar with what they've built. Another issue is that Haskell is somewhat weighted towards finance and they're a bunch that tends to be somewhat proprietary about their IP. Some exceptions (Ermine) exist. Some notable projects that come to mind include git-annex and Pars…

> The Haskell library I'm working on will, if nothing else, mean that there's a reference for how the JSON is structured.

Well, some projects document systems in MS WORD, you are using Haskell for documenting JSON structures. That's a step up.

Re: “Mostly functional” programming does not work

#125
Is this a satire? I mean this seems like a satire of the fact that the unfortunate framing of functional programming in terms of "purity" and "impurity" clouds a very abstract question with the intense instinctive reactions we have to questions of personal hygiene. Notwithstanding the fact that a programming language is "impure", you cannot catch anything from it. It cannot defile, pollute, or contaminate you. Nor is there any power that will reward you in this world or the next for your supererogatory devotion to "purity" in programming.

Re: “Mostly functional” programming does not work

#126
post #66

> Unfortunately, just as "mostly secure" does not work, "mostly functional" does not work either. I call BS. Pure OO and pure imperative has worked for half a century (a timespan in which functional languages have given us almost NO programs of importance, with the exception of Emacs, AutoCAD and a handful of others). It's not like people have abandoned C/C++/Java/C#/Go/etc because they don't work anymore. Plus, the…

Appealing to tradition doesn't really help to solve any problems we might face in the future - just because things work "now" doesn't mean they're great. Still, the examples you gave are kind of biased because you're only considering a specific kind of walled gardened sofware, which does one job, but has limited extensibility for further development (although this is intentional for most games).

It should be understood when Erik says "does not work", he is not saying these languages are useless or have no practical use today - he is suggesting that they are incapable of solving the problems of tomorrow. When looking for solutions to the problems we're facing now or in future, it's useful to have a look at how we actually build software - what are the "units" which make up the bulk of our software, and how do we combine them. Let's have a look through the decades and reason a little about what these units were.

    1940s: Instructions
    1950s: Subroutines
    1960s: Procedures/Structured programming
    1970s: Interfaces over data
    1980s: Objects
    1990s: Libraries
    2010s: Services
    future: ???
Obviously these are only approximations, but they give a fair idea of our industry's development. For example objects were in use before the 80s, but they were popularized by C++. None of these were new in their day, but they became the primary units of software which we use in our programs - because it's simply too much effort for anyone to write them all from scratch - we are all using other people's software in our own.

Each stage in this development is an attempt to simplify the previous one, by encapsulating, or hiding the implementation detail, and presenting a simplified interface for another programmer to consume. Part of the idea is that you shouldn't need to know the how the encapsulated system is implemented, you only need to consume it in the ways specified.

So while people are writing are building all this software on top of services now using Go/Scala/Clojure and whatnot - what languages are people going to be using a decade or two from now to combine these into bigger programs?

The suggestion of purely functional programming is one that removes the need to know how the program or service you consume deals with state, because effects are made explicit. The idea of purely functional programming as the solution to multicore/concurrency is a just a consequence of having explicit knowledge of state, because we need it to reason about race conditions.

We don't really know what the future will be like, but I imagine it will be one where programs are written to be entirely independent of the hardware in which they run - as they will be intended to run in clouds with heterogeneous architectures - other software will be making those decisions for us, but it can only make them if it can reason about their state. Which suggests we either need to make it explicit, or vastly improve our theorem provers to figure it out for us.

Re: “Mostly functional” programming does not work

#127
post #54

I think that "Mostly functional" is actually the sweet spot. Going to any extreme makes some things horribly difficult and going to another does the same for other things. So, optimally, multiple paradigms coexist in the single codebase, applied where they're most useful. Functional programming with as many immutable bits as possible is definitely a good start. I generally do that for whatever problem I'm solving: I…

I agree. Part of the reason Clojure sees production use and Haskell does not leave its academic closet very often is that the former makes interaction with the non-functional parts of a system painless.

Re: “Mostly functional” programming does not work

#128

Seems about spot on. I find it interesting that he's now advocating monads considering his earlier stance on static type systems[0]. Of course it may just be that he's changed his mind -- it happens. (Yes, I consider monads as fundamentally requiring a static type system, at least if you're using monad transformers or similar advanced techniques. In practice you're not going to be able to get things right without com…

If "in practice, you're not going to be able to get things right..." than what the hell? That just strikes me as crazy.

Note that I am not necessarily against monads. However, this idea that they are both a good answer and require fairly extensive programmatic help seem counter.

I realize we can never reduce programs to things which are trivial and easy to comprehend. However, any new paradigm/trick that will always require compiler assistance doesn't sound like a step forward.

(Of course, in my mind a step forward are tools that don't necessarily need you to change your current languages and programs. Which is one of the things that annoys me with many new languages. Seems we always get a new wave of effectively solved areas of programming with incomplete solutions that are "cool" because they are in the new language.)

Re: “Mostly functional” programming does not work

#129

Earlier quoted context omitted.

> And its going to fail for the same reasons that C++ failed C++ "failed"? > the OO and functional features don't interact well How don't they? Before C++ had lambdas, programmers would define a class with overloaded operator() and use that instead, every time. Now the language provides a way to easily generate the class with its members and constructor and operator() automatically - which is basically what functiona…

Just to cite a few quick examples. If you have a mutable object anywhere in your codebase, the compiler can not reuse calculated values, ignore unneeded code, or map a set of independent output sequences[1] at your source code into highly interleaved single threaded asynchronous output, like Haskell's green threads do. [1] I'm yet to see an imperative language (and "mostly functional" is imperative) that has the conc…

Thats interesting. I wonder if anyone has done a performance study to measure and compare the speed up offered by the functional approach for some standard workload.

Re: “Mostly functional” programming does not work

#130

Earlier quoted context omitted.

I'm an experienced Clojure user with work done on the job and in open source. If you're a Clojure user, it's very likely you've used a library I've worked on or made. Don't bother. Go straight to Haskell and just Haskell. No excuses, no compromises, no mental backflips to justify not learning something new. Learn Haskell properly and then see for yourself why "hybrids" are a waste of time. Hybridized approaches are l…

I spent a couple of years using Haskell, but a few months after I started using Clojure I've switched over to using it pretty much exclusively. I certainly didn't find Clojure to be a waste of time; to my mind it's a far more practically-minded language. It's philosophy of decoupling components is also interesting. For example, in Haskell, the static type system is coupled to the language; in Clojure, the static type…

responding to bitemyapp? brave...
Post reply on HN