Higher-Order Code Splicing

  • Authors:
  • Peter Thiemann

  • Affiliations:
  • -

  • Venue:
  • ESOP '99 Proceedings of the 8th European Symposium on Programming Languages and Systems
  • Year:
  • 1999

Quantified Score

Hi-index 0.00

Visualization

Abstract

Run-time code generation (RTCG) and just-in-time compilation (JIT) are features of modern programming systems to strike the balance between generality and efficiency. Since RTCG and JIT techniques are not portable and notoriously hard to implement, we propose code splicing as an alternative for dynamically-typed higher-order programming languages. Code splicing combines precompiled pieces of code using higher-order functions. While this approach cannot achieve the performance of compiled code, it can support some intriguing features: - very fast "compilation" times; - satisfactory run times, compared with interpretation; - simple interfacing with compiled code; - portability. Starting from implementation models for functional languages we develop and evaluate several approaches to code splicing. This leads to some new insights into compilation techniques for functional programming languages, among them a compositional compilation schema to SKI-combinators. The progression of different techniques sheds some light on their relationship, specifically between combinator-based implementations and closure-based implementations. All techniques have been implemented and evaluated in Scheme.