{"id":23251465,"url":"https://github.com/dplassgit/smallest","last_synced_at":"2026-03-08T17:34:54.411Z","repository":{"id":235037246,"uuid":"789946363","full_name":"dplassgit/smallest","owner":"dplassgit","description":"\"Smallest Possible Language\" - a self-hosted compiler","archived":false,"fork":false,"pushed_at":"2025-05-16T17:10:51.000Z","size":136,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2025-06-06T06:02:44.740Z","etag":null,"topics":["compiler","compiler-construction","self-hosted","toy-language"],"latest_commit_sha":null,"homepage":"","language":"Assembly","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/dplassgit.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-22T01:01:40.000Z","updated_at":"2025-05-16T17:10:55.000Z","dependencies_parsed_at":"2025-06-06T06:02:45.863Z","dependency_job_id":"e073d497-717f-4425-a3b9-6c7888f51456","html_url":"https://github.com/dplassgit/smallest","commit_stats":null,"previous_names":["dplassgit/smallest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dplassgit/smallest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dplassgit%2Fsmallest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dplassgit%2Fsmallest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dplassgit%2Fsmallest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dplassgit%2Fsmallest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dplassgit","download_url":"https://codeload.github.com/dplassgit/smallest/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dplassgit%2Fsmallest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273046456,"owners_count":25036179,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","compiler-construction","self-hosted","toy-language"],"created_at":"2024-12-19T09:18:28.795Z","updated_at":"2026-03-08T17:34:54.371Z","avatar_url":"https://github.com/dplassgit.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# smallest\n\n\"Smallest Possible Language\" - a self-hosted compiler.\n\n\n## Why!?\n\nFor fun. Design considerations:\n\n* Define the smallest possible (high-level) language that can compile itself.\n* As simple as possible, but no simpler.\n* All keywords and symbols are single-character non-alphanumerics. Some symbols (e.g., `\u003e`) have been omitted. Just use `\u003c` instead.\n* No strings, structs, floats, bytes, or booleans. Well...strings can be represented as arrays, and booleans can be represented as ints.\n* The only data types are ints (32-bits) and arrays of ints.\n \n## Keywords (Symbols)\n\n`;` - comment to end of line\n\n`$` - print the (int) argument as a character\n\n`#` - print the (int) argument as an integer\n\n`~` - while\n\n`? :` - if/else\n\n`^` - return\n\n`@` - input\n\n`_` - define function\n\n`%` - allocate array \n\n`'` - character constant (really just an int)\n\n`\\` - stop/exit\n\nAnd the usual math: `+ - * ( ) [ ] \u0026 | ! = \u003c`\n\nNote: `=` is used for both assignment and comparison. `!` is the \"not equals\" comparison.\n\nThere is no division or modulo or `\u003e` or `\u003e=` or `\u003c=`.\n\nBlocks are separated with parentheses.\n\n\n## Data types\n\nThere are two data types: 32-bit ints and arrays of 32-bit ints.\n\nWhen comparing ints, the result is an int (0 for false, 1 for true.)\n\n\n## Variables\n\nVariables that start with `a` (case sensitive) are arrays of ints. All other \nvariables are ints.\n\nOnly *alphabetic characters* are allowed in variable names. Variable and function\nnames are *case-sensitive*.\n\nVariables can be defined outside functions and are then global for all functions\nto read and modify.\n\n\n## Arrays\n\n### Naming\n\nVariables that start with `a` (case sensitive) are arrays of ints.\n\n### Declaration\n\n```\narr%4\n```\n\nAllocates an array named `arr` of size 4.\n\nArray sizes can be dynamic:\n\n```\narr%(i+3)\n```\n\nAllocates an array of size `i+3`.\n\n### Indexing\n\n```\narr[0] = 34\narr[1] = 65\narr[2] = 34\narr[3] = 0\n```\n\nThe following line is equivalent to `if arr[i] == 0 { println(\"Empty\") }`:\n\n```\n? (arr[i]=0) ( $'E $'m $'p $'t $'y $10 )\n```\n\n### Length\n\nThere is no \"array length\" operator.\n\n\n## Functions\n\n### Naming\n\nOnly alphabetic characters are allowed in function names.\n\nFunctions that start with `v` (case sensitive) are void. Functions that start\nwith `a` (case sensitive) return an array. All other functions return int.\n\n### Declaration \u0026 call\n\nFactorial:\n\n```\n_fact(n) ( ; takes an int, returns an int\n  ? n \u003c 2 ( ^ n)  ; if n \u003c 2 { return n}\n  ^ n * fact(n-1)  ; return n * fact(n-1)\n)\n```\n\nPrint an array as a string:\n\n```\n_vprint(as) (\n  i=0\n  ~ (as[i] ! 0) (   ; while as[i] != 0\n    $ as[i]       ; print as[i] as a character\n    i=i+1\n  )\n)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdplassgit%2Fsmallest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdplassgit%2Fsmallest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdplassgit%2Fsmallest/lists"}