{"id":22202212,"url":"https://github.com/rumkin/r-expr","last_synced_at":"2025-03-25T00:59:28.893Z","repository":{"id":152260205,"uuid":"170952264","full_name":"rumkin/r-expr","owner":"rumkin","description":"Rich Expressions","archived":false,"fork":false,"pushed_at":"2020-01-26T03:04:38.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T03:26:15.757Z","etag":null,"topics":["language","parser","tokenizer","transformer","traverser"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/rumkin.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}},"created_at":"2019-02-16T02:06:07.000Z","updated_at":"2020-01-26T03:04:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"2d7126ce-2c3c-4b81-9dd3-b821cd0aa1cb","html_url":"https://github.com/rumkin/r-expr","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/rumkin%2Fr-expr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fr-expr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fr-expr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rumkin%2Fr-expr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rumkin","download_url":"https://codeload.github.com/rumkin/r-expr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245377989,"owners_count":20605377,"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":["language","parser","tokenizer","transformer","traverser"],"created_at":"2024-12-02T16:12:46.582Z","updated_at":"2025-03-25T00:59:28.886Z","avatar_url":"https://github.com/rumkin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# R-Expressions\n\nR-expressions or Rich Expressions is a language inspired by S- and M-expressions.\nThe toolkit is written with JavaScript and contains:\n\n* ✅ Tokenizer,\n* ✅ Parser,\n* ✅ Traverser,\n* ✅ Transformer.\n\nTokenizer and parser support streaming mode with byte-per-byte input and could\nbe used for REPL creation.\n\n## Application\n\nR-expressions could be used for:\n\n1. Lisp-like programming languages creation.\n2. Language prototyping.\n3. Transpilation.\n\n## Example\n\n```\n(pseudo-lang ^1.0)\n\nimport({Console} from Core.Io)\n\nConsole.log('Hello, %s!' 'World')\n```\n\n## Types\n\nR-Expressions contains symbols, strings, lists, calls and comments.\n\n### Symbol\n\nSymbol is a sequence of characters without whitespaces, single quotes or parenthesis.\nWhile whitespace, semicolon, quote or open parenthesis could be escaped by backslash.\n\nThese are all symbols:\n```\ntrue\n1_000_000\n^1.*\nConsole.log\nhttp://github.com/rumkin/r-expressions\n~/memories/summer\\ vacation\\ 2019/\n\u003cnode\u003e\n```\n\n### String\n\nString is a sequence of characters surrounded by single quote `'`.\nSingle quote within a string should be escaped with a backslash `\\`.\nAnd backslash could be escaped by another backslash `\\\\`. String could contain new lines.\n\n```\n'This is a string'\n'Hello! I\\'m a string too.'\n'This is a multiline\nstring'\n```\n\n### Lists\n\nList is a type which can contain other types: symbols, strings, lists, and calls:\n\nR-expressions has three types of lists round, square, and figure, this lists\nare enclosed with round, square, or figure parenthesis respectively. They can be used to separate semantic.\n\n```\n; Round parenthesis list\n(null true 1_234 'Hello')\n\n; Figure parenthesis list\n{x: 1 y: 2 z: 3}\n\n; Square parenthesis list\n[1 2 3 4 5]\n\n; Mixed\n[a (1 {2} 3) b]\n\n; Empty\n()\n```\n\n\u003e ⚠️ There should be a space between the closing parenthesis of\n\u003e a list and the opening of a following one. While this code `{} {}` is correct, the next one `{}{}` is not. Look at [Call](#call) type.\n\n### Call\n\nCall is a type which specifies function call and is presented by symbol followed by a list:\n\n```\nprint('Hello world')\n```\n\nCalls could be chained, if there is no space between lists in a sequence:\n\n```\ncurry(print 'Hello, %s')('World')\n; or\nprint('Hello, %s' ?)('World')\n```\n\nLists types could be mixed for different semantics creation:\n```\n; HTML like code\ndiv{class: !['badge' 'badge-round' 'badge-red']}(\n  p('Users count: 1')\n)\n```\n\n### Comment\n\nComment is a line of text prepended with a semicolon `;`. Comment ends with new line char `\\n`.\n\n```\n; Hi! I'm a comment. I can help you to describe your program\n```\n\n## License\n\nMIT © [Rumkin](https://rumk.in)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frumkin%2Fr-expr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frumkin%2Fr-expr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frumkin%2Fr-expr/lists"}