in reply to J2SE 5.0 new features are just sugar from Perl (and other similar languages).

It would be hard to come up with a language feature that Perl invented itself. Maybe psedo-hashes, but that's not exactly something to be proud of. Creative and academic endeavors always build on previous efforts.

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

  • Comment on New Perl Features are Just Sugar From Language X

Replies are listed 'Best First'.
Re: New Perl Features are Just Sugar From Language X
by Joost (Canon) on Oct 12, 2004 at 23:25 UTC
    At the moment I'm learning LISP, and it's interesting to see so much stuff that is new and confusing and (probably) coming in Perl 6 already in use in (Common) Lisp for decades - e.g. coroutines & continuations, a really useful macro system, etc...

    To contrast - Common Lisp was standardized in 1986, and the original LISP was implemented in the 1960's, while Perl 1 was released december 1987.

      According to The Implementation of LISP, the original LISP actually was implemented in 1959.

      As for coroutines and continuations, these are not built into Common Lisp. However if you write the right macros and adhere to strict standards, you can achieve them. Or if you postprocess Common Lisp, you can again create continuations. See On Lisp for details.

      What we don't often hear in the Perl community is that continuations are not necessarily a positive feature in a language. For an example of why not, what belongs in a useful stack backtrace if you are using continuations?

Re: New Perl Features are Just Sugar From Language X
by jdporter (Canon) on Oct 12, 2004 at 19:03 UTC
  • Hashes: significant academic research before Perl got them. I'm not sure if anyone integrated them (or other types of associative arrays) so closely into the langauge before Perl did.
  • awk, at least.
Re: New Perl Features are Just Sugar From Language X
by BrowserUk (Pope) on Oct 13, 2004 at 07:25 UTC
    Hashes: significant academic research before Perl got them. I'm not sure if anyone integrated them (or other types of associative arrays) so closely into the langauge before Perl did.

    REXX had associative arrays a long time ago.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
      What was the date/version hashes came to Perl ?

      Would the associative containers that come in C++ count ? They were formally made part of the C++ standard in 1994. And Stepanov (one of the HP researchers who developed the STL) had been publishing papers on generic programming since at least 1982 - only 4 years after Kernigan and Ritchie published "The C Programming Language".

      use brain;

        My Perl experience only goes back as far as 5.6.1, you'll need merlyn or one of the others with the Knowledge of the Ancients (sorry, too much Stargate :), for the answer to your question. I pretty sure that P4 had hashes, but I don;t even know when that came into being.

        I do know that REXX had associative arrays way back in 1987. That was my first encounter with them, and I remember thinking that the were bloody nearly magical before I read up on hashing and hashing algorithms.


        Examine what is said, not who speaks.
        "Efficiency is intelligent laziness." -David Dunham
        "Think for yourself!" - Abigail
        "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
Re: New Perl Features are Just Sugar From Language X
by Anonymous Monk on Oct 12, 2004 at 14:05 UTC
    Virtual Machines (like Parrot): Java had one first, and Scheme and other LISP varients before that
    Erm... If Schene had one before Java, Java's not the first.

    Perl 5's a VM, and it's older than the JVM. Having said that, the UCSD P-machine's older still, as is the inform engine and any number of BASICs.

      Maybe you should have read to the end of the line you quoted, where he clearly states that Scheme and LISP had them before Java.

        The point that Perl had a VM before Java is still important though. Parrot is just an attempt to polish and unhitch that wheel from Perl.

      I'd guess the first programming language that has something I'd call a virtual machine might be Forth.

        Good guess, but LISP wins. Forth was invented in 1968. The first version of LISP is about a decade older.
Re: New Perl Features are Just Sugar From Language X
by FoxtrotUniform (Prior) on Oct 12, 2004 at 20:25 UTC
    It would be hard to come up with a language feature that Perl invented itself.

    Perl's "regexes" are quantitatively more powerful than most regex dialects, rather than just syntactic sugar run amok. I suppose if you want to be really fussy about it, all languages build on work done by Church and Turing (and you can probably go back to Peano and even Euclid if you want), but that's starting to get a little bit ridiculous.

    Hmm... Church numerals in Perl? Sounds like a decent obfu gimmick.

    --
    Yours in pedantry,
    F o x t r o t U n i f o r m

Re: New Perl Features are Just Sugar From Language X
by ambrus (Abbot) on Oct 12, 2004 at 20:40 UTC

    What about the object system (symbol tables, globs, method calls, autoquoting in braces or before =>)? The different variables associated to the same name: scalar, array, hash, code, io, format (sure lisp has scalars and functions in different namespaces, but surely not so many types)? Lexical and dynamic localization in the same language? Function call without parentheses? Function call syntax depending on prototypes? Arrays and strings resizable efficently? Such simplicity of string operations that you still can't find in any other languge? These are all inventions of perl.

    Also just show me a language with a reference-counting garbage-collector.

      I think most of the things you mention are embracing and extending existing ideas, not new ideas in themselves. Perl gets most of its power by combining good ideas from other langauges. Perl6 has been described as adding back the good ideas that Ruby added to Perl.

      "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.