# Fine-grained Language Composition: A Case Study

arXiv: https://arxiv.org/abs/1503.08623 · HTML: https://mlsanity.com/paper/1503.08623/

## Key facts

- Cited by 1 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 30 Mar 2015.

## Built on by (most cited first, 1 of 1)

- [Preprocessing Source Code Comments for Linguistic Models](https://mlsanity.com/paper/2208.11235/) (2022)

## Abstract (arXiv)

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.
