> So, we check for the existence of a C<.plc> file before running a
> program; if the C<.plc> file is newer than the program, we use that
> instead. If there isn't a C<.plc> file or it's older than the program,
> recompile and dump the bytecode to a C<.plc> file. Naturally, this gives
> us the best speedup for modules which change very, very infrequently,
> rather than programs which can change a lot during development. Maybe
> you only want to do this for modules, then.

I suggested this a while ago, and the response was that automatically
writing files is a security risk.
You should extend your RFC to describe a caching directory or configuration.

Python optionally performed the disk-write - eg if the write failed, it went
on about it's business.  The closest that I could image to security would be
compiling to .pmc files at perl / module install time (by a privledged
user), and to disallow write-access to site_perl for anyone else.

The creation of a .plc is somewhat different (since there's no installation
process).  As a security risk, tainted code could write out a binary file to
replace the .plc file, and thus introduce a hidden virus that would be
almost indetectable.  Since the .plc file would be newer, it would never get
recompiled (until a code change).  Any sort of code analysis wouldn't reveal
the existence of a virus either.  The closest you could do would be to write
a .plc checker, which regenerates the .plc and compares it to files.

Other issues are simply disk-space considerations.  .plc might be large, and
dozens or hundreds of scripts would consume a great amount of disk space.
Then you have to worry about compatibility.  Copying  .pl* files from
computer to computer _might_ cause problems if not implemented correctly
(namely that a perl and module version is associated with each .p[lm]c
file).

In general, I'm for the idea, but I figured I'd pass on the obsticles I
encountered.

To further your RFC, I'd suggest working out a configuration for a .*c cache
directory, which could put upper limits on disk-space usage for compiled
files.  Again, this is more of a consideration for .pl files which could
live just about anywhere on the system.

I'd suggest things like cached modules candidates require a non-zero value
of VERSION.

That's all I can think of at the moment.

-Michael


Reply via email to