[ Apologies if you see this twice, the yale mailer gave me a horrible
  error message the first time  --Jeff ]

> runhugs does not accept any command line arguments (version 970410).
> While many Hugs options do not make sense with runhugs, some do. 
> I am especially missing `-Ppath' for setting the search path. A
> standalone Haskell program executed by runhugs may consist of several
> modules which runhugs needs to find. If you use the Unix sticky bit, it
> does not even help to put all imported modules in the same directory as
> the Main module, since during the excution of a program with sticky bit
> the current working directory is not the directory of the Main module.
> Currently I write a little shell script which sets the environment
> variable HUGSFLAGS (which is taken into account by runhugs) for every
> standalone Haskell program.
> Also the `set heap size option' could probably be useful for runhugs.

The `-Ppath' example is a nice one.  I had proposed on the bugs list
that runhugs accept command-line arguments for hugs up to the name
of the script being run.  This would allow
    runhugs -P/blah/blah myscript arg1 arg2
where -P/blah/blah would be passed to hugs, and `arg1 arg2' would be
left for `myscript' to process.  This integrates nicely with the
scripting convention in unix, so if `myscript' starts with the line
    #! /usr/bin/runhugs -P/blah/blah
(and I make `myscript' executable), I can invoke it as
    myscript arg1 arg2

Another question is do we want to provide a way for the *user* of
`myscript' to supply command-line arguments to hugs?  Here, the
example of `set heap size' seems a more likely option.  Alastair
mentioned that ghc has some convention for this (something along
the lines of intercepting arguments that start with -H).  Then the
user could do:
    myscript -Hset-heap=1024 arg1 arg2

--Jeff

Reply via email to