Functional Programming

Dr. Dobb’s Journal this month features an article about functional programming.  I haven’t read it all, but this is the third reference at least to learning such.

Besides the news article I can’t find now, there the info below (from Microsoft) (the basic premise of the news story was this: chipmakers now say it’s up to software to continue the progress of Moore’s law.  Not quite, since that refers specifically to transistor size/cost, but the advantages of such won’t be available until programs get better at utilizing them.  And the best way to do that is a paradigm shift: functional programming.)

I haven’t yet defined functional programming; for now, go along with me (I might explain at the end).  I watched this video (the first twenty minutes, anyway — I know, I know, that’s a long time, but I think it pays off about fifteen minutes in, really) and then I was hooked, so I had to investigate other things.  (I should probably respond to a few aspects of the video abve that I agree and disagree with, check back later to see if I do.)

Turns out that F# is Microsoft’s version of ML, like C# is MS Java.

I downloaded and installed OCaml, and started learning, but I was trying to figure out a good, non-trivial demo/sample program.  If you have any good ideas, let me know.

Definition of Functional Programming

This is as good as any I’ve seen.  It’s more in-depth and historical than I would’ve been.  The summary is this: functional programming involves only “final” variables (once set, a value never changes; everything is constant [i.e. x = x+1 is as meaningless as it is to a mathematician]; functions have no side-effects, etc.)

Debugging is easy, algorithms are more difficult to design, but can be more efficient, and implemented more easily on a parallel architecture, and there are other benefits (see the post for details).

Secondly, I found a paper that, in the conclusion, says that functional programming provides benefits by two key aspects: higher-order functions and lazy evaluation.

I invite comments, and I will incorporate them as appropriate and respond to any interesting or significant issues raised.

Advertisements

2 Responses to “Functional Programming”

  1. My Functional Programming Intro « More than a Tweet Says:

    […] (that’s coming, I promise), but rather the oral history of what sparked my interest: besides F# (I still have to write my commentary on that, but I found another resource there — it’s […]

  2. Func. Prog. Lang. Ref. « More than a Tweet Says:

    […] is my “initial” list of languages (from the DDJ article mentioned previously, and friends like […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: