{"id":20582846,"url":"https://github.com/malted/metax","last_synced_at":"2025-09-03T09:44:14.051Z","repository":{"id":111912457,"uuid":"515151576","full_name":"malted/metax","owner":"malted","description":"An interpreter that runs metaprograms written in languages you create.","archived":false,"fork":false,"pushed_at":"2022-07-18T23:20:58.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-06T12:46:58.115Z","etag":null,"topics":["code-golf","esolang","metaprogramming","trolling"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/malted.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":"2022-07-18T11:15:19.000Z","updated_at":"2022-07-18T23:25:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb70d76b-9e8c-4d1f-86b7-652a24624c1a","html_url":"https://github.com/malted/metax","commit_stats":null,"previous_names":["malted/metax"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/malted/metax","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malted%2Fmetax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malted%2Fmetax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malted%2Fmetax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malted%2Fmetax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malted","download_url":"https://codeload.github.com/malted/metax/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malted%2Fmetax/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273423942,"owners_count":25103145,"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-09-03T02:00:09.631Z","response_time":76,"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":["code-golf","esolang","metaprogramming","trolling"],"created_at":"2024-11-16T06:37:18.466Z","updated_at":"2025-09-03T09:44:13.990Z","avatar_url":"https://github.com/malted.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Metax\nMetax is an interpreter that runs metaprograms written in languages you create. Languages made with Metax most notably do not require code in the file itself, rather, all the rules required to run your program are defined in the language's name.\n\nTake the `'Hello World!'` language as an example. When Metax is run on a file ending in `.'Hello World!'`, the output sent to stdout is `Hello World!`.\n\nAs such, Metax's [Hello World!](https://en.wikipedia.org/wiki/%22Hello,_World!%22_program) program is **0 bytes long**.\n\nThere is no code in the file, yet Metax magically knows what your intentions are with the language. Metax is really ahead of its time.\n\nLanguages made to run on the Metax interpreter use TypeScript rules and syntax.\n\n## Alternative operators\nDue to the nature of how operating systems work with file names and paths, it is impossible to use some characters in your language's name. In order to circumvent this, Metax supports some alternative characters which get replaced with their JavaScript counterparts when your language is run.\n\n`≪` (`U+226A`, much less-than) maps to `\u003c`; JavaScript's [*less than* operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Less_than).\n\n`≫` (`U+226B`, much greater-than) maps to `\u003e`; JavaScript's [*greater than* operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Greater_than).\n\n`×` (`U+00D7`, multiplication sign) maps to `*`; used (most commonly) as JavaScript's [*multiplication* operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Multiplication), but also used in notating [*generator functions*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*)\n\n`÷` (`U+00F7`, obelus) maps to `/`; used as JavaScript's [*division* operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Division).\n\n`§` (`U+00A7`, section sign) maps to `:`; most commonly used to separate keys and values in JavaScript object notation, but also as  [*labels*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label)\n\n`‖` (`U+2016`, double vertical bar) maps to `|`; JavaScript's [*bitwise*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_OR) and [*logical*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR) OR operators.\n\n`‽` (`U+203D`, interrobang) maps to `?`, used in the [*nullish coalescing*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator), [*ternary*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator), [*optional chaining*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining), and [*logical nullish assignment*](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_nullish_assignment) operators.\n\n`¬` (`U+00AC`, not sign) maps to `\\`; is used to denote [*escape characters*](https://en.wikipedia.org/wiki/Escape_character#JavaScript).\n\n`¡` (`U+00A1`, inverted exclamation mark) maps to `!`; and while not strictly forbidden, is there as an alternative if bash is giving you a hard time with `!`.\n\n`©`(`U+00A9`, copyright sign) can be used to escape all the alternative operators above. Say, for example, you wanted your language to output an interrobang (‽) in a string. Without the escape character preceeding it, the interrobang would get translated into a question mark (?) when Metax is run. To preserve the interrobang and include it in the string, you would have to type `©‽` instead.\n\n## Using Metax\nTo compile Metax, run `deno compile --allow-read ./src/metax.ts` from the project's root directory.\n\n## Examples\nThe examples listed below are designed to demonstrate some of the key features of Metax.\n\nThe shell commands are listed as what you would run if you are using a compiled binary of Metax first, while underneath that is what you would run if you are just using the Deno CLI, i.e. in development.\n\n### Example 1\nExample 1 uses the `'Hello World!'` language. It's a fairly simple language, but a good demonstration of the basic usage of Metax.\n\nIt can be run like so;\n```bash\n./metax ./examples/example1.\\'Hello\\ World\\!\\'\n```\n```bash\ndeno run --allow-read ./src/metax.ts ./examples/example1.\\'Hello\\ World\\!\\'\n```\n#### Output\n\u003e Hello World!\n\n### Example 2\nExample 2 uses the `const join = function(){const array = [-3, -2, -1, 0, 1, 2, 3]; return array.join(' ');};join();` language. It nicely demonstrates the use of functions, but is often slated for not utilising the alternative `≫` operator to replace the `function` keyword with ES6 anonymous arrow function notation. As such, the `(() =≫ {const array = [-3, -2, -1, 0, 1, 2, 3]; return array.join(' ')})();` language is preferred by many.\n\n```bash\n./metax ./examples/example2.const\\ join\\ \\=\\ function\\(\\)\\{const\\ array\\ \\=\\ \\[-3\\,\\ -2\\,\\ -1\\,\\ 0\\,\\ 1\\,\\ 2\\,\\ 3\\]\\;\\ return\\ array.join\\(\\'\\ \\'\\)\\;\\}\\;join\\(\\)\\; \n```\n```bash\ndeno run --allow-read ./src/metax.ts ./examples/example2.const\\ join\\ \\=\\ function\\(\\)\\{const\\ array\\ \\=\\ \\[-3\\,\\ -2\\,\\ -1\\,\\ 0\\,\\ 1\\,\\ 2\\,\\ 3\\]\\;\\ return\\ array.join\\(\\'\\ \\'\\)\\;\\}\\;join\\(\\)\\;\n```\n#### Output\n\u003e -3 -2 -1 0 1 2 3\n\n### Example 3\nExample 3 demonstrates the use of alternative operators. Note the use of `××`, which gets interpreted by Metax as `**`, which is JavaScript's exponentiation operator.\n```bash\n./metax.exe ./examples/example3.\\(12\\ ÷\\ 4\\)\\ ≪\\ \\(\\ 2\\ ××\\ 2\\) \n```\n```bash\ndeno run --allow-read ./src/metax.ts ./examples/example3.\\(12\\ ÷\\ 4\\)\\ ≪\\ \\(\\ 2\\ ××\\ 2\\)\n```\n#### Output\n\u003e true\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalted%2Fmetax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalted%2Fmetax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalted%2Fmetax/lists"}