The field of the invention relates to the field of computer programming languages. Specifically, the invention relates to interpreting and executing a computer programming language.
The current common method for interpreting a computer programming language and processing of same, is to transpose the highest level form into a more generic form of pseudo language. Typically, the programming language is transposed into an assembly language. This pseudo language is then interpreted and processed via branch to appropriate functions and procedures.
This process of transposing a programming language into a pseudo language before execution is a time consuming step. Typically the time required to transpose high level code into pseudo code can be equal to if not longer in time than processing the pseudo instruction set.
Additionally, transposing and executing the originally specified logic in pseudo code form typically creates a performance loss in the operation of the logic. With transformation into a new form, there is a loss of expression which must be realized in the new form. This loss is reflected in repetitions of instructions. For example, a conditional statement of a computer programming language may be realized in the following form:
In the typical prior art method of interpreting a programming language, the above example would typically be transposed into a test condition statement with label, an arithmetic expression, an assignment statement and jump to the test condition statement label. Given that the arithmetic expression would be equivalent to one instruction, this prior art transposition would produce at least five pseudo code instructions. These five pseudo code instructions would then be executed sequentially in at least five processor clock cycles. Thus, relatively simple expressions in a high level language may result in the execution of many pseudo code instructions.
The step of transposing a programming language into a lower level code form prior to execution may cause the loss of the essence of the initial expression. Depending upon the effectiveness of the transposing process (i.e. compiler or interpreter), errors may be introduced for particular code constructions. The level and severity of errors introduced in this manner affects the reliability and reusability of the software being interpreted. Additionally, the transposing step consumes processor time and therefore degrades performance of the interpreter system.
It is therefore an objective of the present invention to provide a method and a means for eliminating the intermediate step of transposing a programming language into a lower level code form prior to execution. It is a further objective of the present invention to provide an improved method for creating, interpreting, and executing an interpretive programming language. It is a further objective of the present invention to provide a means and method for improving the performance of an interpreter system. It is a further objective of the present invention to provide a means and method for improving the reliability of the results produced by an interpreter system.
The present invention provides a means and method for creating, interpreting, and executing a programming language. The present invention is a virtual processor that eliminates interpretation of pseudo code typical of common interpretive engines. By removing this step, the loss of the essence of the initial expression will not occur.
The preferred embodiment of the present invention includes a computer system comprising a bus communicating information, a processor, and a random access memory for storing information and instructions for the processor. The processing logic of the preferred embodiment is operably disposed within the random access memory and executed by the processor of the computer system.
A command stream is a typical input for the processing logic of the present invention. A command stream in this form may be produced by operator entry of an alphanumeric string on alphanumeric input device, included as a command line in a previously generated file and stored on read only memory device, or produced by a parser or preprocessor that outputs a command stream. The syntax of such a command stream consists of a command identifier or function name in combination with a string of arguments or parameters associated with the operation of the identified command.
Upon activation of the processing logic of the present invention, a Reset subroutine is executed to initialize pointers into the command stream and stack and frame pointers. A parser is then executed to manipulate the input command stream and produce an execution stream. The parser includes a call to a function that sets up pointers into the execution stream and produces a subroutine address (i.e. a processing component identifier) corresponding to the specified command. The command is then executed indirectly and a pointer is updated to point to the next command in the execution stream. Arguments for commands are pushed on to and popped from the execution stream using a stack pointer. Results from the execution of commands are pushed onto the stack. For commands that define a new function or procedure, frame data is maintained to preserve the context in which the new function or procedure is executed. Each command in the execution stream is interpreted in this manner until the end of the execution stream is reached.
a illustrates a typical example of a command stream input to the processing logic of the present invention.
b illustrates a typical example of an execution stream input to the processing logic of the present invention.
a, 3b, 4a, 4b, 5a, 5b, 6a-c, 7, and 8a-d depict the execution flow of the processing logic of the present invention.
The present invention provides a means and method for creating, interpreting, and executing a programming language. Such programming languages include algorithmic languages, logic and control structures, processing structures and virtual processor means for solving problems. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the invention. However, it will be apparent to one with ordinary skill in the art that these specific details need not be used to practice the present invention. In other instances, well-known logic structures, data structures, and interfaces have not been shown in detail in order not to unnecessarily obscure the present invention.
The present invention provides a general high performance means to interface a programming language to software applications. The present invention is a virtual processor designed to remove interpretation of pseudo code typical of common interpretive engines. By removing this step, the loss of the essence of the initial expression will not occur; thus, a lower level of detailed knowledge is not required by the interpreter. Taking the earlier example of a conditional looping statement:
The above statements are executed by the present invention as a generic ‘while’ statement offered within a programming language, an arithmetic expression, and an assignment. Given that the arithmetic expression would be equivalent to one instruction, this form is equivalent to three pseudo code instructions. By providing the expression of the original statement, the interpretive engine can execute the task in a more efficient duty cycle.
The advantages of this new method over the traditional is in the area of performance. By driving directly to the actual object code of the executing program rather than generating an intermediate pseudo code form, typical pre-compilation steps are not required. Additionally, by interpreting the actual expression as presented, a more cost effective duty cycle is achieved as measured in time.
The present invention includes a method by which capture and execution of the programming language is performed. Additionally, further advantages are gained in the manner in which the data is stored with relevant data structures and relationships between data items are maintained.
With the advent of high performance hardware computer systems one may realize the value of utilizing programming engines to more generalize software systems. This allows for higher reusability of software during a software systems lifecycle. Additionally, it has been realized via prototype that with the form of interpreting and executing commands in the present invention, one can expect a 2 to 4 times increase in performance over traditional methods of interpretation.
The preferred embodiment of the present invention is implemented on a Sun Microsystems, Inc. brand computer system. Other embodiments are implemented on IBM PC brand personal computers and other computer systems. It will be apparent to those with ordinary skill in the art, however, that alternative computer systems may be employed. In general, such computer systems, as illustrated by
The processing logic of the preferred embodiment is operably disposed within random access memory 102 and, executed by processor 101 of the computer system described above. The processing logic of the present invention may equivalently be disposed in read-only memory 103 or other memory means accessible to processor 101 for execution. A means for loading and activating the processing logic of the present invention exists using techniques well known to those of ordinary skill in the art. Once activated, the processing logic of the present invention operates in the manner described below.
Listing A, provided herein, presents the Baucus Naur description of the supporting data structures and relationships used in the present invention. A detailed specification of the processing logic of the present invention is provided herein in Listing B. Both Listing A and Listing B are provided at the end of this detailed description, but before the claims.
Referring now to the example illustrated in
A command stream 21 in the form of
Referring still to
In a manner described below, the command stream 28 is translated into an execution stream 28 as shown in
The flow charts of
Referring now to
Referring again to the logic illustrated in
Upon activation of the parser in decision block 103, the processing logic for the parser is executed as illustrated in
Referring now to
Referring again to
Referring again to
At the completion of parser processing, the execution stream 28 appears as shown in
Referring again to
Referring now to
Referring now to
Referring now to
Referring again to
Referring now to
Referring again to
Having completed execution for the Add function, processing control returns to decision block 303 illustrated in
One capability supported by the processing logic of the present invention includes defining and executing new procedures and functions. Referring again to
Finally, a return function is provided at processing block 526 as illustrated in
Referring now to
Referring now to
Thus, an efficient means and method for creating, interpreting, and executing a programming language is disclosed.
Although this invention has been shown in relation to a particular embodiment, it should not be considered so limited. Rather, it is limited only by the appended claims.
Baucus Naur Form Description Conventions:
Baucus Naur Form Description of Data Structures Conventions:
This application is a Continuation of U.S. patent application Ser. No. 08/287,064, entitled Programmable Interpretive Virtual Machine, naming inventor Jay J. Sturges, filed on Aug. 8, 1994, and issued on Oct. 24, 2000 as U.S. Pat. No. 6,138,273, which was a Continuation of U.S. patent application Ser. No. 07/663,594, filed on Mar. 1, 1991 now abandoned.
Number | Name | Date | Kind |
---|---|---|---|
3938103 | Welin | Feb 1976 | A |
4173041 | Dvorak et al. | Oct 1979 | A |
4309756 | Beckler | Jan 1982 | A |
4517640 | Hattori et al. | May 1985 | A |
4631663 | Chilinski et al. | Dec 1986 | A |
4719564 | Hara | Jan 1988 | A |
4980821 | Koopman et al. | Dec 1990 | A |
5070451 | Moore et al. | Dec 1991 | A |
5504901 | Peterson | Apr 1996 | A |
5721924 | Kitadate | Feb 1998 | A |
5828883 | Hall | Oct 1998 | A |
6138273 | Sturges | Oct 2000 | A |
Number | Date | Country | |
---|---|---|---|
Parent | 08287064 | Aug 1994 | US |
Child | 09512395 | US | |
Parent | 07633594 | Mar 1991 | US |
Child | 08287064 | US |