sh and/or csh compilers?

Tom Christiansen tchrist at convex.COM
Sat Jun 22 16:00:50 AEST 1991


>From the keyboard of rodgers at maxwell.mmwb.ucsf.edu (R. P. C. Rodgers, M.D.):
:I keep hearing rumors of the existence of compilers for various UNIX
:shells, but have never come across one (or even an add for one).
:Does anyone know of any such beast, or (better yet) have direct
:experience with one?  How good are they, and do they significantly
:improve execution time?

I cannot imagine a shell compiler that did more than speed-up the
conditionals.  It might do some optimizations for `expr` or `basename`,
but these are special cases, and are seldom the major bottleneck in your
program.  To get real speedups usually requires an algorithmic shift.  You
have to pull what the various sub-processes are doing into your main
code.  Things that benefit most are repeated calls to things like head,
tail, bc, sed, awk, tr, sort, expand, etc.  Just saving the execs is a big
win, and you aren't going to get that with any shell compiler.  For that,
you need to translate your program into a richer programming language, 
like perl or C.

--tom
--
Tom Christiansen		tchrist at convex.com	convex!tchrist
		"So much mail, so little time."  



More information about the Comp.unix.wizards mailing list