Why I've so far been neglecting functional programming languages

May 15, 2013

Functional programming languages are in many ways the latest hotness and so for years I've been making off and on runs at things like yet another explanation of monads (which I think I sort of understand by now) and similar topics. Despite this, so far I've been almost completely uninterested in actually trying to write a functional program or exploring a FP language.

The big problem for me is that as far as I can tell, the kind of programs I usually work with are exactly the kind of programs that functional programming is stereotypically a bad fit with. The stereotype I've absorbed is that functional programming is quite a good fit for computation but not a good fit for IO, because IO intrinsically has side effects. Unfortunately most of what I write is all about IO and has little or no computation. Bashing a squarish peg into a roundish hole is unlikely to tell me anything particularly meaningful about nice the language is to work in; what I really need is a roundish peg, a computational problem, and those are relatively scarce around here.

(It's possible that I'm not looking hard enough. For example, I do periodically want to do things like log analysis or event reassembly, where the original data could just as well be a predefined data structure in the program instead of processed from logfiles on disk. I suspect that a functional language would handle these fine, maybe better than ad-hoc hackery in awk, Python, or whatever. If I was really crazy I would try rewriting the logic in our ZFS spares handling system in an FP language to see if it got clearer; it's fundamentally a series of transformations of a tree and then some analysis of the result. The result might even be more testable.)


Comments on this page:

From 68.195.89.131 at 2013-05-15 12:15:10:

so take an incremental step: scala. runs on the jvm, seamlessly integrates with java, lets you program in both a functional and an imperative style (with a slight push towards functional). it is fully supported by eclipse (if you care about things like automation for re-factoring). if you like perl or python, you'll appreciate the syntax too (when compared with java). caveat: i'm having a blast learning about it now :-).

Written on 15 May 2013.
« My language irritations with Go (so far) and why I'm wrong about them
Why ZFS's CDDL license matters for ZFS on Linux »

Page tools: View Source, View Normal, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Wed May 15 00:56:36 2013
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.