in reply to Re: Re: Re: Re: Is there ever a time Perl is the wrong choice?
in thread Is there ever a time Perl is the wrong choice?

Sure, I do it all the time -- B::Deparse basicly does that. There'd be some issues getting it done, but it's certianly doable. It'd be rather difficult getting back to perl source out of the real C backend -- the one that converts your perl source into C code. Of course, that's highly expermental, to the point where I've never even heard of anybody thinking of using it.

As far as decompling Java, have you ever tried doing it? It's valid Java sourcecode, most of the time, but is far from easy to use. Perl's much more introspective, however, and the bytecode is closer to the language. Most importantly, you don't loose the names of variables, since they're still relevant at runtime in perl.

Dissesembling compiled executables is easy, but making heads or tails of the assembley is much harder -- you loose lots of high-level information that asm simply doesn't have the concept of.


Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

  • Comment on Re: Re: Re: Re: Re: Is there ever a time Perl is the wrong choice?

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Is there ever a time Perl is the wrong choice?
by IlyaM (Parson) on Feb 05, 2003 at 09:20 UTC
    As far as decompling Java, have you ever tried doing it? It's valid Java sourcecode, most of the time, but is far from easy to use. Perl's much more introspective, however, and the bytecode is closer to the language. Most importantly, you don't loose the names of variables, since they're still relevant at runtime in perl.

    I tried. There are exist a number of decomplilers for Java and most of them produce quite clear source code.

    --
    Ilya Martynov, ilya@iponweb.net
    CTO IPonWEB (UK) Ltd
    Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net
    Personal website - http://martynov.org