Loading…

Collecting Cyclic Garbage across Foreign Function Interfaces: Who Takes the Last Piece of Cake?

A growing number of libraries written in managed languages, such as Python and JavaScript, are bringing about new demand for a foreign language interface (FFI) between two managed languages. Such an FFI allows a host-language program to seamlessly call a library function written in a foreign languag...

Full description

Saved in:
Bibliographic Details
Published in:Proceedings of ACM on programming languages 2023-06, Vol.7 (PLDI), p.591-614, Article 130
Main Authors: Yamazaki, Tetsuro, Nakamaru, Tomoki, Shioya, Ryota, Ugawa, Tomoharu, Chiba, Shigeru
Format: Article
Language:English
Subjects:
Citations: Items that this one cites
Online Access:Get full text
Tags: Add Tag
No Tags, Be the first to tag this record!
Description
Summary:A growing number of libraries written in managed languages, such as Python and JavaScript, are bringing about new demand for a foreign language interface (FFI) between two managed languages. Such an FFI allows a host-language program to seamlessly call a library function written in a foreign language and exchange objects. It is often implemented by a user-level library but such implementation cannot reclaim cyclic garbage, or a group of objects with circular references, across the language boundary. This paper proposes Refgraph GC, which enables FFI implementation that can reclaim cyclic garbage. Refgraph GC coordinates the garbage collectors of two languages and it needs to modify the managed runtime of one language only. It does not modify that of the other language. This paper discusses the soundness and completeness of the proposed algorithm and also shows the results of the experiments with our implementation of FFI with Refgraph GC. This FFI allows a Ruby program to access a JavaScript library.
ISSN:2475-1421
2475-1421
DOI:10.1145/3591244