foreign function interface

Implementing and maintaining language bindings and runtime interop (FFI) to automate reliable data marshalling, connect to external numerical solvers, and integrate modules (e.g., Wasm) with managed language runtimes while minimizing engineering overhead.

foreignfunctioninterface

12-Month Skill Trend

Momentum and market value over time
Trending
Score
+20 in 12 mo
96
12 mo agoNow
Career
Value
+$12K in 12 mo
$42K/year
12 mo agoNow

Recommended Survey Paper

Quick overview of the field
View more

Must-Read Papers

Most classic and influential ideas
View more

Kernel-FFI: Transparent Foreign Function Interfaces for Interactive Notebooks

Jul 30, 2025
HL
Hebi Li
🏛️ CodePod Inc. | LinkedIn | MBZUAI

Existing foreign function interface (FFI) solutions struggle to support dynamic workflows in interactive notebooks (e.g., Jupyter): they require manual configuration, extensive boilerplate code, and lack support for recursive calls and cross-language object-oriented programming (OOP). This paper proposes TransFFI—a transparent, language-agnostic FFI framework that automatically enables cross-language function invocation and object manipulation via source-level parsing and rewriting, eliminating hand-written bindings. Its key innovations include a side-channel communication mechanism that avoids kernel blocking, enabling recursive and asynchronous cross-language calls; and unified cross-language object serialization with lifetime-aware resource management, ensuring reference preservation and automatic memory reclamation. Evaluated across multi-language notebook environments, TransFFI significantly improves developer productivity and interactive flexibility while maintaining type safety and runtime efficiency.

Eliminates manual bindings and boilerplate codeEnables seamless cross-language calls in notebooksSupports OOP and recursive calls across languages

WebAssembly lacks efficient support for managed languages such as Python and Java, limiting its applicability in domains like machine learning and data processing. This work proposes WALL-E, a novel framework that introduces an external library linking mechanism requiring no modifications to language runtimes. By leveraging a client-server architecture, WALL-E enables WebAssembly modules to interoperate efficiently with native managed-language runtimes, eliminating the overhead of nested virtual machines. The approach supports ten mainstream managed languages and achieves significant performance gains—delivering speedups of up to several hundred times over conventional nested execution models—while preserving full language compatibility. Moreover, it incurs minimal communication overhead, making it well-suited for deploying heterogeneous, multi-language applications across cloud, edge, and endpoint environments.

external library linkingmanaged languagesmulti-language applications

WAMI: Compilation to WebAssembly through MLIR without Losing Abstraction

Jun 19, 2025
BK
Byeongjee Kang
🏛️ Carnegie Mellon University | Yale University

Existing WebAssembly (Wasm) compilers face a trade-off: domain-specific approaches lack reusability, while general-purpose ones—especially those relying on LLVM IR—lose high-level semantics, hindering efficient support for advanced features such as garbage collection (GC) and stack switching. Method: This paper introduces the first MLIR-native compilation pipeline tailored for Wasm, featuring a dedicated Wasm dialect family (WasmDialect) that preserves high-level semantics end-to-end across multiple IR levels. It proposes a novel, pattern-based modular extension mechanism in MLIR and is the first to fully support stack-switching compilation within MLIR. The pipeline integrates the Wabt backend to bypass LLVM’s lowering overhead. Results: Evaluated on PolyBench, it achieves performance comparable to the LLVM backend (within −7.7% slowdown, sometimes faster), generates smaller code size, and enables GC and stack switching with zero additional engineering effort.

Compiling high-level languages to WebAssembly without abstraction lossEliminating redundant efforts in language-specific Wasm compilationOvercoming LLVM backend limitations for high-level Wasm features

This work addresses the lack of a unified framework in existing domain-specific language (DSL) compilers, which leads to redundant development, maintenance challenges, and difficulty meeting production-grade requirements. The paper presents the first fully MLIR-based NumPy-like DSL, featuring native implementation of both front-end parsing and semantic analysis within MLIR. It introduces a novel dialect-agnostic type checker and a parallelism-first lowering strategy that seamlessly integrates with MLIR’s dataflow dialects. By doing so, this approach not only advances the standardization of DSLs within the MLIR ecosystem but also demonstrates strong performance on real-world Fortran applications in domains such as weather modeling and computational fluid dynamics.

