|Just another Perl shrine|
Re: Re: When would you use functional programming?by jordanh (Chaplain)
|on Oct 17, 2002 at 00:00 UTC||Need Help??|
I'm very attracted to Functional Programming also. If I ever get around to it, I plan to introduce my 11 year old daughter to programming via Scheme. But...
Larry Wall refers to Icon (not a Functional Programming Language - an odd hybrid really between Logic, Functional and Procedural) as a "Cat" language, while Perl is a "Dog" language. I think I agree with that about Icon, and maybe it applies to most Functional languages, as well.
Like a Cat, they are pretty to look at, nice to have around, but aloof and not practical at all. Dogs are loyal and serve many practical functions.
Among Functional Languages, I'm very attracted to Scheme. Ovid noted how Functional programming was all about creating definitions and letting them define the solution for you. I like Lisp and Scheme because the language systems have the most direct support for Meta-Programming. There is no distinction between programs and data in these languages, so you can create definitions that create definitions in the most straightforward way possible. This is applicable to generating new language systems and programming paradigms on top of the base system. I've never seen languages where whole object systems and Logic programming systems can be defined in so few lines as you can in Scheme.
The possibilities are limitless. Scheme has even captured the essence of control structures and goto in a completely functional manner with continuations. It's amazing, heady stuff really.
I do think it's important to be exposed to this stuff and take away what's good, but I still feel that for much of what I do, Perl will make me more productive. Perhaps I would devote all my hobbyist programming time to Scheme if productivity weren't so important to me. Perhaps not...
Oh, and check out Icon, too! Look at the 8-queens problem in Icon sometime... wonderful...