Abstract

<p>We illustrate a simple and effective solution to semantics-based<br />compiling. Our solution is based on type-directed partial evaluation, where</p><p><br />- our compiler generator is expressed in a few lines, and is efficient; <p> - its input is a well-typed, purely functional definitional interpreter in the manner of denotational semantics;</p>- the output of the generated compiler is three-address code, in the fashion and efficiency of the Dragon Book;</p><p>- the generated compiler processes several hundred lines of source code per second.</p><p><br />The source language considered in this case study is imperative, block-structured,<br />higher-order, call-by-value, allows subtyping, and obeys<br />stack discipline. It is bigger than what is usually reported in the literature on semantics-based compiling and partial evaluation.<br />Our compiling technique uses the first Futamura projection, i.e., we compile programs by specializing a definitional interpreter with respect to this program. Our denitional interpreter is completely straightforward, stack-based, and in direct style. In particular, it requires no clever staging technique (currying, continuations, binding-time improvements, etc.), nor does it rely on any other framework (attribute grammars, annotations, etc.) than the typed lambda-calculus. In particular, it uses no other program analysis than traditional type inference. The overall simplicity and effectiveness of the approach has encouraged us to write this paper, to illustrate this genuine solution to denotational semantics-directed compilation, in the spirit of Scott and Strachey.</p>

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.