http://www.perlmonks.org?node_id=516580


in reply to What Perl CAN'T do?

Perl is a Turing complete language, so anything that is computable can be computed in Perl as well.

About the only thing that's problematic are the cases where you need to run native machine code, like boot loaders. But that's more due to the lack of a compiler - not so much the lack of certain language features.

Perl --((8:>*

Replies are listed 'Best First'.
Re^2: What Perl CAN'T do?
by Anonymous Monk on Dec 19, 2005 at 21:15 UTC
    Perl is a Turing complete language, so anything that is computable can be computed in Perl as well.

    If you are willing to wait an infinite amount of time, expend an infinite amount of memory, and restrict your I/O needs to nothing more complex than an infinitely erasable paper tape, then, yes, Perl can "compute anything". That's a rather limited view of "anything", in my opinion. :-)

    In the real world, we have real-time applications; Turing-completeness cannot speak to such requirements. Similarly, when trying to access memory mapped I/O, Perl has no native facility that I know of to write to specific memory locations; whereas other languages do. (Even BASIC has it's PEEK and POKE statements!) In Perl, we fall back to using C via XS instead; there is no native "POKE" statement, though unpack with pointers can be used to emulate a "PEEK".

    Unless I'm mistaken, this is something that native Perl can't do.

      I think you've missed the point of the original question, which was really about choice of language environment, i.e. how to choose between Perl, Java, C#, etc. I would argue that Perl is a stronger choice, as a language environment, than Java at least, because it is so easy to drop down to the metal (using XS) when the need arises.

      We're building the house of the future together.