Releases: shwestrick/smlfmt
Releases · shwestrick/smlfmt
Release list
v1.3.0 (Jan 1, 2026)
v1.2.0 (May 2, 2025)
A couple new features in this release:
- #100: better formatting for monadic-do-style infix expressions
- #99: expanded support for SuccessorML features, and
-allow-successor-mlcommand-line flag
And bugfixes:
- #95: fix Makefile install target
Thank you @ii8, @DarinM223, @p-ouellette for your contributions!
v1.1.0 (Nov 2, 2023)
In this release:
- #77:
--safety-checkflag for checking that the output ofsmlfmtis correct, i.e., that the result is valid SML that exactly matches the source except for whitespace.- Note: originally called
--checkbut renamed to--safety-checkin #92.
- Note: originally called
- #84, #86: allow passing input and output through
stdinandstdout.- For example:
echo "val x = 5 val y = 6" | ./smlfmtorcat test.sml | ./smlfmt > output.sml
- For example:
- #87:
--read-onlyflag, useful for checking for syntax errors - #93:
make installformula - #92:
--checkflag, to check if a file has already been formatted. Useful for CI. - Some bugfixes and other small improvements, e.g., 656885b 4d1952a
Also note that https://github.com/diku-dk/smlfmt.el offers Emacs integration for smlfmt.
Thanks @kopecs @p-ouellette @brandonspark @athas @ratsclub for your contributions!
v1.0.0 (Jan 10, 2023)
smlfmt is a custom parser and code formatter for Standard ML.
Features
- Full support for Standard ML according to the formal definition.
- Fast -- see performance results below.
- Usable for large projects.
- Whole-project formatting via
.mlbfiles using MLton conventions.
- Whole-project formatting via
- Helpful error messages with visual code references and syntax highlighting.
- Support for various SuccessorML syntax extensions.
- Configurable indentation size and maximum width.
Performance
smlfmt is fast enough for live reformatting on large individual files, and can reformat large projects in seconds.
Here are measurements for smlfmt --preview-only INPUT > out on my MacBook Air (M2, 2022).
| Input | Size (LoC) | Time |
|---|---|---|
src/prettier-print/PrettierExpAndDec.sml |
1024 | 31 ms |
src/base/PrettyTabbedDoc.sml |
1349 | 29 ms |
src/parse/ParseExpAndDec.sml |
1363 | 28 ms |
MLton elaborate-core.fun |
3942 | 104 ms |
MLton x86-allocate-registers.fun |
11034 | 216 ms |
Entire MLton source code (mlton.mlb) |
160000 (approx.) | 6.6s |
(Timings are averages reported by hyperfine.)