home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!rutgers!faatcrl!iecc!compilers-sender
- From: scott@bbx.basis.com (Scott Amspoker)
- Newsgroups: comp.compilers
- Subject: Re: Why is compiled basic slower than C? (Basic is the future)
- Keywords: Basic, performance
- Message-ID: <92-08-064@comp.compilers>
- Date: 13 Aug 92 15:41:07 GMT
- References: <92-08-042@comp.compilers> <92-08-049@comp.compilers>
- Sender: compilers-sender@iecc.cambridge.ma.us
- Reply-To: scott@bbx.basis.com (Scott Amspoker)
- Organization: BASIS International, Ltd., Albuquerque NM USA
- Lines: 46
- Approved: compilers@iecc.cambridge.ma.us
-
- jch@rdg.dec.com (John Haxby) writes:
- >Glenn_Johansson@f313.n203.z2.fidonet.cd.chalmers.se writes:
- >|> [How much slower is compiled Basic than C, and why?]
- >
- >There has been a lot of work put into optimizing C compilers: the efforts
- >of FSF, Sun and MIPSCO to mention but three. There hasn't been a great
- >deal of work put into optimizing BASIC compilers, at least not that I know
- >of.
- >
- >There seems to be a more general problem though: compilers of high-level
- >languages tends to produce optimal machine code, whereas compilers of
- >low-level languages tend to produce sub-optimal machine code.
-
- We market a business-oriented BASIC-style language called BBx. It is
- interpreted. Although it is quite different from Microsoft BASIC there
- are still common qualities of any BASIC dialect.
-
- A few years ago there was some discussion about producing a compiler for
- it. We found several reasons why a compiler would not be a great idea.
- The main reason is that the runtime dynamics of BASIC don't translate well
- to a compiled environment. The most important aspects are dynamic
- string/array management and dynamic flow control involving error/exception
- handling. The latter is especially hard to optimize.
-
- A C programmer tends to approach these things with a more "static" frame
- of mind resorting to a dynamic model only if it is really necessary (and
- knowing there will be a performance hit). Furthermore, BASIC normally
- performs lots of runtime checks such as array subscripts and ranges.
- Granted, a BASIC compiler could allow the option of turning these checks
- off but I'm assuming a proper semantical translation.
-
- Since our product is used primarily for business data processing
- applications which spend most of their time performing file and user i/o,
- the need for a compiler isn't as critical. Indeed we have been known to
- beat some compiled languages in file-oriented benchmarks.
-
- I just don't think interpreted languages compile well. If they do then
- they really aren't exploiting the special strengths of interpretation.
- You end up with the worst of both worlds.
- --
- Scott Amspoker
- Basis International, Albuquerque, NM
- scott@bbx.basis.com
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-