Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
First of all, it shouldn't matter what my gender is. It is no secret, if you browse my nodes long enough you can find a fuller name than just tilly, and then it should be dead obvious what my gender is. But if you wanted to know, I would strongly prefer that you asked me directly rather than posting the question to the winds.

As for the actual question, well there are a lot of things called "AI". For some of them Perl is a good fit. For others it is not. When Perl is a fit, it is a fit for the same reason that it is good for other things. You can do complex stuff easily, you have a lot of high-level constructs, you have useful stuff on CPAN. I am sure everyone here can find other things to put on the list of good things about Perl.

But Perl also has the following well-known disadvantages:

  1. Excessive memory use. If your program winds up working with and correlating a lot of data, Perl may fall over before you expect it.
  2. Poor performance. Many tasks that we call AI involve a lot of computation, backtracking, etc. Perl is good for a scripting language, but is is no speed demon. You do not, for instance, find good ray-tracers or chess programs written in Perl, for good reason.
  3. No true garbage collection. People argue back and forth whether or not it is better in general to have reference counting or true garbage collecting. But there is no question that if you want to manage recursive data structures with self-references, then it is much more convenient to have true garbage collection. The WeakRef module helps, but not enough if you are doing something complex.
Now when you came by in chatter, your problem was that you were running out of RAM on your cluster of rather nice machines. Now after discussion, some of that didn't seem to really be Perl's fault. A lot of it appeared to be the recopying of data inside of Parse::RecDescent. (I have heard multiple times now that TheDamian is working on a replacement that uses pos manipulation rather than recopying. That likely would solve your problem.)

But still when you are bottlenecking on known issues in the language, that should make you wonder at the suitability of the tool. So in this instance you would try to get the memory usage down and performance up. If you cannot get them within acceptable parameters, switching to Lisp, Dylan, Haskell, or OCaml would be perfectly reasonable.

But if it works for you, then it works for you.

In reply to Re (tilly) 1: How good is Perl for AI? by tilly
in thread How good is Perl for AI? by PetaMem

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (5)
    As of 2018-06-23 11:07 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (125 votes). Check out past polls.