Fine-grained Language Composition: A Case Study
Edd Barrett, Carl Friedrich Bolz, Lukas Diekmann, Laurence Tratt

TL;DR
This paper introduces a novel fine-grained syntactic approach for embedding PHP and Python within each other, enabling variable referencing across languages with minimal performance overhead.
Contribution
It presents a new method for language composition that is more granular and efficient than traditional FFI-based approaches.
Findings
Achieves cross-language embedding with acceptable overhead of up to 2.6x
Addresses design challenges of fine-grained language composition
Demonstrates feasibility of syntactic language embedding
Abstract
Although run-time language composition is common, it normally takes the form of a crude Foreign Function Interface (FFI). While useful, such compositions tend to be coarse-grained and slow. In this paper we introduce a novel fine-grained syntactic composition of PHP and Python which allows users to embed each language inside the other, including referencing variables across languages. This composition raises novel design and implementation challenges. We show that good solutions can be found to the design challenges; and that the resulting implementation imposes an acceptable performance overhead of, at most, 2.6x.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
