in reply to Perl functional programming system

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,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: Perl functional programming system
by BrowserUk (Patriarch) on Sep 11, 2015 at 17:08 UTC
    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.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.
    I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!
Re^2: Perl functional programming system
by bagyi (Acolyte) on Sep 11, 2015 at 17:24 UTC
    Thanks for very details reply! I'll look into them. Perl6 seems to have many functional programming features built in.
        Ixnay on the Erlpay-Iksay around BrowserUk.

        Why not? I'm not against Perl6.

        I've said all along that if it ever materialises with sufficient performance to be usable for the kind of stuff I do, I'll seriously consider using it. I really like some aspects of the language design.

        I've been down on the development process; and still hold serious reservations about some aspects of the infrastructural design; but I've never been against the idea or flavour of the language.

        Seems another case of people reading what they think I might write; instead what I actually write.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
        In the absence of evidence, opinion is indistinguishable from prejudice.
        I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!