Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: What Perl CAN'T do?

by tirwhan (Abbot)
on Dec 14, 2005 at 09:09 UTC ( [id://516560]=note: print w/replies, xml ) Need Help??


in reply to What Perl CAN'T do?

perl cannot be written in Perl (this statement will automatically self-destruct when Perl6 comes out. Your mission, should you choose to accept it, is to assist in bringing about this event as soon as possible.)

See this thread for more answers to your question.


Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan

Replies are listed 'Best First'.
Re^2: What Perl CAN'T do?
by Perl Mouse (Chaplain) on Dec 14, 2005 at 10:55 UTC
    perl cannot be written in Perl
    If your statement is true, Perl is a less powerful language than say, BASIC or Cobol. See, perl is written in C, a Turing complete language. BASIC, Cobol, and almost any serious language (with the exception of some very domain specific languages) is Turing complete, which means that anything that can be done in one language, can be done in the other.

    perl is written in C. Hence, perl can be written in BASIC and Cobol.

    Luckely, your statement is false. Perl is a Turing complete language, and hence, perl can be written in Perl.

    Perl --((8:>*

      The OP's question does not make much sense when viewing it from a theoretical point of view (as anyone who understands Turing completeness knows and your post explains). I can as much write perl in Perl as I can carve my name onto the face of the moon with a toothpick or tattoo "I blow goats" onto the forehead of my least-favourite head of state. Both of these things would be possible if I dedicated my life to them and managed to obtain the support of a large enough community of people. I would however consider them to be practical impossibilities. Rewriting perl in Perl has pretty much the same prerequisites and is just as impossible. Do feel free to prove me wrong though :-)


      Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan
        I shall prove you wrong then. To write perl in Perl all that you need to do is write a C interpreter in Perl. But since there are plenty of working C compilers, all that you really need to do is emulate what a C compiler compiles to. Thus you need to write a virtual machine that implements the assembly language of any chip that will run Perl. Which seems to me like a doable, if useless, project. :-)
        Well, the OP has acknowledged that. He states in his posting that he knows there are a lot of things you shouldn't do in Perl. But he's interested in what you are not able to do in Perl.

        If you are answering a different question than is stated, please indicate so in your answer. I wouldn't have replied at all if you had done so.

        Perl --((8:>*
      That is an interesting point there Perl Mouse...I honestly had no idea that perl can be written in perl. Funny thing is I was pondering that fact just the other day. Thanks for the statement. This being said, what other languages besides C and Perl are able to be written with their own syntax?

      "Es gibt mehr zu Leben als Bücher, kennen Sie. Aber nicht viel mehr " -(Der Smiths)
Re^2: What Perl CAN'T do?
by grinder (Bishop) on Dec 14, 2005 at 13:35 UTC
    perl cannot be written in Perl

    Yes it can. There is nothing from stopping you writing a bootstrap parser and eventually creating a self-compiling Perl parser+runtime written in Perl. But, and this is the 2**16 dollar question.... why would you want to do a thing like that?

    (For those following along at home who can make no sense of this dialog, the language is Perl, and the interpreter that interprets said language is perl).

    One thing I do know... Perl should not be used when speed is of the essence. I'm currently stress testing Regexp::Assemble. I started the run last Friday afternoon on a hexaprocessor box. The run has performed about 147 million combinations as of right now (more than 4.6 billion unit tests), a grand 7% of the problem space...

    On the plus side, the run hasn't turned up any bugs.

    • another intruder with the mooring in the heart of the Perl

      There is nothing from stopping you...

      Here are a few things that would hold me back:

      1. It would be hard to find others who also want to work on such a project (cause, as you say, 'why?')
      2. With a minuscule team of programmers my development speed will likely be slower than that of the mainstream C perl, therefore I'm writing towards a target that's moving further away all the time.
      3. Even if I try to write towards a fixed and existing version of perl5 I'll likely not be finished in my lifetime (and if I do nothing but hack on Perlperl all day my lifetime will be even more finite that it is anyway)

      You're right, there's nothing in the design of Perl that makes this task impossible in theory, but I'd be willing to bet all the money I own that it is impossible in practice. (Note to prospective punters: it's not very much money :-)


      Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan

      Thats an interesting comment. Why are you running 4.6 billion unit tests? What behaviour are you testing that requires so many tests? (Note that you are doing about 4.6 billion more tests than perl itself does when testing the regex engine during a build.)

      ---
      $world=~s/war/peace/g

Re^2: What Perl CAN'T do?
by itub (Priest) on Dec 15, 2005 at 01:34 UTC
    It depends. Are you allowed to use eval? ;-)
Re^2: What Perl CAN'T do?
by Courage (Parson) on Dec 14, 2005 at 17:06 UTC
    Python could be written on python, but perl can not be written in perl?

    I disagree - those are languages with approximately same capabilities and general ideas.

    However, your following discussion makes me agree with you on other points, so ++ to you.

    Best regards,
    Courage, the Cowardly Dog

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://516560]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (9)
As of 2024-04-19 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found