| [reply] [d/l] |
Yeah, a decade-old book, indeed, but IMHO the best CS/IT book I read in the last decade.
| [reply] |
Hello bagyi, and welcome to the Monastery!
I don’t know of any single, integrated functional system, but contains many modules supplying functional programming features. Here are some:
Lazy evaluation:
Infinite lists:
List comprehensions:
Folds:
Pattern matching:
Currying:
The presence of so many CPAN modules implementing functional programming features in Perl is hardly surprising, given Mark Jason Dominus’s observation in the Preface to Higher-Order Perl:
Around 1993 I started reading books about Lisp, and I discovered something important: Perl is much more like Lisp than it is like C. If you pick up a good
book about Lisp, there will be a section that describes Lisp’s good features. For example, the book Paradigms of Artificial Intelligence Programming,
by Peter Norvig, includes a section titled What Makes Lisp Different? that describes seven features of Lisp. Perl shares six of these features;
C shares none of them. These are big, important features, features like first-class functions, dynamic access to the symbol table, and automatic storage management.
(BTW, just out of curiosity: can someone please enumerate these seven features, and identify the one which is missing from Perl? I’ve often wondered.)
Hope that helps,
| [reply] |
can someone please enumerate these seven features, and identify the one which is missing from Perl? I’ve often wondered.)
See here. He's added an 8th: "history" which is something only a Lisp programmer could claim as important. Algol68 has history; try finding anyone using that.
Of course; Algol's legacy is in all the features that it introduced to the programming language lexicon. Same can be said (or is at least claimed) by Lisp(ers).
The missing feature is described above as "Uniform Syntax"; which basically means s-lists: the ability of the language to process itself as data and subsequently execute the resultant data as code. In short proper code macros (as opposed to C's text substitutions.)
The real problem with programming Perl like it was Lisp -- al la HOP -- is that your 2015 Haswell will perform like a 1993 Pentium.
| [reply] |
Thanks for very details reply!
I'll look into them.
Perl6 seems to have many functional programming features built in.
| [reply] |
| [reply] [d/l] |