{"id":15312552,"url":"https://github.com/giulioz/mlem","last_synced_at":"2025-10-25T23:02:56.143Z","repository":{"id":102688664,"uuid":"197006159","full_name":"giulioz/MLem","owner":"giulioz","description":"👨🏼‍💻👅 A Tiny ML-like language for research purposes","archived":false,"fork":false,"pushed_at":"2023-07-12T00:23:39.000Z","size":128,"stargazers_count":6,"open_issues_count":6,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-15T01:14:45.802Z","etag":null,"topics":["compiler","functional","haskell","language","ml","nearley","ocaml","parser","types"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/giulioz.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2019-07-15T13:39:41.000Z","updated_at":"2023-01-29T21:43:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"c3e7dcbe-fc1d-493d-9214-5c8d7deb550d","html_url":"https://github.com/giulioz/MLem","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"18a5400a4c831a96bc3bcf94006724390be219c0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giulioz%2FMLem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giulioz%2FMLem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giulioz%2FMLem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giulioz%2FMLem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giulioz","download_url":"https://codeload.github.com/giulioz/MLem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986315,"owners_count":21194025,"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","functional","haskell","language","ml","nearley","ocaml","parser","types"],"created_at":"2024-10-01T08:37:33.257Z","updated_at":"2025-10-25T23:02:56.063Z","avatar_url":"https://github.com/giulioz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MLem\n\n**Meta Language Extensions and Manipulation**\n\n![logo](logo.png)\n\n### Syntax\n\nWhole program is a big expression, use parentheses to avoid ambiguities.\n\n- `let` binding\n```\nlet name = value; expression\n```\n\n- Function apply — functions have only one parameter\n```\ninc 2\n```\n\n- Lambda abstraction\n```\n\\x -\u003e x\n```\n\n- Pattern matching\n```\nmatch exp with\n| case -\u003e value\n| _ -\u003e fallback\n```\n\n- Data Types\n  - Numeric integer literal `number`\n  - Tuples `(a,b,...)`\n  - String literal, between `\"\"`\n\n- Custom Types:\n```\ntype Boolean = true | false;\ntype MaybeTwo = Just of number * number | Nothing;\n```\n\nUse Y Combinator for recursion (native recursion not yet supported).\n\n#### Example program\n\n```\ntype Boolean = true | false;\ntype MaybeTwo = Just of number * number | Nothing;\n\nlet Y = \\f -\u003e ((\\x -\u003e (x x)) (\\y -\u003e (f (\\x -\u003e ((y y) x)))));\nlet sub = \\x -\u003e \\y -\u003e (sum x (neg y));\n\nlet fibonacci = Y (\\f -\u003e \\x -\u003e\n  match x with\n  | 0 -\u003e 0\n  | 1 -\u003e 1\n  | x -\u003e (\n    let a = (sub x) 1;\n    let b = (sub x) 2;\n    let fa = f a;\n    let fb = f b;\n    sum fa fb\n  )\n);\n\nmatch (fibonacci 8) with\n| 21 -\u003e true\n| _ -\u003e false\n```\n\n### Usage\n\nPlace your code in `test.mml`.\n\n```\nyarn install\nyarn start\n```\n\n#### Rebuild grammar\n\n```\nyarn build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiulioz%2Fmlem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiulioz%2Fmlem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiulioz%2Fmlem/lists"}