[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Jul 7 21:35:39 2003 
Subject:Poplog for scripting? 
From:Waldek Hebisch 
Volume-ID:1030707.02 

I was considering using Poplog for (Linux) scripting. I immediatly 
meet few obstacles:

1) Script interpreter must be a binary. As distributed Poplog
   depends on shell scripts to set up environment variables

2) Command-line handling: script should be able to take
   arguments on command line without risk of Poplog treating
   them in some magic way (deadly for suid scripts).

3) Ignoring the first line (#!...) used to invoke Poplog

4) Startup time: tiny scripts are expected to execute quickly
   but on 650 MHz Duron Popog take 100ms to start

5) Regexp support.

I see to packages in GOSPL going in this direction, namely `popsh'
and `usr-bin-poplog'. However `popsh' only solves problem 3 above. 
`usr-bin-poplog' solves problem 1 at the cost of adding wrapper
binary which would increase startup time and help nothing to 
problem 2. 

It seems that Poplog captures enviroment variables quite early 
during its startup. So it should be easy to have default values
of enviroment variables in the Poplog binary. For runtime 
customisation getting data from a pop11 init file seems more 
natural then going trough shell script -- I wonder why the original
design used so much indirection. 

To solve problem with possibly mangled command line I would like
a special option that would stop further interpretation of 
command line arguments by Poplog -- how hard would that be?

I have tried to run directly Poplog binary. When I enabled `mmap' 
support startup time went down to 8 ms even with saved image 
containing pop11+clisp+prolog+pml (and the process size is much 
smaller then in distributed version). Why is `mmap' not enabled
by default on Linux? 

Concering regular expressions: included regexp package seem to
implement very limited subset of regular expressions. Are there
more powerful regular expressions available? (I know that Prolog
DCG-s are more powerful, but they clumsier to use).

By the way, experimentig with Poplog I few times got non-working
installation and I had to restore it from tarball. Now, I know how
to link Poplog in an alternate directory. However it would be 
better to be able to compile in non-system directory and currently
I got problems with include files. Even better would be to put 
object files in different directory then sources, but that makes
problem with includes even worse. How `popc' searches for 
inclede files?

--
                              Waldek Hebisch
hebisch@math.uni.wroc.pl    or hebisch@hera.math.uni.wroc.pl