code reusecompiler frameworksDSL compilers

This work proposes a general methodology for systematically integrating a C++ frontend with a functional-language backend based on Agda and Haskell, addressing the lack of reusable frameworks in existing approaches. By adapting the Model-View-ViewModel (MVVM) architecture to functional programming and complementing it with a lightweight, automated SDK toolchain, the approach enables seamless interoperability. Key innovations include the first mechanism allowing Agda to invoke arbitrary built-in Haskell libraries and a novel Haskell future implementation that supports arbitrary interruption and direct triggering via the C/C++ foreign function interface (FFI). Experimental evaluation demonstrates that the agda2hs-based implementation outperforms both Rocq’s OCaml extraction and Agda’s default MAlonzo backend in terms of performance, confirming the feasibility and efficiency of the proposed method.

AgdaFFIfunctional programming

Latest Papers

What's happening recently
View more

This work addresses the inefficiency of cold-start in large language model (LLM) inference services, which stems from serial initialization and numerous fine-grained I/O requests. The authors propose a Communicating Finite Automaton (CFA) abstraction to systematically identify cross-component optimization opportunities and design a programming framework that enables safe concurrent execution of complex, heterogeneous components while preserving original program structure. This is the first application of CFA to LLM cold-start optimization. By restructuring key paths in vLLM—such as process tree creation, tensor loading, and model switching—and integrating I/O coalescing with concurrency control, the approach achieves correctness and performance without code rewriting. Experiments demonstrate up to 7.2× cold-start acceleration across diverse GPUs, workloads, and model scales, significantly improving LLM service responsiveness and robustness.

cold startI/O requestsinference latency

This work addresses the interoperability challenge between GCC and LLVM compiler intermediate representations (IRs), which stems from their semantic and structural differences. To bridge this gap, the authors propose IRIS-14B, the first large language model specifically designed for IR-to-IR translation. Built upon a 14-billion-parameter Transformer architecture, IRIS-14B leverages supervised fine-tuning to learn the mapping between GIMPLE and LLVM IR derived from the same C source code, enabling high-fidelity automatic translation. Experimental results demonstrate that IRIS-14B substantially outperforms existing open-source large models on real-world C programs and competitive programming tasks, achieving up to a 44-percentage-point improvement in accuracy. This study provides the first empirical validation of large language models as effective and feasible interoperability layers within neuro-symbolic hybrid compilation frameworks.

Compiler Intermediate RepresentationCross-toolchain InteroperabilityGIMPLE

Traditional control flow graph (CFG) generation methods rely on syntactically complete code and language-specific tooling, making them ill-suited for handling erroneous or incomplete code fragments and lacking unified support across multiple programming languages. This work proposes the first approach to leverage lightweight large language models—such as CodeLlama and QwenCoder—for robust CFG construction from such low-quality inputs. By employing instruction fine-tuning, a unified serialization format, and an automatically curated, error-augmented dataset derived from LeetCode, the method achieves strong parsing performance even on malformed or partial code. Notably, it not only excels on languages seen during training but also demonstrates cross-lingual generalization to unseen programming languages, establishing a new paradigm for static analysis of multilingual, low-quality code.

Control Flow Grapherroneous codeincomplete code

This work addresses the significant runtime overhead commonly incurred by assertion checking in dynamically typed languages. It proposes a novel approach that, for the first time, systematically incorporates multi-calling-context information into a goal-directed, multi-variant abstract interpretation framework. By performing top-down inference of program properties under distinct calling contexts and selectively integrating the runtime semantics of assertions, the method substantially reduces redundant checks while preserving the ability to provide hints about unverified properties. An implementation in the Ciao system demonstrates that this technique markedly decreases the number of runtime checks and improves execution performance compared to existing approaches.

abstract interpretationassertion propertiesdynamic languages

Hot Scholars

JT

Jin Tian

Mohamed bin Zayed University of Artificial Intelligence
artificial intelligencemachine learningcausal inference
YB

Yegor Bugayenko

Software Developer at Huawei
object-oriented programmingautomated project management
WJ

William J. Bowman

University of British Columbia
Computer ScienceProgramming Languages
TR

Tiark Rompf

Purdue University
programming languagescompilersdatabasesmachine learning
SJ

Songlin Jia

Purdue University
Programming Languages