home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.compilers
- Path: sparky!uunet!think.com!spdcc!iecc!compilers-sender
- From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
- Subject: Re: Why is compiled basic slower than C? (Basic is the future)
- Reply-To: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
- Organization: Computer Science, University of Melbourne, Australia
- Date: Tue, 18 Aug 1992 10:27:34 GMT
- Approved: compilers@iecc.cambridge.ma.us
- Message-ID: <92-08-100@comp.compilers>
- References: <92-08-042@comp.compilers> <92-08-095@comp.compilers>
- Keywords: interpreter, performance
- Sender: compilers-sender@iecc.cambridge.ma.us
- Lines: 39
-
- >... languages you
- >might call `interpreted', like Lisp, Prolog, ML, and Snobol, in fact have
- >very good compilers, which make major differences in runtime.
-
- Compiled Prolog is almost invariably a slightly different language from
- the original interpreted Prolog. The reason for this is the following:
-
- >burley@geech.gnu.ai.mit.edu (Craig Burley) writes:
- > ...There is another major issue regarding interpretation which puts
- > both BASIC and C in the "compiled" camp: whether the running
- > program has a means to modify itself at run time. LISP, for
- > example, belongs in the "interpreted" camp.
- >
- >This is not really a problem. The amount of Lisp code which actually
- >modifies the program written by the programmer is just minuscule. Much
- >more code _generates_ pieces of Lisp, typically using the `macro' feature.
- >But almost all cases of macro usage are handled straightforwardly in Lisp
- >compilers. There are a few cases where Lisp code generates code on the
- >fly, then executes it. This is handled by having an interpreter loaded
- >along with the compiled code, and assuring that code can work correctly in
- >such a mixed environment. In fact, most Lisp implementations _assume_ a
- >mixed environment....
-
- (I think that a good definition of interpreted language is one where even
- if you compile it, you must load an interpreter or compiler with the
- object code.)
-
- Many old Prolog programs modify themselves using assert and retract.
- Prolog compilers handle this by using the above techniques, but also by
- making a slight change to the language: programmers are required to
- declare predicates that will be modified with assert/retract as "dynamic".
-
- Without these declarations, it is very difficult get reasonable efficiency
- of the compiled code.
- --
- Fergus Henderson fjh@munta.cs.mu.OZ.AU
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-