{"id":16397523,"url":"https://github.com/coord-e/mlml","last_synced_at":"2025-03-21T02:32:32.293Z","repository":{"id":115892123,"uuid":"179444267","full_name":"coord-e/mlml","owner":"coord-e","description":"self-hosted compiler for a subset of OCaml","archived":false,"fork":false,"pushed_at":"2019-06-12T13:36:31.000Z","size":740,"stargazers_count":51,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-03-14T23:07:37.515Z","etag":null,"topics":["compiler","ocaml","self-hosted"],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coord-e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-04-04T07:24:20.000Z","updated_at":"2025-03-13T21:48:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"0f780f1b-0248-4911-a0b9-ef6905dde5d4","html_url":"https://github.com/coord-e/mlml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coord-e%2Fmlml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coord-e%2Fmlml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coord-e%2Fmlml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coord-e%2Fmlml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coord-e","download_url":"https://codeload.github.com/coord-e/mlml/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244725589,"owners_count":20499633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","ocaml","self-hosted"],"created_at":"2024-10-11T05:10:19.644Z","updated_at":"2025-03-21T02:32:31.902Z","avatar_url":"https://github.com/coord-e.png","language":"OCaml","readme":"# mlml\n\n[![Build Status](https://travis-ci.com/coord-e/mlml.svg?branch=develop)](https://travis-ci.com/coord-e/mlml)\n[![Coverage Status](https://coveralls.io/repos/github/coord-e/mlml/badge.svg)](https://coveralls.io/github/coord-e/mlml)\n![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/coorde/mlml.svg)\n![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/coorde/mlml.svg)\n[![MicroBadger Image](https://images.microbadger.com/badges/image/coorde/mlml.svg)](https://microbadger.com/images/coorde/mlml)\n\nmlml is a self-hosted toy compiler for a tiny subset of OCaml.\n\na detailed description can be found in my blog post (in Japanese): [自作OCamlコンパイラでセルフホストした - molecular coordinates](https://coordination.hatenablog.com/entry/2019/05/23/212720)\n\n## roadmap\n\n- [x] basic arithmetic\n- [x] variables\n- [x] if-then-else\n- [x] functions\n  - [x] recursion\n  - [x] mutual recursion\n  - [x] closure\n  - [x] currying\n- [x] tuples\n- [x] variants\n- [x] records\n- [x] pattern matching\n- [x] structual comparison\n- [x] primitive types\n  - [x] string\n  - [x] list\n  - [x] bytes\n  - [x] array\n- [x] formatted output with `Printf`\n- [x] modules\n  - [x] definition\n  - [x] aliases\n  - [x] `open`\n  - [x] dune-like bundler\n- [x] **self-hosting!**\n- [ ] exceptions\n- [ ] type checker \u0026 type inference\n\n## self hosting\n\nmlml is self-hosted. i.e. mlml can compile itself.\n\n```shell\n./dev/exec.sh ./dev/self_host.sh\n```\n\nTo obtain build artifacts, pass a path to local directory as below. You will see compiled binaries under `./self_host`.\n\n```shell\nmkdir self_host\n./dev/exec.sh ./dev/self_host.sh ./self_host\n```\n\n## limitations\n\n- `external` definitions are only available for functions\n- all modules and paths are statically-resolved\n- all custom oeprators are left-associative\n- `function` keyword does not make an expression\n\n## development\n\nIf you have docker installed in your system, simply run\n\n```shell\n./dev/start.sh\n```\n\nto start the development.\n\nYou can run tests manually by running the following command:\n\n```shell\n./dev/exec.sh dune runtest\n```\n\n## thanks\n\nThe code and algorithm in parser and lexer is strongly inspired by [ushitora-anqou/aqaml](https://github.com/ushitora-anqou/aqaml)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoord-e%2Fmlml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoord-e%2Fmlml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoord-e%2Fmlml/lists"}