|
ABSTRACT
We consider the task of automatically constructing intermediate-level machine architectures and compilers generating code for these architectures, given operational semantics for source languages. We use operational semantics in the form of abstract machines given by rewrite systems in which the rewrite rules operate on terms representing states of computations. To construct compilers and new architectures we employ a particular strategy called pass separation, a form of staging transformation, that takes a program p and constructs a pair of programs p1, p2 such that p(x, y) = p2(p1(x), y)) for all x,y. If p represents an operational semantics for a language, with arguments x and y denoting a source program and its input data, then pass separation constructs programs p1 and p2 corresponding to a compiler and an executor. The compiler translates the source language into an intermediate-level target language, and the executor provides the definition for this language. Our use of pass separation supports the automatic definition of target languages or architectures, and the structure of these architectures is directed by the structure of the given source semantics. These architectures resemble abstract machine languages found in hand-crafted compilers. Our method is restricted to a limited class of abstract machines given as term-rewriting systems, but we argue that this class encompasses a large set of language definitions derived from more natural operational semantics. We provide two examples of our method by constructing compilers and target architectures for a simple functional language and a simple imperative language. Though we construct these architectures automatically, they bear a striking resemblance to existing architectures constructed by hand.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
|
| |
2
|
BONDORF, A. AND DANVY, O. 1990. Automatic autoprojection of recursive equations with global variables and abstract data types. Tech. Rep. 90/4, DIKU, University of Copenhagen.
|
| |
3
|
|
| |
4
|
|
 |
5
|
|
| |
6
|
HANNAN, J. AND MILLER, D. 1992. From operational semantics to abstract machines. Math. Struct. Comput. Sci. 2, 4, 415-459.
|
| |
7
|
HANNAN, J. AND PFENNING, F. 1992. Compiler verification in LF. In Proceedings of the 7th Annual IEEE Symposium on Logic ~n Computer Science, A. Scedrov, Ed. IEEE Computer Society Press, Los Alamitos, Calif., 407-418.
|
 |
8
|
|
| |
9
|
JONES, N.D. 1987. Challenging problems in partial evaluation and mixed computation. In Partial Evaluation and Mixed Computation, D. Bjorner, A. P. Ershov, and N. D. Jones, Eds. North-Holland, Amsterdam, 1-14.
|
| |
10
|
|
| |
11
|
JONES, N., SESTOFT, P., AND SCNDERGAARD, H. 1989. MIX: A self-applicable partial evaluator for experiments in compiler generation. J. LISP Symbol. Comput. 2, 1, 9-50.
|
 |
12
|
|
| |
13
|
|
 |
14
|
|
| |
15
|
|
| |
16
|
LANDIN, P.J. 1964. The mechanical evaluation of expressions. Comput. J. 6, 5, 308-320.
|
| |
17
|
|
| |
18
|
|
| |
19
|
NILSSON, U. 1993. Towards a methodology for the design of abstract machines for logic programming languages. J. Logic Program. 16, 1, 2 (May), 163-189.
|
 |
20
|
|
| |
21
|
PLOTKIN, G. 1981. A structural approach to operational semantics. DAIMI FN-19, Aarhus Univ., Aarhus, Denmark.
|
| |
22
|
|
 |
23
|
|
 |
24
|
|
Peer to Peer - Readers of this Article have also read:
-
Data structures for quadtree approximation and compression
Communications of the ACM
28, 9
Hanan Samet
-
A hierarchical single-key-lock access control using the Chinese remainder theorem
Proceedings of the 1992 ACM/SIGAPP Symposium on Applied computing
Kim S. Lee
, Huizhu Lu
, D. D. Fisher
-
The GemStone object database management system
Communications of the ACM
34, 10
Paul Butterworth
, Allen Otis
, Jacob Stein
-
An intelligent component database for behavioral synthesis
Proceedings of the 27th ACM/IEEE conference on Design automation
Gwo-Dong Chen
, Daniel D. Gajski
-
Putting innovation to work: adoption strategies for multimedia communication systems
Communications of the ACM
34, 12
Ellen Francik
, Susan Ehrlich Rudman
, Donna Cooper
, Stephen Levine
|