About: Foreign function interface is a research topic. Over the lifetime, 61 publications have been published within this topic receiving 1341 citations. The topic is also known as: FFI & native interface.
TL;DR: Simplified Wrapper and Interface Generator has been primarily designed for scientists, engineers, and application developers who would like to use scripting languages with their C/C++ programs without worrying about the underlying implementation details of each language or using a complicated software development tool.
Abstract: I present SWIG (Simplified Wrapper and Interface Generator), a program development tool that automatically generates the bindings between C/C++ code and common scripting languages including Tcl, Python, Perl and Guile. SWIG supports most C/C++ datatypes including pointers, structures, and classes. Unlike many other approaches, SWIG uses ANSI C/C++ declarations and requires the user to make virtually no modifications to the underlying C code. In addition, SWIG automatically produces documentation in HTML, LaTeX, or ASCII format. SWIG has been primarily designed for scientists, engineers, and application developers who would like to use scripting languages with their C/C++ programs without worrying about the underlying implementation details of each language or using a complicated software development tool. This paper concentrates on SWIG's use with Tcl/Tk.
TL;DR: The goal of the system is to prevent foreign function calls from introducing type and memory safety violations into an otherwise safe language, and it targets OCaml's FFI to C, which is relatively lightweight and illustrates some interesting challenges in multi-lingual type inference.
Abstract: 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.
TL;DR: This tutorial covers the basic concepts involved in writing parallel and concurrent programs in Haskell, and takes a deliberately practical approach: most of the examples are real Haskell programs that you can compile, run, measure, modify and experiment with.
Abstract: Haskell provides a rich set of abstractions for parallel and concurrent programming. This tutorial covers the basic concepts involved in writing parallel and concurrent programs in Haskell, and takes a deliberately practical approach: most of the examples are real Haskell programs that you can compile, run, measure, modify and experiment with. We cover parallel programming with the @[email protected] monad, Evaluation Strategies, and the @[email protected] monad. On the concurrent side, we cover threads, @[email protected], asynchronous exceptions, Software Transactional Memory, the Foreign Function Interface, and briefly look at the construction of high-speed network servers in Haskell.
TL;DR: Jeannie is presented, a new language design for integrating Java with C that eliminates verbose boiler-plate code, enables static error detection across the language boundary, and simplifies dynamic resource management.
Abstract: Higher-level languages interface with lower-level languages such as C to access platform functionality, reuse legacy libraries, or improve performance. This raises the issue of how to best integrate different languages while also reconciling productivity, safety, portability, and efficiency. This paper presents Jeannie, a new language design for integrating Java with C. In Jeannie, both Javaand C code are nested within each other in the same file and compile down to JNI, the Java platform's standard foreign function interface. By combining the two languages' syntax and semantics, Jeannie eliminates verbose boiler-plate code, enables static error detection across the language boundary, and simplifies dynamic resource management. We describe the Jeannie language and its compiler, while also highlighting lessons from composing two mature programming languages.
TL;DR: In a device for delivering drops of fluid to a surface, such as a printing head for delivering Drops of ink, the operating reliability of the device is improved by the provision of a valve disposed in the ejector head in the fluid flow path between the connector member and the inlet channel for reducing pressure surges experienced by the fluid.
Abstract: In his seminal paper “Why functional programming matters”, John Hughes argues that the strength of lazy, higher order languages lies in the ability to glue different functions of a program together. In this thesis we explore how these languages are suited to glue not only functions but also software components written in different languages. The first chapter of this thesis describes the design of a foreign function interface for the non-strict, higher order language Haskell. A foreign function interfaces (FFI) enables a program to call programs written in other languages and vice versa. different languages can use different calling conventions and data representations { the foreign language interface ensures a proper calling convention and transforms data values into the representation of the foreign language. The transformation of data values to their foreign representation, called marshalling, is where most complications arise.