The Rise of Functional Languages
April 30th, 2007 by Pat Eyler
Functional Languages seem to be pushing for the title of the next cool thing. Talks and tutorials about them are starting to show up in conferences and conventions, books about them are hitting the shelves, people are even asking about talking about them in blogs and mailing lists devoted to some of the current hot languages.
Does this mean you’ll be using one next year? Maybe, but probably not. Does it mean you might want to spend some time learning one? Absolutely. Brief description of functional languages. Dave Thomas and Andy Hunt the Pragmatic Programmers recommend learning a new language every year, calling it a LOTY (Language of the Year). In his book ‘My Job Went To India’, Chad Fowler complains about programmers who say things like: ‘No I haven’t been given the opportunity to work with language Foo, or framework Bar.’ This is a great chance to look at something that’s very different from the way you’re programming today, something that could change the way you think about programming challenges.
So, what are functional programming languages? At the core, they’re languages that carefully follow mathematical concepts. Variables aren’t, at least not as most programmers think of them They’re more like a variable in algebra—once you’ve found the value of X in a problem, it’s not going to change on you.
Functional languages also avoid ‘side effects’. That is, if you pass a value into a function it will not be changed and the function will not cause other changes somewhere else in your data (there’s a formal method for getting around this to do things like output … I’m not planning on getting into that here though).
Meta-programming, lazy evaluation, and type safety are much more common idioms in the functional languages I’ve seen too.
These differences mean that doing simple things like iterating over a loop and incrementing a counter as you do just don’t work in functional programming. Recursion, list mapping, accumulation, and the like are much more common in the functional world.
This might sound a little strange—I mean, how can you program without loops, or variables that can vary? In truth, functional programmers seem to be doing very well. They seem to be over-represented in the top finishers in programming competitions. Their code tremendously terse, and often scarily efficient. It’s just not mainstream (yet).
Functional Languages seem to get a lot more traction in Europe and academia right now. Over the last couple of years, they’ve been making up ground in that group Tim O’Reilly likes to call ‘the Alpha-geeks’. Whether or not functional languages are poised to take the next step into wide spread adoption is anybody’s guess, but it’s certainly a possibility.
Recently, three different publishers have release books about different functional programming languages. First, Apress put out Practical OCaml, which didn’t go over very well in the community—I know they’re looking at what they can do to ‘get back on the horse’ and get a really successful functional language book out the door.
Next up was Cambridge University Press was next with Programming in Haskell. This looks like a very solid book, and I’ve heard other people say good things about it too. I have to admit that I’m put off by the use of special characters in program listings, where the actual code would use a normal ascii symbol (for example, the greek lambda character in place of an /).
Most recently, the Pragmatic Programmers have launched a beta of Programming Erlang by Joe Armstrong (the creator of Erlang). While this isn’t done yet, It looks wonderful, and everyone I know is raving about it—even my local Ruby brigade is going to start working through the book one night a month.
I’ve been buried under a huge load so far this year, so I’m coming late to my LOTY for 2007, but I’ve settled on Erlang. The combination of functional programming, a tremendous level of concurrency baked into the language, and a great book from Joe Armstrong and the prags has sold me. I’m looking forward to starting in the second half of May.
__________________________--
-pate
http://on-ruby.blogspot.com
Subscribe now!
Breaking News
| SSL Glitch Unlocks Debian, Ubuntu, & Others | 5 hours 42 min ago |
| MySpace Cashes in Spam to the Tune of $234 Million | 7 hours 44 min ago |
| Google Shoos the Trustbusters Away | 1 day 4 hours ago |
| Skype Dumps GPL Jump | 1 day 6 hours ago |
Featured Video
Linux Journal Gadget Guy, Shawn Powers, takes us through installing Ubuntu on a machine running Windows with the Wubi installer.
Delicious
Digg
Reddit
Newsvine
Technorati






