## MLton 20241230+git20251029+dfsg-5

# ForeignFunctionInterface

MLton’s foreign function interface (FFI) extends Standard ML and makes it easy to take the address of C global objects, access C global variables, call from SML to C, and call from C to SML. MLton also provides ML-NLFFI, which is a higher-level FFI for calling C functions and manipulating C data from SML.

## Overview

- Foreign Function Interface Types

- Foreign Function Interface Syntax

## Importing Code into SML

- Calling From SML To C

- Calling From SML To C Function Pointer

## Exporting Code from SML

- Calling From C To SML

## Building System Libraries

- Library Support