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
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
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
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
Static Checking of Dynamically Generated Queries in Database Applications
Proceedings of the 26th International Conference on Software Engineering
Precise analysis of string expressions
SAS'03 Proceedings of the 10th international conference on Static analysis
The essence of command injection attacks in web applications
Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Application-specific foreign-interface generation
Proceedings of the 5th international conference on Generative programming and component engineering
Operational semantics for multi-language programs
Proceedings of the 34th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Static specification inference using predicate mining
Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implementation
Improving software quality with static analysis
PASTE '07 Proceedings of the 7th ACM SIGPLAN-SIGSOFT workshop on Program analysis for software tools and engineering
Ilea: inter-language analysis across java and c
Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems and applications
Checking type safety of foreign function calls
ACM Transactions on Programming Languages and Systems (TOPLAS)
Protocol Inference Using Static Path Profiles
SAS '08 Proceedings of the 15th international symposium on Static Analysis
Deep typechecking and refactoring
Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications
An empirical security study of the native code in the JDK
SS'08 Proceedings of the 17th conference on Security symposium
Operational semantics for multi-language programs
ACM Transactions on Programming Languages and Systems (TOPLAS)
Automatic generation of library bindings using static analysis
Proceedings of the 2009 ACM SIGPLAN conference on Programming language design and implementation
Debug all your code: portable mixed-environment debugging
Proceedings of the 24th ACM SIGPLAN conference on Object oriented programming systems languages and applications
State of the union: type inference via Craig interpolation
TACAS'07 Proceedings of the 13th international conference on Tools and algorithms for the construction and analysis of systems
Jinn: synthesizing dynamic bug detectors for foreign language interfaces
PLDI '10 Proceedings of the 2010 ACM SIGPLAN conference on Programming language design and implementation
JET: exception checking in the Java native interface
Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications
Quarantine: a framework to mitigate memory errors in JNI applications
Proceedings of the 9th International Conference on Principles and Practice of Programming in Java
Polymorphic type inference for the JNI
ESOP'06 Proceedings of the 15th European conference on Programming Languages and Systems
Hi-index | 0.00 |
We present a multi-lingual type inference system for checking type safety across a foreign function interface. The goal of our system is to prevent foreign function calls from introducing type and memory safety violations into an otherwise safe language. Our system targets OCaml's FFI to C, which is relatively lightweight and illustrates some interesting challenges in multi-lingual type inference. The type language in our system embeds OCaml types in C types and vice-versa, which allows us to track type information accurately even through the foreign language, where the original types are lost. Our system uses representational types that can model multiple OCaml types, because C programs can observe that many OCaml types have the same physical representation. Furthermore, because C has a low-level view of OCaml data, our inference system includes a dataflow analysis to track memory offsets and tag information. Finally, our type system includes garbage collection information to ensure that pointers from the FFI to the OCaml heap are tracked properly. We have implemented our inference system and applied it to a small set of benchmarks. Our results show that programmers do misuse these interfaces, and our implementation has found several bugs and questionable coding practices in our benchmarks.