Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

An Unreal Perl Hacker!

by samizdat (Vicar)
on Oct 13, 2005 at 13:10 UTC ( [id://499892]=monkdiscuss: print w/replies, xml ) Need Help??

Hmmm... maybe I'm not the first (!) to suggest this, but I was inspired by Re: I visit PM primarily to... by McDarren to think about it.

I'd love to see an AI 'bot that would roam PM looking to learn how to code in Perl. Written in Perl, that would be a project we could all learn from, and perhaps participate in. There _is_ a fantastic repository of Perl code and programming strategy here, and it would be an awesome project to see if we could make something that would build a consistent knowledge base from that repository.

Replies are listed 'Best First'.
Re: An Unreal Perl Hacker!
by eric256 (Parson) on Oct 13, 2005 at 15:14 UTC

    It isn't in a programmers best interest to make a program than can learn to program. ;) It would be like a carpenter teaching trees how to grow into buildings on their own. Then why would you need a carpenter? Okay it isn't realy like that, or is it? ;) Either way you could start with a markov chain bot that just learns how to reply and sound like everyone else, but please don't have it actualy reply!

    Update: fixed spelling


    ___________
    Eric Hodges
      Beg to disagree, eric256. Just as programmers need to learn to be businessmen/women, rather than just getting crunched, programmers also need to learn to become meta-programmers. I was just (rightly) chasened in another thread for dissing programmers who poke around in Perl interpreter code looking for neat stuff, because those are the guys who build the modules I use in doing my job. If we don't build the tools, and, now, the self-improving tools, somebody else will.

      There are a bunch of damn good programmers over in Bulgaria who have released the most diabolical un-killable viruses I have ever seen, and sooner or later one of them is going to tackle such an idea. Either way, simple programming is going to become more automated, and a tool such as I am describing is not that far away.

      Just as SoC designers now use automated tools to design megagate chips, we now use templating systems like Embperl which are smart enough to automatically build tables for us. Perl is a tough nut even to do what I suggest for, because it isn't an easily parsable language. That doesn't mean that we can't build something extremely useful, just that we have to be canny and crafty... and awfully damn good.
Re: An Unreal Perl Hacker!
by ambrus (Abbot) on Oct 13, 2005 at 15:51 UTC
      Isn't it amazing what people will come up with after an economic downturn? I'll definitely give it a read.
Re: An Unreal Perl Hacker!
by pajout (Curate) on Oct 13, 2005 at 14:12 UTC
    Well, nice idea.
    But, could anyone give me strict definition of AI? Is it something more than Turing machine? Imho, I am very skeptic...

      Having dabbled a fair bit in AI, I have to say that no, no one will be able to give you a strict definition. Some claim that AI is the art of convincing a computer to do something that it's not normally inclined to do (if you'll ignore the anthromorphizing there). Others claim that if a computer can do it, it ain't AI. Regardless of the definition someone comes up with, some other AI expert will come along and argue it. The other expert might even pass a Turing test.

      Cheers,
      Ovid

      New address of my CGI Course.

        In the olden days, it was claimed that if a computer could play chess, it would be considered "intelligent". Of course, this ability is no longer considered AI. One problem in AI has been the "moving goalpost". When computers learn do to something once considered "intelligent", the criteria are changed.

        But why worry about the definition? Whether the proposed idea is true AI or just clever programming, it would be a remarkable accomplishment. I like the idea of reaching way beyond our abilities. We might never attain that goal, but we'd certainly learn things - and that's worth it, to me.

      Well, something more than Eliza/Doctor, but something less than ST/TNG Data. :)

      I see it as a big challenge, yes. Just parsing the code fragments, let alone the English, would be daunting.

      Okay, here's a limited subset that I think might be do-able.
      1. Ignore anything outside of <c> </c> or <code> </code> tags
      2. ignore anything that uses modules
      3. ignore anything that writes the filesystem
      4. ignore anything that uses filehandles other than STD*
      5. eval perl code
      6. ponder error message and/or output
      7. look through k-base for similar code structures and error messages
      8. suggest a list of nodes with code similar to the code near the failure that might work
      Eventually, I'd like it to do more, and to be allowed to post its own responses to real nodes, but that would be a long way away. This limited subset would allow us to experiment with parsing, pattern recognition, and k-base building, and I believe it could be made to have real utility, at least for the newbie errors.

      UPDATE: added exclusions #3 and #4

        I hate to be a nay sayer, but if you follow exclusions 2, 3 and 4 you likely cut out about 75% of the material posted. Many of the best contributions are best exactly because they do use a module to get work done.

        Likely the best code discoverd by such a system will be the system's own code! Bet modules are used to write it though.

        In any case, best of luck with it. It's a neat idea, but I suspect pretty tricky to realise.


        Perl is Huffman encoded by design.
        Regarding #6
        6. ponder error message and/or output

        how would the ai (or perl program) even know if the output is what the user wanted or required.

        More than half the time, my problems stem from an incorrect algorithm, or misunderstanding of the intracies of Perl. However, my output usually looks quite agreeable, without any hint of malice.

        Sandy

        Thanks, I am more enlightened :0). But I cannot imagine the typical (and ideal) case of use. Can you, please, describe user's goal, user's input, what happens in the guts, and output?
Re: An Unreal Perl Hacker!
by artist (Parson) on Oct 13, 2005 at 16:46 UTC
    Let's build a formal schema.
    --Artist
      Whew, artist, it'll be a while before I would be ready for that. Let's kick it around a bit.

      As I see it, to accomplish my first-level goals (Re^2: An Unreal Perl Hacker!), at least of making suggestions that would make the newbie's code run, we'd have to build a database of code from nodes which would include the poster, the XP rating, the node id, an output or error string, and the code itself. When somebody submits a node for consideration, the engine would go to that node and fetch its code samples. If the code does not fail the exclusion criteria, the engine would attempt to run the code in an eval block. This would result in either some success or a failure and an error message.

      The engine's next step would be to fetch a list of other nodes with the same error message. It would then build a structural model of the code surrounding the error location and compare that to other nodes with errors until it found one that had a similar structure.

      Once it had a list of nodes with similar errors and structures, it would then seek out follow-on nodes in the same thread, and attempt to modify the problematic code by mapping the Perl structure changes into the newbie's code.

      Note that I'm not saying that we can assess the _proper_ functioning of the code, only whether it is sane perl code. I can see enhancing the engine after this works to allow newbie to insert preferred output into the request form.

      This is a non-trivial challenge, I know, but I think it would be useful, both by itself and as a basis for an expanded problem domain and requirement set.
        That could make another kind of PM Search tool, don't you think?

        Imagine presenting several options of correcting the newbie's code. By choosing one of them, she could read more about that code.

        Next step, could be to know how to put names asociated to those alternatives. And classifying them by those names. That might help the search of such words when asked.

Re: An Unreal Perl Hacker!
by krujos (Curate) on Oct 21, 2005 at 06:20 UTC
    Heck no techno. What if it became self aware. We could have our own skynet on our hands.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-25 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found