Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!world!iecc!compilers-sender From: henry@zoo.toronto.edu (Henry Spencer) Newsgroups: comp.compilers Subject: Re: Bourne shell script compiler? Keywords: interpreter Message-ID: <1991Feb23.233842.1843@zoo.toronto.edu> Date: 23 Feb 91 23:38:42 GMT References: <791@wsc-sun.BOEING.COM> Sender: compilers-sender@iecc.cambridge.ma.us Reply-To: henry@zoo.toronto.edu (Henry Spencer) Organization: U of Toronto Zoology Lines: 17 Approved: compilers@iecc.cambridge.ma.us In article <791@wsc-sun.BOEING.COM> cek@wsc-sun.boeing.com (Conrad Kimball) writes: >I'm looking for a Bourne shell script compiler - that is, a compiler that >accepts a Bourne shell (sh) script as input and produces C code as output. Based on some experience with a pre-Bourne (!) shell compiler, long ago, the benefits of such a thing are limited unless it incorporates extensive knowledge of the more common programs invoked from shell scripts. Running a shell script comprises parsing, interpretation (variables etc.), and execution (fork/exec) of programs. A simpleminded shell compiler eliminates the parsing and streamlines much of the interpretation, but it's the execution that is usually the bottleneck. You won't see a big win unless the compiler is smart enough to optimize out some of the execution. -- Henry Spencer @ U of Toronto Zoology, henry@zoo.toronto.edu utzoo!henry -- Send compilers articles to compilers@iecc.cambridge.ma.us or {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request. Brought to you by Super Global Mega Corp .com