From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 7 Jul 91 04:04:20 GMT From: wpllabs!loftus@burdvax.prc.unisys.com (William Loftus) Subject: Re: Ada_Machine not splitting hairs Message-ID: <00678863060@wpllabs.UUCP> List-Id: >>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