Poly/ML – A Standard ML Implementation
Summary
Poly/ML is a Standard ML implementation compatible with the ML97 standard, known for its fast compiler, foreign function interface, thread library, and use as the preferred implementation for large projects like Isabelle and HOL.
View Cached Full Text
Cached at: 07/07/26, 02:08 AM
polyml/polyml
Source: https://github.com/polyml/polyml
Poly/ML
Poly/ML is a Standard ML implementation originally written in an experimental language called Poly. It has been fully compatible with the ML97 standard since version 4.0. For a full history, see here.
Poly/ML takes a conservative approach to the Standard ML language and avoids incompatible extensions. It has added various library extensions particularly the thread library. Poly/ML’s active development and unique features make it an exceptional implementation.
Table of Contents
Features
- Fast compiler
- Preferred implementation for large projects such as Isabelle and HOL.
- Foreign function interface - allows static and dynamic libraries to be loaded in Poly/ML and exposes their functions as Poly/ML functions. See here for an example of static linking.
- Symbolic debugger
- Windows programming interface
- Thread library - provides a simplified version of Posix threads modified for Standard ML and allows Poly/ML programs to make use of multiple cores. The garbage collector is also parallelised.
Basis
The documentation for the Poly/ML Basis library can be found here and includes information on global values and types as well as structures, signatures and functors. More in-depth documentation can be found at the SML Family website here.
Installation
Poly/ML has native support for i386 (32- and 64-bit) and ARM (64-bit only). It will also work on other architectures using a byte-code interpreter. For more information, see the download page.
Mailing List
There is a mailing list for Poly/ML for questions and support.
Similar Articles
Why ML/OCaml are good for writing compilers (1998)
This article from 1998 argues that ML and OCaml are excellent for writing compilers due to features like garbage collection, tail recursion optimization, and algebraic data types with pattern matching, which simplify handling complex compiler data structures.
Hyperpolyglot Lisp: Common Lisp, Racket, Clojure, Emacs Lisp
A side-by-side reference sheet comparing syntax and features of Common Lisp, Racket, Clojure, and Emacs Lisp.
PluraMath: Extending Mathematical Reasoning Evaluation Beyond High-Resource Languages
PluraMath extends the PolyMath dataset to 18 underrepresented languages, providing a human-validated benchmark for evaluating multilingual mathematical reasoning in LLMs. The paper reveals a persistent performance gap between high-resource and low-resource languages across 27 models.
An MLIR-Based Compilation Method for Large Language Models
This paper presents an MLIR-based compilation method for large language models, using two custom dialects (TopOp and TpuOp) to lower models from framework-agnostic semantics to hardware-specific instructions. It also introduces a three-stage static compilation for autoregressive inference stages: prefill, prefill_kv, and decode.
prism-ml/Ternary-Bonsai-27B-mlx-2bit
Prism ML releases Ternary-Bonsai-27B-mlx-2bit, a ternary-quantized 27B-parameter language model that achieves ~95% of FP16 performance while fitting in ~7.2 GB, enabling full reasoning on laptops.