comp.lang.ada
 help / color / mirror / Atom feed
* Re: Ada_Machine not splitting hairs
@ 1991-07-07  4:04 William Loftus
  0 siblings, 0 replies; only message in thread
From: William Loftus @ 1991-07-07  4:04 UTC (permalink / raw)


>From article <9106301635.AA02605@ajpo.sei.cmu.edu>, by SAHARBAUGH@ROO.FIT.EDU:
> Just like a BASIC interpreter, only a more powerful language.
> Maybe the people who know how to process languages will point out
> a reason why this can not be done. If they do that is no real
> problem, the Ada specification never said the language had to be
> interpretable.

Basically, because the Ada specification never says anything about being
interpreted, and usually is implying compilation.

Here are a few examples:

What is the definition of how to start an Ada program?  Do you simply call
the main routine?  What would that call be?  In ACE, we implemented an
interpretive extension to Ada:  compilation units, statements, and
declarations were allowed as the root non-terminal of a program.
Therefore, we could start a program by simply calling the main subprogram,
however, this is definitely not covered in 1815a.

In an interpretive language there is usually a way to construct programs on
the fly and execute them (mini-code generators) (note:  this is not self
modifying code).  For example:

with Interpreter;
procedure declaration is
begin
  Interpreter.Interpret ("I : Integer;");
end declaration;

What would this mean?  It has no definition under the LRM.  Many would
argue that it should not be allowed in an Ada interpreter.  However, many
interpreted rapid prototyping systems have such calls, and you would be
limiting the uses of an Ada interpreter by not allowing it.

Another problem is time.  An interpreter has a concept of time different
from compiled languages.  Compilers do not maintain the semantics of the
language it was compiled from, if the compilation was proper, it will have
inherited the semantics.  An interpreter must maintain the semantics at all
times.  So the problem becomes how do you turn the interpreter on and off?
Do you stop it and start it again as if it was a program that was
interrupted?  More to the point, if you change the specification of a
subprogram what happens to all the affect code that is current being
executed?  If you change a type of an object from integer to float what
happens?  The element of time is totally ignored in the LRM (hence its
compilation bias).

ACE took the principles in the LRM and made reasonable extensions to
produce an interpretive standard.  By the way, ACE was done at Unisys not
Westinghouse, and there were plans to produce a full Ada interpreter (there
was at one-time an ACE that supported tasking).  Currently, ACE is
undergoing a face-lift where the entire frontend of ACE is replace by a
full Ada frontend (developed for a compiler).  It is probably in the
real-soon-now category for release.

William Loftus (an ACE developer).
--
William Loftus                   (215) 668 3661
WPL Laboratories, Inc.           UUCP: loftus@wpllabs.UUCP
PO Box 111                       ARPA: loftus!wpllabs@prc.unisys.com
216 Wynne Lane
Penn Valley, PA 19072            Ada and Unix Software Consultants

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1991-07-07  4:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-07-07  4:04 Ada_Machine not splitting hairs William Loftus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox