{"id":24865473,"url":"https://github.com/melsman/mlkit","last_synced_at":"2026-01-16T22:56:06.326Z","repository":{"id":17247960,"uuid":"20017252","full_name":"melsman/mlkit","owner":"melsman","description":"Standard ML Compiler and Toolkit","archived":false,"fork":false,"pushed_at":"2026-01-11T15:37:12.000Z","size":49694,"stargazers_count":296,"open_issues_count":16,"forks_count":32,"subscribers_count":14,"default_branch":"master","last_synced_at":"2026-01-12T18:34:23.075Z","etag":null,"topics":["compiler","functional-programming","regions","standard-ml"],"latest_commit_sha":null,"homepage":"http://melsman.github.io/mlkit","language":"Standard ML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/melsman.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-05-21T10:22:11.000Z","updated_at":"2026-01-11T15:37:16.000Z","dependencies_parsed_at":"2025-12-09T03:04:08.500Z","dependency_job_id":null,"html_url":"https://github.com/melsman/mlkit","commit_stats":{"total_commits":2348,"total_committers":16,"mean_commits":146.75,"dds":0.6239352640545145,"last_synced_commit":"9a156dfac17e54fc9fd42a7d14438215889d38f5"},"previous_names":[],"tags_count":90,"template":false,"template_full_name":null,"purl":"pkg:github/melsman/mlkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melsman%2Fmlkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melsman%2Fmlkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melsman%2Fmlkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melsman%2Fmlkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/melsman","download_url":"https://codeload.github.com/melsman/mlkit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melsman%2Fmlkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28486939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T22:54:02.790Z","status":"ssl_error","status_checked_at":"2026-01-16T22:50:10.344Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","functional-programming","regions","standard-ml"],"created_at":"2025-01-31T23:59:48.017Z","updated_at":"2026-01-16T22:56:06.296Z","avatar_url":"https://github.com/melsman.png","language":"Standard ML","funding_links":[],"categories":[],"sub_categories":[],"readme":"## MLKit\n\nThe [MLKit](http://elsman.com/mlkit) is a compiler toolkit for the\nStandard ML language, including **The MLKit with Regions**, which features a native\nbackend for the x64 architecture, based on region inference, and\n**SMLtoJs**, which features a JavaScript backend targeting web browsers. The two\ncompilers share the same frontend and compilation management scheme.\n\nThe MLKit covers all of Standard ML, as defined in the 1997 edition of\n[The Definition of Standard ML](https://mitpress.mit.edu/books/definition-standard-ml-revised-edition) and supports most of the [Standard ML\nBasis Library](http://elsman.com/mlkit/basis.html).\n\n## Test Statistics and Benchmarking\n\n[![CI](https://github.com/melsman/mlkit/workflows/CI/badge.svg)](https://github.com/melsman/mlkit/actions) [Benchmarking](https://elsman.com/mlkit-bench/)\n\n## Installation\n\nUnder macOS, MLKit is available through Homebrew: Just execute `brew\ninstall mlkit`. Under Linux, you may download the latest binary\ntgz-distribution of MLKit from\nhttps://github.com/melsman/mlkit/releases/latest\n\nOnce downloaded and unpacked, execute `make install` from within the\ntop-directory of the unpacked distribution. You may install MLKit in a\ndirectory different from `/usr/local/mlkit` by instead typing\n`PREFIX=myinstallpath make install`.\n\n## Features\n\n- **Compiles all of Standard ML**. The MLKit compiles all of Standard ML, [including Modules](http://elsman.com/mlkit/staticinterp.html), as specified by\n  the Definition of Standard ML. The MLKit also supports most of the\n  [Standard ML Basis Library](http://elsman.com/mlkit/basis.html).\n\n- **Compiles large programs**. The MLKit compiles large programs,\n  [including itself](http://elsman.com/mlkit/bootstrap.html), around\n  80.000 lines of Standard ML plus the Standard ML Basis Library. The\n  support for [ML Basis\n  Files](http://elsman.com/mlkit/mlbasisfiles.html) makes it easy to\n  compile a program with different Standard ML compilers. Currently,\n  both [MLton](http://mlton.org) and the MLKit supports the concept of\n  ML Basis Files. The MLKit works well together with\n  [smlpkg](https://github.com/diku-dk/smlpkg), a generic package\n  manager for Standard ML libraries and programs.\n\n- **Documentation is available**. Man-pages and general documentation\n  is available from the [MLKit home\n  page](http://melsman.github.io/mlkit).\n\n## MLKit with Regions - The x64 Native Backend\n\nThis version of the compiler is based on region inference and has the\nfollowing features:\n\n- An x64 native backend (works with Linux and macOS).\n\n- Memory allocation directives (both allocation and deallocation) are\n  inferred by the compiler, which uses a number of program analyses\n  concerning lifetimes and storage layout. The MLKit compiler is\n  unique among ML implementations in this respect.\n\n- A comprehensive guide on [Programming with Regions in the\n  MLKit](https://github.com/melsman/mlkit/raw/master/doc/mlkit.pdf) is available,\n  which also demonstrates how to create memory profiles of program\n  executions using the supplied region profiler and how to interact\n  with C programs.\n\n- Region inference may be augmented with reference-tracing garbage\n  collection to achieve better memory behavior.\n\n## SMLtoJs - The JavaScript Backend\n\nThis version of the compiler generates efficient JavaScript, primarily\nfor [executing Standard ML code in the\nbrowser](/README_SMLTOJS.md). There is also an [online version of\nSMLtoJs](https://diku-dk.github.io/sml-ide/), which makes it possible\nto write, compile, and execute Standard ML code in a web browser.\n\n## The Barry Backend\n\nThe repository also includes the sources for\n[Barry](/README_BARRY.md), a Standard ML source-to-source compiler\nthat eliminates modules, using static interpretation, and generates\noptimised Core-language Standard ML code.\n\n## License and Copyright\n\nThe MLKit compiler is distributed under the GNU Public License,\nversion 2. See the file [MLKit-LICENSE](/doc/license/MLKit-LICENSE)\nfor details. The runtime system (`/src/Runtime/`) and libraries\n(`basis/`) is distributed under the more liberal MIT License.\n\n## Compilation Requirements\n\nTo compile, install, and use the MLKit, a Linux box running Ubuntu\nLinux, Debian, gentoo, or similar is needed. The MLKit also works on\nmacOS and has also earlier been reported to run on the FreeBSD/x64\nplatform, with a little tweaking.\n\nTo compile the MLKit, a Standard ML compiler is needed, which needs to\nbe one of the following:\n\n__[MLton](http://mlton.org) \u003e= 20051202:__\n```bash\n$ mlton\nMLton 20051202 (built Sat Dec 03 04:20:11 2005 on pavilion)\n```\n\nIf a version prior to 20201023 is used, you may need to adjust the\n`mlton`-flags setup in the file `Makefiledefault`.\n\n__A working MLKit compiler \u003e= 4.3.0:__\n```bash\n$ mlkit -V\nMLKit version 4.3.0, Jan 25, 2006 [X86 Backend]\n```\n\nMoreover, `gcc` is needed for compiling the runtime system and related\ntools.\n\n## Compilation\n\nAfter having checked out the sources from Github, execute the command:\n```bash\n$ ./autobuild\n```\n\nNow, `cd` to the toplevel directory of the repository and execute the\nappropriate set of commands:\n\n__Compile with MLton alone (Tested with 3Gb RAM):__\n```bash\n$ ./configure\n$ make mlkit\n```\n\n__Compile with existing MLKit (Tested with 1Gb RAM):__\n```bash\n$ ./configure --with-compiler=mlkit\n$ make mlkit\n```\n\nIf you later want to install the MLKit in your own home directory, you\nshould also pass the option `--prefix=$HOME/mlkit` to `./configure` above.\n\nFor binary packages, we use\n```bash\n$ ./configure --sysconfdir=/etc --prefix=/usr\n```\n\n## Pre-compile Basis Library and Kit-Library\n\nExecute the following command:\n```bash\n$ make mlkit_libs\n```\n\n## Bootstrapping (optional - works with 1Gb RAM)\n\nThis step is optional. If you want the resulting executable compiler\nto be bootstrapped (compiled with itself), execute the command:\n```bash\n$ make bootstrap \u0026\u0026 make mlkit_libs\n```\n\nBe aware that this step takes some time.\n\n## Installation after Compilation\n\nFor a system-wide installation of the MLKit, including installation of\nman-pages and tools, execute the command:\n```bash\n$ sudo make install\n```\n\nFor a personal installation, with `--prefix=$HOME/mlkit` given to\n`./configure`, execute the following command:\n```bash\n$ make install\n```\n\n## Making a Binary Package\n\nTo build a binary package, execute the command\n```bash\n$ make mlkit_x64_tgz\n```\n\nThis command leaves a package `mlkit-X.Y.Z-x64.tgz` in the `dist/`\ndirectory. For building a binary package, the installation step above\nis not needed and the bootstrapping step is optional. The binary package includes both the MLKit with Regions compiler (i.e., the `mlkit` executable) and [SMLtoJs](/README_SMLTOJS.md) (i.e., an executables named `smltojs`).\n\n## Try It\n\nTo test the installation, copy the directory `/usr/share/mlkit/kitdemo` to\nsomewhere in your own directory, say `$HOME/kitdemo`:\n```bash\n$ cp -a /usr/share/mlkit/kitdemo $HOME/kitdemo\n$ cd $HOME/kitdemo\n$ mlkit helloworld.sml\n```\n\nThe MLKit should produce an executable file `run`:\n```bash\n$ ./run\nhello world\n```\n\n## Trying Without Installing\n\nYou can run `mlkit` without installing it, but you should then point\nthe environment variable `SML_LIB` at the build directory (which\ncontains the `basis` and the `lib` directories) whenever you run\n`mlkit`.  E.g:\n\n```bash\n$ SML_LIB=$PWD bin/mlkit\n```\n\n## More Information\n\nSee the [MLKit home page](http://melsman.github.io/mlkit) for information about related papers, etc.\n\nGeneral documentation for the MLKit is located in the directories `doc/mlkit`\nand `man/man1`. License information is located in the file\n`doc/license/MLKit-LICENSE`.\n\n## Comments and Bug Reports\n\nThe MLKit has a number of [known bugs and limitations](http://elsman.com/mlkit/bugs.html). To file a bug-report, create an issue at the Github page.\n\n## Appendix A: Directory Structure of the Sources\n\n    kit/\n       README\n       configure\n       Makefile.in\n       src/\n       basis/\n       doc/mlkit.pdf\n          /license/MLKit-LICENSE\n       man/man1/rp2ps.1\n       kitdemo/\n       test/\n\n## Appendix B: Quick Compilation and Installation Guide\n\nWe assume that MLton \u003e= 20051202 is installed on the system as\ndescribed above.\n\nAfter having checked out the sources from Github, execute the command:\n```bash\n$ ./autobuild\n```\n\nTo compile the MLKit, execute the following commands:\n```bash\n$ ./configure\n$ make mlkit\n$ make bootstrap\n$ make mlkit_libs\n```\n\nThe `make bootstrap` command is optional.\n\nTo install the MLKit and related tools, execute:\n```bash\n$ sudo make install\n```\n\nSee the section \"Try It\" above to test the installation.\n\n## Appendix C: Displaying Region Flow Graphs with VCG\n\nThe [VCG tool](http://www.cs.uni-sb.de/RW/users/sander/html/gsvcg1.html) can be used to show region flow graphs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelsman%2Fmlkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelsman%2Fmlkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelsman%2Fmlkit/lists"}