10. Foreign function interface (FFI)

10. Foreign function interface (FFI)

GHC (mostly) conforms to the Haskell Foreign Function Interface, whose definition is part of the Haskell Report on http://www.haskell.org/.

FFI support is enabled by default, but can be enabled or disabled explicitly with the -XForeignFunctionInterface flag.

GHC implements a number of GHC-specific extensions to the FFI Addendum. These extensions are described in GHC extensions to the FFI Addendum, but please note that programs using these features are not portable. Hence, these features should be avoided where possible.

The FFI libraries are documented in the accompanying library documentation; see for example the 登录查看完整内容