Re: Supercompiled Perl
[email protected] ("Andrei P. Nemytykh")
| Newsgroups | perl.ai |
|---|---|
| Message-ID | <[email protected]> |
Helmut Enck-Radana wrote:
> Not caching results, but specialized versions of the original program.
> Consider following simple example: A command line tool takes 2 arguments
> and produces some output dependent on them. In 50% of all invocations the
> 2nd argument is the same. The supercompiler can transform the program to a
> specialized one, which has only 1 argument. The 2nd argument has become a
> constant within the program. The new program is as efficient as if it had
> been designed from scratch for being dependent on only 1 argument. AFAIU
> this is possible, because the semantics of the whole program is analyzed, a
> model is created, and a complete new program with the same semantics is
> generated.
[ ... ]
>"Andrei P. Nemytykh" wrote:
> I remember an idea ( by Sergei Romanenko ). He suggests
> to use supercompiler together with a meta-program. The meta-program
> has to be a part of a concrete operating system. It is a dispatcher
> of supercompilation.
> The program has to observe the behavior of users:
> - how often a concrete Perl-program is used ?
> - maybe, some arguments of a program have a constant intrivial
> properties, so its specialized version makes sense ?
> - maybe, something else ...
>
> If the meta-program decides to transform a Perl-program, then it does
> that and creates a new residual version. After that any call to
> the original Perl-program ( within the chosen context ) is replaced
> with the residual version automatically.
> [...]
This idea solves a number of problems of supercompilation.
For example,
-1- Why are we in need to supercompile a program ?
-2- Supercompilation can take much time to do deep transformations,
because of users do not wait of ending the process at all.
-3- What is more, a supercompiler can try different strategies of
the transformations to choose the best one.
Sincerely,
Andrei Nemytykh.