Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Precompiled wordcode zsh functions



On Feb 25,  9:41am, Sven Wischnowsky wrote:
} Subject: Re: PATCH: parser (was: Re: PATCH: Improved _mailboxes)
}
} > Let's stick with autoload and have a file suffix convention, like
} > emacs' .el and .elc, or something. Heck, there could even be
} > separate fpath and compiled_fpath or ...
} 
} I was wondering what to do when the directory isn't writable... but a
} $COMPILED_FPATH containing one directory would be enough.

There need to be at least two directories, one for the users' personal
functions and one for the .../share/zsh/$ZSH_VERSION/functions/... set.
You can't expect everyone to keep their own compiled copies of the base
function library, surely?

} Hm. Do you want to say that you actually like the idea?

Me?  I don't really care one way or the other, except that I want to see
it done right if it's going to be done.

} [...] we would need to have a wordcode-verifier [...]

How does emacs assure the integrity of .elc files?  Or does it?

} That's yet another reason for having only a scalar containing
} only one directory name (so $COMPILED_FDIR might be a better name) --
} save compiled functions only if that is set and names an existing,
} writable directory. Users would set it to a directory in their account 
} so that others can't trick them into using evil code.

Zsh should probably already be more paranoid than it is about loading
modules or functions from widely-writable directories or files.  But
that has nothing to do with how many such directories or files are
involved.  Where does "save compiled functions" come in?  I'd think
we'd want an explicit "zcompile" builtin so functions can selectively
be compiled or not.  I don't want it just automatically writing out
wordcode for every function it ever loads.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author