Kernel-FFI: Transparent Foreign Function Interfaces for Interactive Notebooks

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Li, Hebi, Bao, Forrest Sheng, Xiao, Qi, Tian, Jin
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866909712822304768
author Li, Hebi
Bao, Forrest Sheng
Xiao, Qi
Tian, Jin
author_facet Li, Hebi
Bao, Forrest Sheng
Xiao, Qi
Tian, Jin
contents Foreign Function Interfaces (FFIs) are essential for enabling interoperability between programming languages, yet existing FFI solutions are ill-suited for the dynamic, interactive workflows prevalent in modern notebook environments such as Jupyter. Current approaches require extensive manual configuration, introduce significant boilerplate, and often lack support for recursive calls and object-oriented programming (OOP) constructs-features critical for productive, multi-language development. We present Kernel-FFI, a transparent, language-agnostic framework that enables seamless cross-language function calls and object manipulation within interactive notebooks. Kernel-FFI employs source-level transformation to automatically rewrite cross-language invocations, eliminating the need for manual bindings or boilerplate. Kernel-FFI provides robust support for OOP by enabling foreign object referencing and automatic resource management across language boundaries. Furthermore, to address the blocking nature of Jupyter kernels and support recursive and asynchronous foreign calls, we introduce a novel side-channel communication mechanism. Our tool will be open-sourced and available at https://codepod.io/docs/kernel-ffi
format Preprint
id arxiv_https___arxiv_org_abs_2507_23205
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Kernel-FFI: Transparent Foreign Function Interfaces for Interactive Notebooks
Li, Hebi
Bao, Forrest Sheng
Xiao, Qi
Tian, Jin
Programming Languages
Software Engineering
Foreign Function Interfaces (FFIs) are essential for enabling interoperability between programming languages, yet existing FFI solutions are ill-suited for the dynamic, interactive workflows prevalent in modern notebook environments such as Jupyter. Current approaches require extensive manual configuration, introduce significant boilerplate, and often lack support for recursive calls and object-oriented programming (OOP) constructs-features critical for productive, multi-language development. We present Kernel-FFI, a transparent, language-agnostic framework that enables seamless cross-language function calls and object manipulation within interactive notebooks. Kernel-FFI employs source-level transformation to automatically rewrite cross-language invocations, eliminating the need for manual bindings or boilerplate. Kernel-FFI provides robust support for OOP by enabling foreign object referencing and automatic resource management across language boundaries. Furthermore, to address the blocking nature of Jupyter kernels and support recursive and asynchronous foreign calls, we introduce a novel side-channel communication mechanism. Our tool will be open-sourced and available at https://codepod.io/docs/kernel-ffi
title Kernel-FFI: Transparent Foreign Function Interfaces for Interactive Notebooks
topic Programming Languages
Software Engineering
url https://arxiv.org/abs/2507.23205