Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Perl and Linguistics

by Cody Pendant (Prior)
on Jul 04, 2008 at 00:02 UTC ( #695496=perlquestion: print w/ replies, xml ) Need Help??
Cody Pendant has asked for the wisdom of the Perl Monks concerning the following question:

Can anyone recommend me links or other information sources about Perl as language, in the broader context of languages other than just computer languages?

Larry's piece on Natural Language Principles in Perl would be an example of course.

Perl, for instance, has pronouns: $_ is essentially "it". That kind of thing.

TIA



Nobody says perl looks like line-noise any more
kids today don't know what line-noise IS ...

Comment on Perl and Linguistics
Download Code
Re: Perl and Linguistics
by Anonymous Monk on Jul 04, 2008 at 05:17 UTC
      Thanks, that's exactly the kind of thing.


      Nobody says perl looks like line-noise any more
      kids today don't know what line-noise IS ...
Re: Perl and Linguistics
by w-ber (Hermit) on Jul 04, 2008 at 08:23 UTC

    ... What the heck is a "computer language"? I first saw the expression in Wikipedia, and since then it has been uttered -- so it seems -- predominantly by North American programmers. Yes, Larry Wall uses it.

    Supposedly "computer language" encompasses all notations "used with computers", such as markup (HTML, XML), programming languages, and sometimes even configuration file syntax. It makes little sense to me, even less than the concept of programming language. It's not a language, folks. It's a notation.

    Some might argue that notations are languages and languages are notations, pointing out that it was 1930s mathematicians who started calling particular mathematical constructs languages and that we're only extending the metaphore, as programming languages are already languages, and...

    My beef is that by calling various unrelated notations "computer languages", you further smudge the fine line between machines and people. It used to be pretty straightforward. A loom is a loom -- you don't "communicate" with it when you work it. Once you have "computer languages", it's a small step to think of a computer and programming in anthropomorphic terms. As well as being detrimental, it's silly and harmful.

    A computer is not a living being. It has no consciousness, you cannot talk with it, and it doesn't have a will. It's brilliantly constructed machinery, but still a machine. As well as elevating this machine to the status of a human, the phrase "computer language" makes us more similar to the machines. That in turn perpetuates thinking about people as a resource to be exploited, and generates inaccurate analogies such as your memory being "like a harddisk".

    Coming back to Perl 5, yes, some features were inspired by natural language constructs, such as $_. It doesn't make it a natural language in any way.

    --
    print "Just Another Perl Adept\n";

      But its a cutting edge technology system of systems technology.
      My beef is that by calling various unrelated notations "computer languages", you further smudge the fine line between machines and people.
      I have been a member, for the past 35 years, of the professional computer science organization ACM -- the Association for Computing Machinery. Not Machinists, Machinery.

      Welcome to an old and noble profession. 8-)

      A computer is not a living being. It has no consciousness, you cannot talk with it, and it doesn't have a will.
      You haven't been programming very long, have you? I've known many a willful computer...

        A computer is not a living being. It has no consciousness, you cannot talk with it, and it doesn't have a will.

        You would think that they had a mind of their own the trouble I have with mine!

      My beef is that by calling various unrelated notations "computer languages", you further smudge the fine line between machines and people. It used to be pretty straightforward. A loom is a loom -- you don't "communicate" with it when you work it. Once you have "computer languages", it's a small step to think of a computer and programming in anthropomorphic terms. As well as being detrimental, it's silly and harmful.

      You don't instruct a loom how to do any thing, you just use it; that's a bad analogy because you do have to give instructions to a computer. Those instructions are written in a synthetic language that humans can read and write; humans not computers. Computers don't understand "computer languages", they are just translate them into a machine code that they do understand.

      A computer is not a living being. It has no consciousness, you cannot talk with it, and it doesn't have a will. It's brilliantly constructed machinery, but still a machine. As well as elevating this machine to the status of a human, the phrase "computer language" makes us more similar to the machines. That in turn perpetuates thinking about people as a resource to be exploited, and generates inaccurate analogies such as your memory being "like a harddisk".

      You haven't been programming long, have you? I talk to computers all the time and I know that I am not the only one who does it! Sometimes they respond and sometimes they don't. "Come on you crummy thing, work!" ;)

      Coming back to Perl 5, yes, some features were inspired by natural language constructs, such as $_. It doesn't make it a natural language in any way.

      I do not think that anyone has ever called Perl a natural language but it is more than just another synthetic language because it was inspired by natural language. Well written Perl when spoken just rolls off the tongue like a song. :D

        Those instructions are written in a synthetic language that humans can read and write; humans not computers. Computers don't understand "computer languages", they are just translate them into a machine code that they do understand.

        It's debatable whether the primary purpose of "computer languages" is to communicate with the computer. You often use them to communicate with other people who are trying to communicate with the computer.

        If you look at all the many and various arguments about the virtues of this or that computer "language", very few of them revolve around whether the compiler will be able to understand what you're saying.

      That in turn perpetuates thinking about people as a resource to be exploited, and generates inaccurate analogies such as your memory being "like a harddisk".

      That's hardly a new concept. After all, slavery predates computing machines by a few millenia.

      It makes little sense to me, even less than the concept of programming language. It's not a language, folks. It's a notation.
      It's useful to think of programming or computer languages as languages, not notations, and it's probably especially useful to people who design them. Not doing so leads to APL.

      A computer is not a living being. It has no consciousness, you cannot talk with it…

      Of course I can; with the correct software and hardware it will even understand what I'm saying. I don't expect an intelligent dialogue, but I don't necessarily expect a response (or at least a rational response) when I talk with a person, either.


      Information about American English usage here and here. Floating point issues? Please read this before posting. — emc

      I don't know about you, but I for one have used Perl as a language to communicate with other human beings, not a computer. Be it simple snippets in emails (s/indead/indeed/ , "onething" != "otherthing"), perlmonk nodes or Perl Poetry, all of these are written in Perl for the pure intention of communicating with other people, because I found it funnier, more concise or even just possible to express things in this language than in another. Also, don't forget that languages can take many forms and while it may be harder to express certain things in one language than another, that will not make the language in question less valid.

      So "computer languages" are nothing else than languages which can be understood by humans and also be interpreted by a computer. Yes, they're constructed languages rather than natural ones, but so are Esperanto and Sindarin. You won't deny those are languages either, will you?.

      As for your point about the term "computer languages" making us more willing to exploit other people, bah, total humbug. Look to the economists, not the computer scientists for that one.


      All dogma is stupid.
      A notation only involves syntax. A language involves syntax and a shared set of semantics. The language is for humans to communicate with humans in a way that's brief and specific enough that instructions can be reduced to a recipe for the computer.

      Higher-level languages don't communicate anything to a computer at all, after all. That's why we need interpretation or compilation.

      In the English language, we have a habit of reusing words for similar things or sometimes for almost entirely dissimilar things. A bicycle seat in the US is also known as a "saddle", although there's no animal under it. A car's engine cover in the US is a "hood" and in the UK a "bonnet", although there's no head under it (except that there's a part of the engine called a "head" in a reciprocating piston engine -- in US English, anyway). A group of electrical storage cells grouped together is a "battery" just like a group of cannon which fire together. A CRT or LCD display is called a "monitor", even when used interactively. A "speaker" is used to emit sound even for music or random noise. Given all of these examples (there are many more) it's not surprising that something which people can read, write, and sometimes speak to get a particular, shared idea across is called a "language", even if it doesn't fit a narrow definition otherwise.

