请输入您要查询的百科知识:

 

词条 Libffi
释义

  1. History

  2. Adoption

      D    F-Script    Guile    Haskell    Java    JavaScript    Lisp    Perl    Python    Racket    Ruby  

  3. References

  4. External links

{{lowercase}}

{{Infobox software
| name = libffi
| logo =
| screenshot =
| caption =
| developer = Anthony Green
| released = {{Start date and age|1996|10|07}}
| latest release version = 3.2.1
| latest release date = {{Start date and age|2014|11|12}}
| programming language = C, Assembly language
| operating system = Unix-like, Microsoft Windows, OS X, iOS, BareMetal OS
| genre = Runtime library
| license = MIT License[1]
| website = {{URL|https://sourceware.org/libffi}}
}}{{Portal|Free and open-source software}}

libffi is a foreign function interface library. It provides a C programming language interface for calling natively compiled functions given information about the target function at run time instead of compile time. It also implements the opposite functionality: libffi can produce a pointer to a function that can accept and decode any combination of arguments defined at run time.

libffi is most often used as a bridging technology between compiled and interpreted language implementations. libffi may also be used to implement plug-ins, where the plug-in's function signatures are not known at the time of creating the host application.

Notable users include Python, Haskell, Dalvik, F-Script, PyPy, PyObjC, RubyCocoa, JRuby, Rubinius, MacRuby, gcj, GNU Smalltalk, IcedTea, Cycript, Pawn, Squeak, Java Native Access, Common Lisp (via CFFI), Racket,[2] Embeddable Common Lisp and Mozilla.[3]

On Mac OS X, libffi is commonly used with BridgeSupport, which provides programming language neutral descriptions of framework interfaces, and Nu which binds direct Objective-C access from Lisp.

libffi has been widely ported and is released under a MIT license.

History

libffi, originally developed by Anthony Green, was inspired by the Gencall library from Silicon Graphics. Gencall was developed by Gianni Mariani, then employed by SGI, for the purpose of allowing calls to functions by address and creating a call frame for the particular calling convention. Anthony Green refined the idea and extended it to other architectures and calling conventions and open sourcing libffi.

Adoption

The libffi library is useful in building a bridge between interpreted and natively compiled code. Some notable users include:

D

; [https://github.com/lycus/libffi-d libffi-d]

Bindings to the libffi library for D. Primarily used for the [https://github.com/lycus/mci MCI] (Managed Compiler Infrastructure).

F-Script

;F-Script

Dynamically generates Cocoa classes written in F-Script.

Guile

; GNU Guile

libffi is used in Guile 1.9.8 and onwards

Haskell

;GHC

libffi has been used for the majority of the FFI performed by the GHC since late 2009.

Java

; OpenJDK

The open-source implementation of the Java Platform Standard Edition uses libffi to bridge between the interpreter and native code for Zero-Assembly port.

; Dalvik

Dalvik is the virtual machine which runs the Java platform on Android mobile devices. libffi is used on Android ports for which no custom bridging code has been written.

; Java Native Access (JNA)

The JNI-free way to call native code from Java.

; gcj

The runtime library for the GNU Compiler for the Java Programming Language uses libffi to handle calls back and forth between interpreted and natively compiled code. gcj is part of the GCC, the GNU Compiler Collection.

JavaScript

; JSCocoa

Call Objective-C code from javascript on Mac OS X and the iPhone (via the libffi-iphone port).

; Mozilla

libffi is used in the js-ctypes library (previously known as ctypes.jsm) to call C functions within JavaScript code (available in XULRunner applications, Firefox extensions etc).[4]

; [https://github.com/rbranson/node-ffi node-ffi]

A Node.js addon for loading and calling dynamic libraries from JavaScript.

Lisp

; cffi-libffi

The standard foreign function interface library for Common Lisp CFFI includes the cffi-libffi system to include support for passing and returning structure arguments by value.

; [https://github.com/pixie-lang/pixie pixie]

pixie (a Clojure inspired Lisp dialect) uses libffi as the default foreign function interface mechanism.

Perl

; [https://metacpan.org/pod/FFI::Raw FFI::Raw]

A thin wrapper around libffi.

; [https://metacpan.org/pod/FFI::Platypus FFI::Platypus]

Newer, more convenient wrapper around libffi.

Python

; CPython

The default, most-widely used implementation of the Python programming language uses libffi in the standard ctypes library.

; PyObjC

Call Objective-C code from Python on Mac OS X.

Racket

; Racket

Call C code from this popular Scheme implementation (also used as the implementation platform for Paul Graham's new Lisp, Arc).

Ruby

; Fiddle

A libffi wrapper in the Ruby Standard Library

; [https://github.com/ffi/ffi Ruby-FFI]

A Foreign Function Interface extension for Ruby.

; RubyCocoa

Call Objective-C code from Ruby on Mac OS X.

References

1. ^https://github.com/atgreen/libffi/blob/master/LICENSE
2. ^http://repository.readscheme.org/ftp/papers/sw2004/barzilay.pdf
3. ^https://hg.mozilla.org/mozilla-central/file/2dc00d4b379a/js/ctypes/libffi
4. ^[https://developer.mozilla.org/en/js-ctypes https://developer.mozilla.org/en/js-ctypes], [https://developer.mozilla.org/en/js-ctypes/js-ctypes_reference js-ctypes reference]

External links

  • [https://sourceware.org/libffi libffi project page]
  • Anthony Green's blog

2 : C libraries|Free computer libraries

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/16 8:13:50