Foreign function interface: Difference between revisions

From Rosetta Code
Content added Content deleted
(Created page with 'Foreign function interface, or FFI, is a common name for a facility in a programming language (especially a high-level one that does not usually work in terms of pointers, ra…')
 
m (→‎Functions: Avoid a broken redirect.)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<!-- [[User:Kevin Reid]]: I recommend keeping this info reasonably short, as we don't need to duplicate Wikipedia's effort. There should be just enough information to help a Rosetta Code reader navigate. -->
[[Foreign function interface]], or FFI, is a common name for a facility in a programming language (especially a high-level one that does not usually work in terms of pointers, raw structure layout, etc.) to invoke functions and access data structures defined using another one (especially [[C]]).
[[Foreign function interface]], or FFI, is a common name for a facility in a programming language (especially a high-level one that does not usually work in terms of pointers, raw structure layout, etc.) to invoke functions and access data structures defined using another one (especially [[C]]).


Line 5: Line 6:
==Relevant tasks==
==Relevant tasks==


<!-- I don't think these tasks should be put under FFI as a main category, because they are all relevant to languages such as C itself where these operations are not "foreign". -->
<!-- [[User:Kevin Reid]]: I don't think these tasks should be put under FFI as a main category, because they are all relevant to languages such as C itself where these operations are not "foreign". -->


===Functions===
===Functions===
* [[Call function in shared library]]
* [[Call foreign language function]]
** [[Call function in shared library]] (a special case)
* [[Use another language to call a function]]


===Data structures/memory access===
===Data structures/memory access===
* [[Address Operations]]
* [[Address Operations]]
* [[Data Representation - Controlling Fields in a Structure]]
* Data Representation
* [[Data Representation - Getting the Size]]
** [[Data Representation - Controlling Fields in a Structure|Controlling Fields in a Structure]]
* [[Data Representation - Specifying Minimum Size]]
** [[Data Representation - Getting the Size|Getting the Size]]
** [[Data Representation - Specifying Minimum Size|Specifying Minimum Size]]
* [[Host Introspection]]
* [[Host Introspection]]



Latest revision as of 15:52, 23 July 2011

Foreign function interface, or FFI, is a common name for a facility in a programming language (especially a high-level one that does not usually work in terms of pointers, raw structure layout, etc.) to invoke functions and access data structures defined using another one (especially C).

The term is commonly used in Common Lisp and Haskell.

Relevant tasks

Functions

Data structures/memory access

See also