rurban has asked for the wisdom of the Perl Monks concerning the following question:

Saw this python generator http://bitbucket.org/ebo/pyfuzz/

Anyone heard about a perl generator?

It would need it to test the compiler and Jit. PPI and core would also be interested, I guess. Looks like an interesting project.

Replies are listed 'Best First'.
Re: Generate random working perl code?
by JavaFan (Canon) on Aug 30, 2010 at 09:32 UTC
    About 12 years ago or so, there was some interest on p5p to randomly generate Perl, or Perl-like code (both syntactically valid and invalid code) in order to stress test the compiler (IIRC, the main purpose was to locate cases where the compiler would crash). Generators based on Markov chains were written. (This was before PPI or any of the B:: modules). After some successes and time, interest waned.

    Potential danger that needs to be addressed: you don't want to compile randomly generated code that may execute any of it. So, you don't want any BEGIN/CHECK/UNITCHECK block, and no use statements.