Results 1 -
2 of
2
Compiling logic programs to C using GNU C as a portable assembler
, 1995
"... This paper discusses the merits of using C, and in particular GNU C, as an intermediate target language for the compilation of logic programs, and describes the approach we have taken in the implementation of Mercury. We start with a simple approach using ANSI C, and investigate a variety of improve ..."
Abstract
-
Cited by 16 (5 self)
- Add to MetaCart
This paper discusses the merits of using C, and in particular GNU C, as an intermediate target language for the compilation of logic programs, and describes the approach we have taken in the implementation of Mercury. We start with a simple approach using ANSI C, and investigate a variety of improvements on this basic approach. Keywords: compilation techniques, programming language implementation, logic programming languages, Mercury, C, GNU C. 1 Introduction There are many different ways of implementing a logic programming language, each with its own advantages and disadvantages. Each method makes its own trade-offs in terms of simplicity, portability, interactivity, compilation time, code size, speed at runtime, ease of debugging, interoperation with other languages, and so on. The choice of a particular method must be governed by the relative weights placed on these different trade-offs. This paper discusses the approach we took in the implementation of Mercury [11, 12], a new pure...
A comparison of some schemes for translating logic to C.
- In Workshop on Implementations of 11th International Conference of Logic Programming
, 1994
"... The general improvement of C compilers, and some new non standard features of gcc have made it more attractive to compile (logic) to C: it is no longer unthinkable that the speed of a native code optimizer can be matched and even beaten by a scheme that compiles to C and lets most of the hard work b ..."
Abstract
-
Cited by 4 (1 self)
- Add to MetaCart
The general improvement of C compilers, and some new non standard features of gcc have made it more attractive to compile (logic) to C: it is no longer unthinkable that the speed of a native code optimizer can be matched and even beaten by a scheme that compiles to C and lets most of the hard work be done by the C compiler. The new features, especially gcc's treatment of labels as first class types, are a clear invitation to abandon native code generators. Also, the possibility to assign hardware registers to global variables looks attractive at first sight. Three schemes for exploiting a C compiler in the compilation of different languages, are examined and their effectiveness is measured. The conclusion is that it is probably better not to make use of all the features gcc offers. We also show that if C compilers were a bit smarter about compiling the C switch statement, compliance to standard C would become even more attractive. The measurements were done on different risc platforms ...

