{"id":21866870,"url":"https://github.com/rootmos/silly-k","last_synced_at":"2026-02-15T00:32:56.025Z","repository":{"id":82434329,"uuid":"89165522","full_name":"rootmos/silly-k","owner":"rootmos","description":"silly-k is an experimental language inspired by K and APL","archived":false,"fork":false,"pushed_at":"2024-10-27T04:54:46.000Z","size":131,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-06T02:37:03.303Z","etag":null,"topics":["apl","k","lambda-calculus","malfunction","nanopass","scheme"],"latest_commit_sha":null,"homepage":"https://rootmos.io/2017-06-08-implementing-a-k-like-language-targeting-malfunction.html","language":"Scheme","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-04-23T19:07:12.000Z","updated_at":"2025-10-03T23:11:31.000Z","dependencies_parsed_at":"2025-03-21T21:37:28.373Z","dependency_job_id":null,"html_url":"https://github.com/rootmos/silly-k","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rootmos/silly-k","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fsilly-k","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fsilly-k/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fsilly-k/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fsilly-k/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootmos","download_url":"https://codeload.github.com/rootmos/silly-k/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootmos%2Fsilly-k/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29461911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T22:42:09.113Z","status":"ssl_error","status_checked_at":"2026-02-14T22:42:05.053Z","response_time":53,"last_error":"SSL_read: 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":["apl","k","lambda-calculus","malfunction","nanopass","scheme"],"created_at":"2024-11-28T05:07:46.698Z","updated_at":"2026-02-15T00:32:56.008Z","avatar_url":"https://github.com/rootmos.png","language":"Scheme","readme":"# silly-k\n[![Build, test and push image](https://github.com/rootmos/silly-k/actions/workflows/build-test-push.yaml/badge.svg)](https://github.com/rootmos/silly-k/actions/workflows/build-test-push.yaml)\n\n`silly-k` is an experimental language inspired by [K](https://web.archive.org/web/20230411111549/https://kparc.com/k.txt)\nand [APL](https://en.wikipedia.org/wiki/APL_(programming_language)),\nwith an [accompanying post](https://rootmos.io/2017-06-08-implementing-a-k-like-language-targeting-malfunction.html).\n\nThe silly prefix is meant to indicate that this is project is nothing more than an experiment\nto see how these languages would perform when described in lambda calculus terms.\n\nThe compiler is written for the [nanopass framework](https://github.com/nanopass/nanopass-framework-scheme)\nusing the following structure:\n* the `K`-like, `APL` inspired, syntax is translated into something like\n  [simply typed lambda calculus](https://en.wikipedia.org/wiki/Simply_typed_lambda_calculus)\n  which is used to resolve the overloaded symbols from K,\n* after that, the types are thrown away and is compiled to\n  [Malfunction](https://github.com/stedolan/malfunction) or to\n  [Scheme](https://en.wikipedia.org/wiki/Scheme_(programming_language)) (which is used mainly for\n  quick tests and the REPL).\n\n## Usage\nEasiest way to play around with it is to run the [Docker image](https://hub.docker.com/r/rootmos/silly-k/):\n```\nrlwrap docker run --rm -it rootmos/silly-k\n```\nwhich starts the REPL (under [rlwrap](https://github.com/hanslub42/rlwrap)).\n\n## Examples\nHere's some examples of the syntax, taken directly from the [tests](https://github.com/rootmos/silly-k/blob/master/tests.scm):\n\nCode | Stdin | Stdout\n---- | ----- | ------\n`]7` | | `7`\n`]1 2 3` | | `1 2 3`\n`]1=2` | | `0`\n`]2=2` | | `1`\n`]2\u003c3` | | `1`\n`]2\u003c2` | | `0`\n`]3\u003c2` | | `0`\n`]1\u003c1 2 3` | | `0 1 1`\n`]1 2 3\u003e2` | | `0 0 1`\n`]2\u003e3` | | `0`\n`]2\u003e2` | | `0`\n`]3\u003e2` | | `1`\n`]{w\u003e1}'1 2 3` | | `0 1 1`\n`]3\u003e1 2 3` | | `1 1 0`\n`]1 2 3\u003e2` | | `0 0 1`\n`]1=2` | | `0`\n`]2=2` | | `1`\n`]{w=2}'1 2 3` | | `0 1 0`\n`]1 2 3=3` | | `0 0 1`\n`]1=1 2 3` | | `1 0 0`\n`]~1=2` | | `1`\n`]~2=2` | | `0`\n`]~0` | | `1`\n`]~7` | | `0`\n`]~2=1 2 3` | | `1 0 1`\n`](1=2)\\|2=3` | | `0`\n`](1=2)\\|2=2` | | `1`\n`](2=2)\\|2=3` | | `1`\n`](2=2)\\|3=3` | | `1`\n`](1=2)\u00262=3` | | `0`\n`](1=2)\u00262=2` | | `0`\n`](2=2)\u00262=3` | | `0`\n`](2=2)\u00263=3` | | `1`\n`]2\u00263` | | `2`\n`]2\\|3` | | `3`\n`]1+2` | | `3`\n`]1+2 3` | | `3 4`\n`]1 2+3 4` | | `4 6`\n`]1 2+3` | | `4 5`\n`](1=1)+(2=2)` | | `2`\n`]1+(2=2)` | | `2`\n`]1+2=1 2 3` | | `1 2 1`\n`](2=1 2 3)+1` | | `1 2 1`\n`]2-3` | | `-1`\n`]1-(-2)` | | `3`\n`]1 2-3 4` | | `-2 -2`\n`]-7` | | `-7`\n`]-(-2)` | | `2`\n`]1-2 3` | | `-1 -2`\n`]1 2-3` | | `-2 -1`\n`]2*3` | | `6`\n`]1 2*3` | | `3 6`\n`]4*2 3` | | `8 12`\n`]1 2*3 4` | | `3 8`\n`]!1` | | `0`\n`]!4` | | `0 1 2 3`\n`]*1 2 3` | | `1`\n`]*0=0 1` | | `1`\n`]*0=1 0` | | `0`\n`](*0=0 1;7;8)` | | `7`\n`](*0=1 0;7;8)` | | `8`\n`]#1 2 3` | | `3`\n`]#1 2 3 4` | | `4`\n`]4#1 2` | | `1 2 1 2`\n`]3#1` | | `1 1 1`\n`]1 2 3@1` | | `2`\n`]((2=1 2 3)@1;7;8)` | | `7`\n`]((2=1 2 3)@2;7;8)` | | `8`\n`]1 2 3@0 2` | | `1 3`\n`]\u00261 2 3` | | `0 1 1 2 2 2`\n`]7 8@\u00262 3` | | `7 7 8 8 8`\n`]{w+1}'1 2 3` | | `2 3 4`\n`]{1-w}'3 4 5` | | `-2 -3 -4`\n`]2{a+w}'3 4 5` | | `5 6 7`\n`]2{w-a}'3 4 5` | | `1 2 3`\n`]2+'3 4 5` | | `5 6 7`\n`]2-'3 4 5` | | `-1 -2 -3`\n`]{w@1}'{+w}'1 2 3` | | `2 3 4`\n`]{w@1}'{-w}'1 2 3` | | `0 -1 -2`\n`]+/1 2 3` | | `6`\n`]-/1 2 3` | | `2`\n`]{w-a}/1 2 3` | | `0`\n`]+/2\u003c!5` | | `2`\n`]\u0026/0\u003c1 2 3` | | `1`\n`]\u0026/0\u003c1 0 3` | | `0`\n`]1:` | `7` | `7`\n`]0:` | `1 2 3` | `1 2 3`\n`](1:)+1` | `7` | `8`\n`]1+0:` | `1 2 3` | `2 3 4`\n`](0:)+1:` | `2\\n1 2 3` | `3 4 5`\n`](1=1;2;3)` | | `2`\n`](1=2;1 2;3 4)` | | `3 4`\n`]7{w=1;w;a}1` | | `1`\n`]7{w=1;w;a}8` | | `7`\n`]{w=1;w+1;w=2;w+2;w+3}1` | | `2`\n`]{w=1;w+1;w=2;w+2;w+3}2` | | `4`\n`]{w=1;w+1;w=2;w+2;w+3}3` | | `6`\n`]{w=1;w+1;w=2;w+2;w+3}4` | | `7`\n`](1=1;2;3)` | | `2`\n`]{w=0;0;w+_f(w-1)}6` | | `21`\n`]{w=1;1;w=2;1;(_f(w-2))+_f(w-1)}1:` | `7` | `13`\n`]x+x:7` | | `14`\n`](x:1)+x:2` | | `3`\n`]x+(x:1)+x:2` | | `4`\n`]x+x{x:1+a-w}x:2` | | `3`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootmos%2Fsilly-k","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootmos%2Fsilly-k","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootmos%2Fsilly-k/lists"}