# Install mlton with Homebrew, dnf, MacPorts, Nix, pacman, apt

Whole-program, optimizing compiler for Standard ML. Version 20241230 via Homebrew; verified 2026-06-22. Also installable with nix: nix profile install nixpkgs#mlton.

## Install

```sh
sudo av install brew:mlton
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install mlton
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install mlton
```

  Evidence: MacPorts ports tree: lang/mlton/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- dnf (92%):

```sh
sudo dnf install mlton
```

  Evidence: Fedora Rawhide package metadata: mlton from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#mlton
```

  Evidence: nixpkgs package indexes: mlton from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S mlton
```

  Evidence: Arch Linux sync databases: mlton from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- Ubuntu apt (92%):

```sh
sudo apt install mlton
```

  Evidence: Ubuntu 24.04 LTS package indexes: mlton from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz

## Package facts

- **Package key:** brew:mlton
- **Package manager:** Homebrew
- **Version:** 20241230
- **Source summary:** Whole-program, optimizing compiler for Standard ML
- **Homepage:** <http://mlton.org>
- **Repository:** <https://github.com/MLton/mlton>
- **Last updated:** 2026-06-22T14:05:30-07:00
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

- mllex (alias)
- mlnlffigen (alias)
- mlprof (alias)
- mlton (alias)
- mlyacc (alias)

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-08-03
- Package-manager version: 20241230
## Project history and usage

MLton grew out of Standard ML compiler research in the late 1990s. The project history traces its start to April 1997, when Stephen Weeks wrote a defunctorizer for Standard ML and integrated it with SML/NJ. That origin explains the shape of the compiler: MLton is not an interactive SML environment, but a whole-program compiler that takes the complete program as input and uses that global view for optimization.

### Project history

The project became known in the Standard ML community for aggressive whole-program optimization and standalone native executables. Its own repository describes support for SML97, a complete Standard ML Basis Library, the ML Basis system, a C foreign-function interface, source-level profiling, mllex, mlyacc, and mlnlffigen. The implementation emphasizes small executables and runtime performance through unboxed representations, native arrays, GMP-backed arbitrary precision arithmetic, multiple code generators, and multiple garbage-collection strategies.

### How it is used

In package-manager terms, MLton occupies the serious native-code SML compiler niche alongside SML/NJ, Poly/ML, and MLKit rather than the lightweight scripting or teaching niche. It is used when SML code needs to be compiled into fast standalone programs, when whole-program analysis is useful, or when tools from the MLton distribution such as mllex, mlyacc, and mlprof are part of the workflow.

### Sources

- <http://mlton.org/History>
- <https://formulae.brew.sh/formula/mlton>
- <https://github.com/MLton/mlton>
- <https://icfpconference.org/archived/icfp2001/cristal.inria.fr/ICFP2001/Abstracts/48.html>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Other Package-Manager Records

- Nix - mlton: normalized package name match | nixpkgs package indexes: mlton from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - mlton - 20210117+dfsg-3: normalized package name match | Ubuntu 24.04 LTS package indexes: mlton from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Optimizing compiler for Standard ML | http://mlton.org/
- Ubuntu apt - mlton-basis - 20210117+dfsg-3: normalized package name match | Ubuntu 24.04 LTS package indexes: mlton-basis from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Optimizing compiler for Standard ML - basis library | http://mlton.org/
- Ubuntu apt - mlton-compiler - 20210117+dfsg-3: normalized package name match | Ubuntu 24.04 LTS package indexes: mlton-compiler from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Optimizing compiler for Standard ML - compiler | http://mlton.org/
- Ubuntu apt - mlton-doc - 20210117+dfsg-3: normalized package name match | Ubuntu 24.04 LTS package indexes: mlton-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Optimizing compiler for Standard ML - documentation | http://mlton.org/
- Ubuntu apt - mlton-runtime-native - 20210117+dfsg-3: normalized package name match | Ubuntu 24.04 LTS package indexes: mlton-runtime-native from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Optimizing compiler for Standard ML - native runtime libraries | http://mlton.org/
- Ubuntu apt - mlton-runtime-x86-64-linux-gnu - 20210117+dfsg-3: normalized package name match | Ubuntu 24.04 LTS package indexes: mlton-runtime-x86-64-linux-gnu from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Optimizing compiler for Standard ML - amd64 runtime libraries | http://mlton.org/
- Ubuntu apt - mlton-tools - 20210117+dfsg-3: normalized package name match | Ubuntu 24.04 LTS package indexes: mlton-tools from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Optimizing compiler for Standard ML - tools | http://mlton.org/
- dnf - mlton - 20210117-13.fc45: normalized package name match | Fedora Rawhide package metadata: mlton from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Optimizing compiler for Standard ML | http://mlton.org/
- pacman - mlton - 20241230-1: normalized package name match | Arch Linux sync databases: mlton from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Whole-program optimizing Standard ML compiler | http://mlton.org/
- MacPorts - mlton: normalized package name match | MacPorts ports tree: lang/mlton/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/mlton.yml](https://github.com/mxcl/pkgdb/blob/main/combined/mlton.yml)


## Sources

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
