{"id":21866897,"url":"https://github.com/rootmos/silly-ml","last_synced_at":"2025-04-14T22:21:35.512Z","repository":{"id":82434341,"uuid":"95769674","full_name":"rootmos/silly-ml","owner":"rootmos","description":"A small ML-like, type-checked, interpreted or x86-64 compiled, language created because it's weekend","archived":false,"fork":false,"pushed_at":"2017-07-23T12:09:12.000Z","size":231,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-03-16T02:02:10.266Z","etag":null,"topics":["compiler","experimental","functional-language","ocaml","silly","x86-64"],"latest_commit_sha":null,"homepage":"","language":"OCaml","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/rootmos.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":"2017-06-29T11:11:01.000Z","updated_at":"2024-03-16T02:02:10.266Z","dependencies_parsed_at":"2023-06-15T16:30:15.284Z","dependency_job_id":null,"html_url":"https://github.com/rootmos/silly-ml","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/rootmos%2Fsilly-ml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fsilly-ml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fsilly-ml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fsilly-ml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootmos","download_url":"https://codeload.github.com/rootmos/silly-ml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248969071,"owners_count":21191187,"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","experimental","functional-language","ocaml","silly","x86-64"],"created_at":"2024-11-28T05:07:51.825Z","updated_at":"2025-04-14T22:21:35.481Z","avatar_url":"https://github.com/rootmos.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"silly-ml\n========\n[![Build, test and push image](https://github.com/rootmos/silly-ml/actions/workflows/build-test-push.yaml/badge.svg)](https://github.com/rootmos/silly-ml/actions/workflows/build-test-push.yaml)\n\n`silly-ml` (aka [vacation-ml](https://en.wikipedia.org/wiki/Summer)) is a:\n* small ML-like, type-checked language,\n* interpreted in a REPL or compiled to x86-64 assembly (with garbage getting both marked and sweeped),\n* created because [it's weekend](https://www.isittheweekendyet.com/) and because I haven't written one before,\n* coded in [OCaml](https://ocaml.org/) and inspired by [OCaml](https://github.com/ocaml/ocaml).\n\n_Disclaimer:_ the silly prefix indicates that this is a hobby project with no other\npurpose than to learn and explore and it should definently be interpreted as an\nhomage to its big brothers.\n\nUsage\n-----\nSimplest way to try it out is by using Docker:\n```\ndocker run -it rootmos/silly-ml\n```\nand maybe use [rlwrap](https://man.archlinux.org/man/rlwrap.1) to get a proper REPL feeling with line editing, history etc.\n\nExamples\n--------\nHere's an [example session](repl.expect) from the REPL:\n```\n\u003e 7;;\n7: int\n\u003e type foo = A | B of int;;\n\u003e A;;\nA: foo\n\u003e B 7;;\nB 7: foo\n\u003e let f x = match x with A -\u003e 0 | B i -\u003e i;;\n\u003e f;;\n\u003cfun\u003e: foo -\u003e int\n\u003e f A;;\n0: int\n\u003e f (B 3);;\n3: int\n\u003e type bar = C of foo;;\n\u003e C A;;\nC A: bar\n\u003e f (C A);;\ntyped error: unification failed\n\u003e ((), 7);;\n((), 7): (unit, int)\n\u003e 3 * (7 - (1 + 2));;\n12: int\n\u003e let x = 7;;\n\u003e print_int x;; print_newline ();;\n7\n(): unit\n\u003e let f x y = x + y;;\n\u003e f;;\n\u003cfun\u003e: int -\u003e int -\u003e int\n\u003e let g = f 1;;\n\u003e g;;\n\u003cfun\u003e: int -\u003e int\n\u003e let h = f 2;;\n\u003e h;;\n\u003cfun\u003e: int -\u003e int\n\u003e g 2;;\n3: int\n\u003e h 2;;\n4: int\n\u003e let sum n = let rec go acc i = match i with 0 -\u003e acc | _ -\u003e go (acc + i) (i - 1) in go 0 n;;\n\u003e sum;;\n\u003cfun\u003e: int -\u003e int\n\u003e sum 6;;\n21: int\n\u003e let rec fib n = match n with 0 -\u003e 0 | 1 -\u003e 1 | n -\u003e (fib (n - 1)) + (fib (n - 2));;\n\u003e fib 5;;\n5: int\n\u003e fib 6;;\n8: int\n\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootmos%2Fsilly-ml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootmos%2Fsilly-ml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootmos%2Fsilly-ml/lists"}