The Rise of Functional Languages
On May 3rd, 2008 sindy says:
thank you for the information
__________________________A Giyotin P Msn nickleri O Sohbet odaları
Learn Scala
On October 22nd, 2007 Sergiu Rata (not verified) says:
It looks like Scala draws on lots of good features from Erlang, however implemented on top of JVM and you can reuse lots of "old" Java code, hence you get to preserve the investment. And along with FP, it's OO as well.
We are using TCL - 500,000 lines of it...
On May 6th, 2007 Frank Bergmann (not verified) says:
Did you know that TCL is a functional language? Basicly, it's a kind of LISP with a sytax that looks a bit like Basic...
Just to stress the point that functional language are alive and kicking: We've got some 500kLoC at http://www.project-open.org/, and with more then 1000 pages it's probably the largest open-source web application around...
Cheers,
Frank
Lisp and Scheme
On May 2nd, 2007 Anonymous (not verified) says:
books:
Practical Common Lisp - Peter Seibel
On Lisp - Paul Graham
ANSI Common Lisp - Paul Graham
The Little Schemer - ?
The Seasoned Schemer - ?
Structure and Interpretation of Computer Programs (Scheme) - Abelson and Sussman
lisp isnt Pure functional language, but still is a functional language. and much easier to learn and more powerful than any other language (any, meaning, ANY language).
LISP?
On May 2nd, 2007 Anonymous (not verified) says:
LISP?
OCaml for Scientists
On May 1st, 2007 Jon Harrop (not verified) says:
The book "OCaml for Scientists" received fantastic reviews.
Cheers,
Jon.
Funny looking characters in code listings
On May 1st, 2007 kirstin (not verified) says:
Quite a few haskell programmers use a literate programming system. In fact, one is built right into ghc. After the source code is prepared by latex into a document, the code listing does in fact show use an actual lambda for a '\' as well as an actual arrow for a '->'.
There is a reason that mathematicians use their funny notations, and don't write papers with only ascii characters. I imagine it's confusing if you've never done much with predicate or lambda calculus, but the lambda came first, and the backslash is just the best ascii representation we have. It's not supposed to be a bashslash. It's a lambda.
lots more comments
On May 1st, 2007 Pat Eyler says:
I hate to point elsewhere, but there are a lot of good comments about this article over at programming.reddit.com.
--
__________________________-pate
http://on-ruby.blogspot.com
--
-pate
http://on-ruby.blogspot.com
Tools for the job.
On April 30th, 2007 Anonymous (not verified) says:
Tools for the job. Functional languages are best suited to certain applications such as parser and compiler construction. Things where a formal syntax is needed that evaluates to a known good state i.e. the main function returns true. I don't think we're going to see functional languages used to write web applications etc.
Next buzzword please.
I'm not to sure.
On May 9th, 2007 Wellingj (not verified) says:
Ruby is a functional language... I've heard it's doing quite well with web apps.
And our AI teacher allowed us to use Ruby instead of CLISP on some assignments.
Ruby was way more enjoyable....
Real-world apps -
On May 2nd, 2007 Anonymous (not verified) says:
YAWS is a web server written in Erlang.
eJabberd is a XMPP/Jabber server written in Erlang
(by very skilled Russians! :>).
MLDonkey is a eDonkey GUI client written in Ocaml.
There are quite nontrivial packages/libraries for web application development for Common Lisp and Scheme, heavily relying on features of these languages (closures, continuations, etc).
FPLs are coming. Into mainstream and out of obscurity.
Now you don't have to search much to find that they are used indeed.
What about XML and XSLT
On May 1st, 2007 elarson (not verified) says:
XSLT is essentially a functional language. The popular jQuery javascript toolkit also has some functional qualities. Python's WSGI also is rather functional in nature. Sure, we may not see the web written in Erlang or Haskell any time soon, but the patterns found in functional languages provides a great framework for asynchronous communication, which is what built the web
The right tool for concurrency
On April 30th, 2007 Anonymous (not verified) says:
FP also works a hell of a lot better than most paradigms when it comes to dealing with concurrency. This reason alone is why you are going to see FP take off in a big way over the next couple of years.
web development
On April 30th, 2007 Sean McEligot (not verified) says:
With functional languages most errors are found at compile. You can even write XHTML in a functional language and the compiler won't let you violate the spec or forget to close a tag. This saves a lot of time in web development where compile-test-run can be a slow process.
hmm, this would seem to say
On April 30th, 2007 Pat Eyler says:
hmm, this would seem to say that at least some people are writing web frameworks in erlang. And, this
seems to say some people are writing web apps in erlang.
Sure, use the right tool for the job, but don't turn up your nose
at something just because it's new. Sometimes there are some cool tricks hiding in that new programming language.
--
__________________________-pate
http://on-ruby.blogspot.com
--
-pate
http://on-ruby.blogspot.com
Is it "something new"?
On May 3rd, 2007 IsaacKuo (not verified) says:
Functional languages have been around a long time; they predate "object oriented" languages. I was never much of a fan of "object oriented", so if "functional languages" take the spotlight from OO, then I'm all for it!
But obviously there are some new twists to this old idea going on. Functional languages were always really cool, but this is the first I've heard of them being used for web development. Of course, the last time I was using functional languages, HTML didn't even exist...so what do I know?
and there's links.
On April 30th, 2007 roy_hu (not verified) says:
and there's links.