P. Tarau et al., PARTIAL TRANSLATION - TOWARDS A PORTABLE AND EFFICIENT PROLOG IMPLEMENTATION TECHNOLOGY, The journal of logic programming, 29(1-3), 1996, pp. 65-83
Citations number
26
Categorie Soggetti
Computer Sciences, Special Topics","Computer Science Theory & Methods
We describe a new language translation framework (partial translation)
and the application of one of its instances: the C-ification of Binar
y Prolog. Our partial translation framework compiles selected sequence
s of emulator instructions down to native code. The technique can be s
een as an automatic specialization. with respect to a given program of
the traditional instruction folding techniques used to speed up emula
tors. In our implementation, the complex control structure, some large
instructions, and the management of the symbol table are left to the
emulator, while the translated code deals with relatively long sequenc
es of simple instructions. After compilation, the generated code is li
nked with a target language representation of the emulator's byte code
and the emulator itself to form a stand-alone application. The compos
ite run-time system's behavior can be seen as a form of ''coroutining'
' between emulated and native code. The framework supports modular com
pilation, allows programmer control of the speed versus size optimizat
ion, is fully portable, and has a performance that ranges between the
performance of emulated code and that of native code. Our design has b
een proven practical in the implementation of the C-code generator of
a fairly complete multiplatform Prolog system (BinProlog) available by
ftp at clement.info.umoncton.ca.