views:

365

answers:

6

I've been reading a bit about functional programming recently and am keen to get have a bit of a play. are there any decent scripting languages that support functional programming? I find that the bulk of my ad-hoc programming is done in Python, so I thought I might be able to do the same with a functional language. Any recommendations?

+3  A: 

Python can be written in a functional style, as can JavaScript. If you mean something more purely functional, then you could try Haskell.

mishac
+6  A: 

Lua appears to fit your needs:

Lua (pronounced /ˈluː.ə/ LOO-uh) is a lightweight, reflective, imperative and functional programming language, designed as a scripting language with extensible semantics as a primary goal.

Alnitak
I had a look at Lua this weekend...what a cool language...a lot like python in terms of ease of use. I like it :)
Dawsy
+1  A: 

It depends on what you mean by "scripting language." It isn't commonly viewed that way, but many Scheme implementations seem to fit the bill as well as Python, and Lisp is sort of the archetypal functional language.

Chuck
A: 

GNU's Guile can be used as a stand-alone script interpreter, see this FAQ entry for the details. Not sure how much general programming support is in Guile, though, but it could at least get you started quickly with something that should look and feel like a "traditional" functional language.

unwind
+2  A: 

Perl can do functional style programming very well. It isn't a pure functional language by any means, but it supports quite a lot of functional idioms. The classic full-length treatment is Mark Jason Dominus's Higher Order Perl, which is now available freely online.

For briefer introductions, take a look at these slides:

Telemachus
A: 

Scala can also be used as a scripting language. It runs on the JVM and supports both imperative OO and functional programming. Using this you can have access to the entire Java class library.

Jason Miesionczek