On Sat, Dec 29, 2007 at 11:29:46AM +0200, Allison Randal wrote: > Patrick R.Michaud (via RT) wrote: > >* add some smarts to Parrot to allow it to search/execute .pbc files > > in some standard locations (RT#47992) > > We certainly need to allow configurable search paths (at runtime and > compile-time). And we certainly need to eliminate the requirement for > passing full relative paths for everything. > > There was an old proposal to do file-extension searches for all files, > but the problem was that any automatic selection of extension turned out > to be wrong about half-the-time.
Just a note/reminder that RT#47992 doesn't go as far as file-extension searches. What it really wants is to be able to place command-line .pbc files in a standard location (e.g., runtime/parrot/commands/ ) so that "parrot foo" automatically invokes runtime/parrot/commands/foo.pbc . > >* other...? > > Busybox has a nice feature where it checks the name you used to call it, > and presents different behavior based on that name. So, if 'ps' is a > symlink to 'busybox', when you call 'ps' on the command-line, Busybox > knows to process the options given as if it were the 'ps' command. > > <http://www.ibm.com/developerworks/linux/library/l-busybox/> > > Parrot can do something similar, checking the name used to call it. Works for me, although this sounds like an extension to the RT#47992 proposal. In other words, we have a standard location to place command-line .pbc files, and if parrot is invoked with a command name of "foo" it automatically locates foo.pbc in the standard location and executes that. > If 'perl6' is a symlink to 'parrot' and the user calls 'perl6 myscript.pl' > Parrot can simply act as if the --language=perl6 option was passed on > the command-line. I'm a bit reluctant to assume that the thing to be executed will be a --language. It could be a standalone application: $ parrot httpd # or just 'httpd' $ parrot calc # or just 'calc' > The goal is to have the 'parrot' part be invisible, so an embedded > system or install CD can present the illusion of running Python, PHP, > Perl 5, Perl 6, etc, but actually be running only Parrot. Absolutely. Pm