{"id":17014163,"url":"https://github.com/douira/parenthis-lang","last_synced_at":"2026-04-28T23:05:04.015Z","repository":{"id":97888748,"uuid":"287557218","full_name":"douira/parenthis-lang","owner":"douira","description":"(parenthis) is an esoteric programming language","archived":false,"fork":false,"pushed_at":"2021-08-23T03:15:08.000Z","size":199,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-27T13:49:07.825Z","etag":null,"topics":["compiler","esoteric-language","interpreter","programming-language"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/douira.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":"2020-08-14T14:53:28.000Z","updated_at":"2023-01-24T20:19:16.000Z","dependencies_parsed_at":"2023-05-31T12:01:08.454Z","dependency_job_id":null,"html_url":"https://github.com/douira/parenthis-lang","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/douira%2Fparenthis-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douira%2Fparenthis-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douira%2Fparenthis-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douira%2Fparenthis-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/douira","download_url":"https://codeload.github.com/douira/parenthis-lang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244968454,"owners_count":20540122,"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","esoteric-language","interpreter","programming-language"],"created_at":"2024-10-14T06:24:00.923Z","updated_at":"2026-04-28T23:04:58.972Z","avatar_url":"https://github.com/douira.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# (parenthis)\n\nThe **(parenthis)** esoteric programming language consists of a very uniform syntax. It was created by me (douira). This project is the interpreter for it.\n\nI've written about it (under the previous name SUL, rename pending) on the Esolang wiki [here](https://esolangs.org/wiki/SUL).\n\n### Version history\n\n- **SUL v1**: Earlier implementation in Processing\n- **SUL v2**: Basic implementation in JavaScript in [this KhanAcademy project](https://www.khanacademy.org/computer-programming/sul-v2-an-esoteric-programming-language/4555641989431296). See files in the folder `old`.\n- **parenthis v3**: (WIP) Better implementation in TypeScript without processing.js\n\n# Language\n\nSee more docs in the (WIP) [wiki](https://github.com/douira/parenthis-lang/wiki/Language-and-API-Documentation).\n\n## Formal Grammar in EBNF\n\n```ebnf\n(* a parenthis program consists of a single expression *)\nexpression = between , ( element | string ) , between ;\n\n(* elements are an identifier and then any number of expressions *)\nelement = \"(\" , identifier , { \",\" , expression } , \")\";\n\n(* consists of any number of segments separated by periods *)\nidentifier = between , identifier segment ,\n  { \".\" , identifier segment } , between ;\n\n(* use lowerCamelCase for function names *)\nidentifier segment = { a to z | A to Z | 0 to 9 } ;\n\n(* double or single quotes, not listing all possible chars here. \\\\ is escaped to \\, \\\\\" to \\\\ + (end of string) and \\\\\\\" to \\\".\nregex equivalent for double quoted: /'(.*?)(?\u003c!\\\\)'/gs *)\nstring =\n    ( '\"' , { any character except '\"' | '\\\"' }, '\"' )\n  | ( \"'\" , { any character except \"'\" | \"\\'\" }, \"'\" ) ;\n\nbetween = { any whitespace character | comment } ;\n```\n\nTheoretically the commas separating expressions could be omitted but for sake of simplicity they're required. Replacing them with whitespace or no whitespace when not ambiguous makes parsing more complicated.\n\n## Comments\n\nComments are similar to those in JavaScript:\n\n```js\ncode//this is a comment until the end of the line\ncode/*this comment can be\nseveral\nlines*/\n```\n\n## Types\n\nA dynamic type system is used. Functions can have none, a set or variable return type.\nAny type can be (implicitly or explicitly) cast into any other type.\nAttempting to use a value where none is present will give an null value.\n\nType checking and type errors aren't normally used, because all types can be converted into each other.\nRegular equality will convert the second value into the type of the first one and compare then.\nWhen checking for strict equality type errors can happen though.\n\nIf the parent element doesn't use the return value of an argument nothing special will happen.\nSome special elements execute/evaluate their arguments without using their values.\nThe available types are:\n\n(TODO)\n\nI have some ideas for a static type checking system but those aren't implemented.\n\n## Scoping\n\nBy default all variables are declared using `setVar` and `getVar` which set variables in the first reachable scope. By default this will be the global scope. The function `createScope` creates a new scope which blocks calls to higher scopes using `setVar` and `getVar`. If the global variants `setVarGlobal` and `getVarGlobal` or are used the global boolean is set on `setVar` and `getVar` the global scope can be accessed again. Effectively, `scope` or anything similar creates a new variable map to use. The global variants skip checking or writing to any lower scope. Passing parameters to a function using `do` creates a new scope with numbered variables for each of the passed parameters. Writing to variables in a function call will use the function scope if not configured otherwise using global accessors.\n\n(TODO: scoping and variables in general not implemented in evaluation yet)\n\n## Namespacing\n\nThe built-in functions are in this default namespace `parenthis` which can be omitted. All others can either be merged upon import and used without prefixing their namespace or used with their namespace like this for example: `foo.bar.functionName` or `baz.otherFunction`. Using a namespace as a function is an error but a namespace can contain any mix of functions and nested namespaces. Namespaces are imported using `import` (see docs).\n\n## Other Notes\n\nOnly evaluates what is necessary, only left-hand side of `or` if it is true and similar for `and`, and only the number of arguments needed with the types needed.\n\nEverything is parsed first without any checking for sense (except for formal syntax like function names, parentheses...).\nThen evaluated when needed, a single code element can be evaluated several times when in a loop.\nOrder of calling is not always guaranteed! i.e. Arguments for a function may not be called in the order they are given.\nFunction names are part of the syntax, because they can't be created from inside the code and are (mostly) fixed for the whole program.\n\nThe suggested file extension for parenthis programs is `.par`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouira%2Fparenthis-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdouira%2Fparenthis-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouira%2Fparenthis-lang/lists"}