Type checking records and variants in a natural extension of ML
POPL '89 Proceedings of the 16th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
The revised report on the syntactic theories of sequential control and state
Theoretical Computer Science
Type inference with polymorphic recursion
ACM Transactions on Programming Languages and Systems (TOPLAS)
A practical soft type system for Scheme
LFP '94 Proceedings of the 1994 ACM conference on LISP and functional programming
Static typing for dynamic messages
POPL '98 Proceedings of the 25th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Modern languages and Microsoft's component object model
Communications of the ACM
Proceedings of the 1999 ACM SIGPLAN-SIGSOFT workshop on Program analysis for software tools and engineering
Calling hell from heaven and heaven from hell
Proceedings of the fourth ACM SIGPLAN international conference on Functional programming
Scalable context-sensitive flow analysis using instantiation constraints
PLDI '00 Proceedings of the ACM SIGPLAN 2000 conference on Programming language design and implementation
CCured: type-safe retrofitting of legacy code
POPL '02 Proceedings of the 29th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Java Native Interface: Programmer's Guide and Reference
Java Native Interface: Programmer's Guide and Reference
Java Virtual Machine Specification
Java Virtual Machine Specification
The Exu Approach to Safe, Transparent and Lightweight Interoperability
COMPSAC '01 Proceedings of the 25th International Computer Software and Applications Conference on Invigorating Software Development
ECOOP '01 Proceedings of the 15th European Conference on Object-Oriented Programming
CIL: Intermediate Language and Tools for Analysis and Transformation of C Programs
CC '02 Proceedings of the 11th International Conference on Compiler Construction
Language integration in the common language runtime
ACM SIGPLAN Notices
Mockingbird: Flexible Stub Compilation from Pairs of Declarations
ICDCS '99 Proceedings of the 19th IEEE International Conference on Distributed Computing Systems
Polylingual systems: an approach to seamless interoperability
Polylingual systems: an approach to seamless interoperability
Design of Large-Scale Polylingual Systems
Proceedings of the 26th International Conference on Software Engineering
Static Checking of Dynamically Generated Queries in Database Applications
Proceedings of the 26th International Conference on Software Engineering
Grammar-based analysis of string expressions
TLDI '05 Proceedings of the 2005 ACM SIGPLAN international workshop on Types in languages design and implementation
Checking type safety of foreign function calls
Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation
Operational semantics for multi-language programs
Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
SWIG: an easy to use tool for integrating scripting languages with C and C++
TCLTK'96 Proceedings of the 4th conference on USENIX Tcl/Tk Workshop, 1996 - Volume 4
Interlanguage object sharing with SOM
COOTS'96 Proceedings of the 2nd conference on USENIX Conference on Object-Oriented Technologies (COOTS) - Volume 2
Precise analysis of string expressions
SAS'03 Proceedings of the 10th international conference on Static analysis
Polymorphic type inference for the JNI
ESOP'06 Proceedings of the 15th European conference on Programming Languages and Systems
Operational semantics for multi-language programs
ACM Transactions on Programming Languages and Systems (TOPLAS)
Debug all your code: portable mixed-environment debugging
Proceedings of the 24th ACM SIGPLAN conference on Object oriented programming systems languages and applications
Weak updates and separation logic
APLAS '09 Proceedings of the 7th Asian Symposium on Programming Languages and Systems
JNI light: an operational model for the core JNI
APLAS'10 Proceedings of the 8th Asian conference on Programming languages and systems
Hi-index | 0.00 |
Foreign function interfaces (FFIs) allow components in different languages to communicate directly with each other. While FFIs are useful, they often require writing tricky low-level code and include little or no static safety checking, thus providing a rich source of hard-to-find programming errors. In this article, we study the problem of enforcing type safety across the OCaml-to-C FFI and the Java Native Interface (JNI). We present O-Saffire and J-Saffire, a pair of multilingual type inference systems that ensure C code that uses these FFIs accesses high-level data safely. Our inference systems use representational types to model C's low-level view of OCaml and Java values, and singleton types to track integers, strings, memory offsets, and type tags through C. J-Saffire, our Java system, uses a polymorphic flow-insensitive, unification-based analysis. Polymorphism is important because it allows us to precisely model user-defined wrapper functions and the more than 200 JNI functions. O-Saffire, our OCaml system, uses a monomorphic flow-sensitive analysis because, while polymorphism is much less important for the OCaml FFI flow-sensitivity is critical to track conditional branches, which are used when pattern matching OCaml data in C. O-Saffire also tracks garbage collection information to ensure that local C pointers to the OCaml heap are registered properly, which is not necessary for the JNI. We have applied O-Saffire and J-Saffire to a set of benchmarks and found many bugs and questionable coding practices. These results suggest that static checking of FFIs can be a valuable tool in writing correct multilingual software.