You, Too, Can Be on the Cutting Edge of Functional Programming Research
prog21.dadgum.com
prog21.dadgum.com
It's a bit like making friends in a new language: when your tongue is tied, your interactions with others are sometime marked by this naive, disarming honesty that is charming and uncomplicated and utterly impossible to reproduce in your native tongue. It's sometime tempting to ascribe that to language itself, but it's not inherent to the language -- it's circumstantial. As you become fluent, shades of irony and evasion creep back into your speech.
Functional programming comes with its own bag of clever-clever tricks, and lack of familiarity will only stay your hand from them for as long as you lack familiarity. Ignorance is ephemeral. Contending with arbitrary handicaps may be formative, but it can't (and shouldn't) drive adoption.
While I think multiparadigms are very practical, the easy availability of familiar approaches is a weakness when using them for studying programming.
Also, functional languages such as Haskell don't forbid mutability/effects, they just make them explicit. This is only a handicap in the sense that it makes some types of changes more difficult (e.g: Adding an effect to code that previously did not have one). But this has enormous advantages, because there are so many interesting things we can do when we have the guarantee that things have no effects when they actually don't.
[1] http://www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pd...
The primary consequence was to improve my use of my native language, Python -- I'm much more likely to use all() and any() and map() and reduce() and set() where they make sense, to think of my functions in terms of composability, etc. I'm not sure that I'll ever put in the time to be fluent in Clojure, but I'm glad I spent some time stumbling through it.
def collection ():
list = []
while someLoopCondition ():
while someOtherLoopCondition ():
list.append (someStuff ())
return list
vs def collection2():
while someCondition ():
while someOtherLoopCondition ():
yield someStuff ()The problem, in my opinion, of so much of functional programming research is that the presented applications are most often developed only for the sake of one or two research papers and then stopped pursuing. This leads to various papers, scattered across the internet, which all hold some precious information, but are incredibly hard to put together and make real world things out of them (I remember, when I just recently had to search through 7 years of Yampa mailing list, to maybe find some information on a problem I had).
Which is why I decided to add some Yampa “Hello world”-like programs to the aforementioned repository, so lone wanderers through the field of FRP are not so lost after all.
[edit: should me more readable with paragraphs...]
(On the other hand, I do also think that one of the problems FRP faces is in trying to bind to a very not-functional world. UI toolkits in particular are deeply, fundamentally imperative, and such massive endeavors that the idea of replacing one with a functional equivalent is laughable, because the resources aren't there, even though there aren't any fundamental blockers. Needing to hook up your FRP to such toolkits to get them to do anything is a huge up-front penalty to pay to even get one started.)
In a world where everybody implements MVC web framework in their favorite language, reimplements window managers in their favorite language, and reimplements all manner of other software simply because it wasn't in their favorite language... there's a reason all the communities just bind to GTK, QT, and wxWidgets and don't reimplement widget frameworks from scratch in their favorite language, even for languages much better funded and bigger than all the functional programming communities put together. Just the bindings can be major and in some cases unsustainable efforts for smaller communities.
A minimal toolkit that can do interesting things is a few weeks of work in Haskell. Here's an implementation of one: https://github.com/Peaker/bottle/tree/master/bottlelib/Graph...
It is incomplete and non-comprehensive, but adding the nuances needed to make it more complete and comprehensive wouldn't be too much work (it's simply not our focus in the project).
So it's minimal AND incomplete. Not even minimal and complete. That's what the parent was saying. And it will likely stay that way (as it's not even your focus in the project), and be forgotten.
There are tons of toolkits like that.
The application I like most is programming languages--not just compilers and interpreters but also various tools and analysis. I think quite a lot of software related to languages gets written in functional languages, and in my experience Haskell is much better for that sort of thing than Python or JavaScript. I've actually written very similar interpreters in all three languages so I think I have a particularly useful perspective here.
Another field is web development. There was an article recently about Yesod's being as productive as Rails; I think a functional language would be a safe choice for your next web app.
I think there has even been some 3D modelling software written in a functional language--Wings3D is written in Erlang unless I'm much mistaken.
I haven't really been paying much attention to other fields--all my time recently has been spent almost equally between language stuff and web stuff--but I think there are other cases where functional programming is a fairly safe choice that are not just calculations.
Coincidentally, I doubt that we will see Photoshop or a word processor in a functional language any time soon. Not because functional languages are particularly unsuitable but because word and image processing software is rather big, boring and requires a lot of specialized knowledge; I imagine the intersection between "functional programming enthusiasts" and "word processor enthusiasts" is not very big. In fact, most of the people I know who like functional programming use something like LaTeX rather than a word processor and don't do much image manipulation either.
He asks about software WRITTEN in a FL.
And that's just Haskell, I know that the Clojure folks are doing lots of interesting stuff, and the Erlang folks too. I honestly have no idea what is being done in F# but I assume it's being supported for a reason.
I don't think anyone has _proven_ that FP strictly better than imperative style (though I think it is). However, I think it's been amply proven that it's at least _as good as_ imperative programming. The argument that no one has ever built more than a glorified calculator hasn't been true for a long long time.
We passed 4000 libraries last month :)
But it is not less important and at that level it really is the cutting edge.
One very big mistake we have made over the last years in Academia is to only value "new" ideas rather than revisiting old ones. To a certain extent we are blind to research and work that came before.
Research in a more general sense of things nobody has done before, and not just publication track research, is a valid use of the term, and as you say yourself makes perfect sense and is well defended.
Heck, there's room even in the web framework field to do something innovative and not just write MVC-in-Haskell again. (Though even Yesod, the most MVC-in-Haskell framework, has some interesting stuff built around the typing system. I can attest that it is as easy to write an app in Yesod with no cross-site-scripting attacks as it is easy to write an app with one in a more traditional framework.) There's already some interesting work going on there and the projects in progress are clearly not fully exploring the space of possibilities.
No, but doing something nobody else has done is not "Becoming a layman's authority/source on a subject" it's being on the "cutting edge of research" even if it's not academic research.
No, but you're on the cutting edge of straw-man argumentation trivializing.
Doing something that has been done very few times, or not ever, in a whole programming paradigm (building a game functionally)
is qualitatively and quantitatively different than:
doing something that has been done trivially for centuries just not in this particular day && by somebody else than you && in one piece of furniture you own (you sitting on a chair).
If you cannot understand this, I guess it makes no sense further arguing about it.
If only I was that good!
Research contributions generally have be novel AND significant. We have seen that novelty alone is not sufficient (sitting in the chair). Significant generally means applicable to a broad range of problems. Monads are significant, as one abstraction can encode a huge range of structures (containers, control flow, etc.) Building a game in Haskell is not a priori novel OR significant. People have done this before (e.g. http://www.haskell.org/haskellwiki/Frag). Haskell has good facilities for managing concurrency and state. It's not obvious to me that one would need to go beyond these to build a game. A game would probably need to bind to some C libraries but I don't see this as a significant contribution.
The original post made the following points:
- Writing a game in Haskell in novel (No. See above.)
- Writing a game in Haskell will generate significant contributions to the wider community. I don't see this.
Furthermore, it trivialised the accomplishments of both the functional programming community and those who really are on the cutting edge of research.