Re: Perl and Linguistics
by Withigo (Friar) on Jul 05, 2008 at 09:28 UTC
    I haven't seen any links other than the one you gave, and in other programming language camps I haven't seen the connection to linguistics comes up at all in discussions. It's just not on anyone's radar(sure there are theoreticians thinking about it, but not your average business developer). I like to think the linguistic aspect is a novel feature of Perl and damned clever of Larry to pin point.

    The entire field of computational linguistics is in its infancy and we just don't currently posses the technology to formulate the deep questions about how exactly the brain functions with respect to language. CS is in its infancy too, so there's going to be a long wait until these two fields can build a bridge and connect in a deep way. Hopefully future language creators will steal the linguistic idea from Perl and contribute to experimentation in the field.

    And there are a few really interesting ideas which I hope will be on that bridge, such as:
    1) the validity of the Sapir-Whorf hypothesis and its application to programming languages. It's true that perl hackers see the world a certain way due to their language, as do lispniks, rubyists, etc (and we all know those in the java camp see a medieval world, I kid!)

    2) Can we reach the point where we can create "deep AI" and what will the language involved be? (Don't say Lisp!)

    And if you end up with any particularly good links, please post them here so others can find them and read them.

    Good luck!

      I like to think the linguistic aspect is a novel feature of Perl and damned clever of Larry to pin point.

      Then I submit that you miss the whole idea about Perl

      Perl was designed as a programming language that is constructed as a spoken language.
      Everything about it, TIMTOWDI, DWIM, different features, design ideas, all the in-language features, etc. are derived from this idea, not the other way. All the verbosity, non-orthogonality, the sigils, the context-interpretation of variables, you name it. It's all ideas that come from spoken language, and implemented in Perl.

      Only that unlike COBOL, or VB, or the likes, it doesn't use English-like keywords thinking it will make the language "easier to read", but use concepts that are used in spoken language. This way, when you speak fluent Perl, you can express yourself better, and not just "do more".

      Stop saying 'script'. Stop saying 'line-noise'.
      We have nothing to lose but our metaphors.

        Only that unlike COBOL, or VB, or the likes, it doesn't use English-like keywords thinking it will make the language "easier to read", but use concepts that are used in spoken language. This way, when you speak fluent Perl, you can express yourself better, and not just "do more".

        I wish I'd said that.

        No. Ireally mean it! I really wish that I had had the language skills or insight to have constructed those two sentences.

        It bugs me intensely when I see the posts around here that condemn, eschew, and deprecate the power of Perl's notation in favour of some hamstrung subset of lowest denominator commonality or CS-theoretically correct formality.

        For all the hype about CPAN, this is Perl's strength. So much of CPAN wastes space, time and cycles re-implementing Perl's built-in power, to 'correct' its non-orthogonality, or to 'make it OO-compliant'. And in the process, completely miss the reasons that make Perl uniquely powerful for expressing solutions to complex problems in productively concise and intuatively simple terms.

        Java and its libraries are extremely complete and powerful. Java's problem is that it takes so long to express the high level concepts that denote the algorithm you are trying to code, that you loose your way in all the low-level detail that it forces you to state explicitely and verbosely

        The beauty of Perl is that it allows you to say: "He'll process all the data", not "My assistant, John, 34, from Popocatepetl, married with 3 children, will go through all the data, starting from record one, and working his (John's) way through sequentially, record by record, until he has processed all the records!".


        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".
        In the absence of evidence, opinion is indistinguishable from prejudice.
        Saying I miss the whole idea about Perl is a rather strong thing to say. I didn't say the linguistic design was a happy accident after Perl was designed--what I did mean to say is that it was clever of Larry to start with the linguistic approach and derive the language from that. Which is basically what you said, so we agree. :)

        Although, however nice these linguistic features can be in the small, I do think the linguistic approach ultimately breaks down since natural languages cannot be represented by a Turing machine. What we can represent on hardware as being computable is an infinitesimal subset of what we can represent in our minds with non-context-free(and context-sensitive) grammars, so I would argue that the real benefits and optimizations of the linguistic approach cannot even be realized in a programming language. (That is until some genius invents a non-recursive hyptercomputer.) And please don't take this as a hard opinion--I do recognize it's a fuzzy field in which I have no expertise, just interest.
Re: Perl and Linguistics
by telemachus (Friar) on Jul 05, 2008 at 12:54 UTC
    This question reminded me of something, and after a few days of not remembering what, I've got it. Graham Nelson, a mathematician, designed a small-ish language for writing games with a mind towards "natural language" principles, and he was nice enough to write an article analyzing the language in those terms.

    It's not directly about Perl - I don't think Perl is even mentioned - but the idea is on target and the bibliography might help you.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://695496]
Approved by pc88mxer
Front-paged by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2014-07-29 03:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls