{"id":22731859,"url":"https://github.com/dgkf/r","last_synced_at":"2026-03-05T13:32:47.106Z","repository":{"id":65427004,"uuid":"583669957","full_name":"dgkf/R","owner":"dgkf","description":"An experimental reimagining of R","archived":false,"fork":false,"pushed_at":"2024-10-27T12:18:42.000Z","size":20079,"stargazers_count":142,"open_issues_count":75,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-10-12T23:41:43.434Z","etag":null,"topics":["lang"],"latest_commit_sha":null,"homepage":"https://dgkf.github.io/R","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgkf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2022-12-30T14:13:29.000Z","updated_at":"2025-10-06T09:40:22.000Z","dependencies_parsed_at":"2024-03-01T03:24:13.935Z","dependency_job_id":"67dda47c-56b0-440e-84ea-77363c24e811","html_url":"https://github.com/dgkf/R","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/dgkf/R","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgkf%2FR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgkf%2FR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgkf%2FR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgkf%2FR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgkf","download_url":"https://codeload.github.com/dgkf/R/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgkf%2FR/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30127867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T12:40:50.676Z","status":"ssl_error","status_checked_at":"2026-03-05T12:39:32.209Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["lang"],"created_at":"2024-12-10T19:33:45.001Z","updated_at":"2026-03-05T13:32:47.083Z","avatar_url":"https://github.com/dgkf.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# R\n\n_An experimental implementation of R, with embellishments_\n\nCheck out the [live demo](https://dgkf.github.io/R/)\n\n## What can it do?\n\n```sh\ncargo run\n```\n```r\n# R version 0.3.1 -- \"Art Smock\"\n\nx \u003c- function(a = 1, ...) { a + c(...) }\n# function(a = 1, ...) {\n#   a + c(...)\n# }\n# \u003cenvironment 0x6000005b8e28\u003e\n\ny \u003c- function(...) x(...)\n# function(...) x(...)\n# \u003cenvironment 0x6000005b8e28\u003e\n\ny(4, 3, 2, 1)\n# [1] 7 6 5 \n```\n\nThis amounts to (most) of R's grammar parsing, basic primitives, scope\nmanagement and ellipsis argument passing.\n\n## What's different?\n\nThis project is not just a rewrite of R, but a playground for features and\nreinterpretations. It is not meant to reimplement a compatible R layer, but \nto rethink some of R's assumptions. \n\n### Syntax\n\nTo start, there are a few superficial changes:\n\n```r\n# 'fn' keyword\nf \u003c- fn(a, b, c) {\n  a + b + c\n}\n\n# vector syntax\nv \u003c- [1, 2, 3, 4]\n\n# list syntax\nl \u003c- (a = 1, b = 2, c = 3)\n\n# lowercase keywords\nkws \u003c- (na, null, inf, true, false)\n\n# destructuring assignment\n(a, b) \u003c- (1, 2)\n```\n\nThere are plenty of more substantial [changes being considered](https://github.com/dgkf/R/issues?q=is%3Aissue+is%3Aopen+label%3Ameta-proposal). \nIf you enjoy mulling over the direction of syntax and features, feel\nfree to join the conversation.\n\n### Experiments\n\nAll experiments are feature-gated and enabled by running (or building) with \n\n```sh\ncargo run -- --experiments \"\u003cexperiment\u003e\"\n```\n\nPlease try them out and share your thoughts in the corresponding issues!\n\n#### Ellipsis packing and unpacking\n\n\u003e [!NOTE]  \n\u003e `--experiments rest-args` (discussed in [#48](https://github.com/dgkf/R/issues/48), [#49](https://github.com/dgkf/R/issues/49))\n\nCurrent work is focused on `..args` named ellipsis arguments and `..args`\nunpacking in function calls. However, due to the experimental nature of this\nsyntax it is currently behind a feature gate.\n\n```r\nf \u003c- function(..args) {\n  args\n}\n\nf(1, 2, 3)  # collect ellipsis args into a named variable\n# (1, 2, 3)\n```\n\n```r\nargs \u003c- (a = 1, b = 2, c = 3)\nf \u003c- function(a, b, c) {\n  a + b + c\n}\n\nf(..args)  # unpack lists into arguments\n# [1] 6\n\nmore_args \u003c- (c = 10)\nf(..args, ..more_args)  # duplicate names okay, last instance takes priority\n# [1] 13\n```\n\n#### Tail Recursion\n\n\u003e [!NOTE]  \n\u003e `--experiments tail-calls` (discussed in [#60](https://github.com/dgkf/R/issues/60)) \n\nTail recursion allows for arbitrarily recursive call stacks - or, more \naccurately, it discards frames from the call stack in this special case\nallowing for recursion without overflowing of the call stack.\n\n```r\nf \u003c- function(n) if (n \u003e 0) f(n - 1) else \"done\"\nf(10000)\n# [1] \"done\"\n```\n\nThe details of how this is achieves requires the tail call's arguments to be\nexecuted _eagerly_ instead of R's typical _lazy_ argument evaluation. This \nchange can result in some unexpected behaviors that need discussion before\nthe feature can be fully introduced.\n\n### Performance\n\nYou might be thinking `rust` is fast, and therefore this project must be\nfast. Well, unfortunately you'd be wrong. That's probably more of a \nreflection on me than `rust`. To get the basic skeleton in place, \nmy focus has been on getting things working, not on getting them working\n_well_. For now, expect this interpreter to be about ***1000x*** slower\nthan R. \n\nI'm feeling good about the general structure of the internals, but there\nhave been plenty of quick proofs of concept that involve excess copies, \nextra loops, panics and probably less-than-ideal data structures.\nIf you're an optimization fiend and you want to help narrow the gap with \nR, your help would be very much appreciated!\n\n## Why\n\nThis project is primarily a personal exploration into language design. \n\nAt the outset, many of the choices are researched one-by-one and are almost\ncertainly naive implementations. My goal is to learn and explore, and in \nthat way the project is already a success in my eyes. Beyond advancing my own\nunderstanding of language internals, I'd love to see the project garner enough\ninterest to become self-sustaining. \n\nIf you see value in the project for anything beyond prototyping ideas, then\npushing the project toward something practical is contingent on your support.\nContributions, suggestions, feedback and testing are all appreciated.\n\n### Values\n\nBeing primarily a one-person project, the values currently map closely to my\nown. Somethings I want to aim for:\n\n- A reasonably approachable language for R users (possibly with the ability to\n  interpret R code).\n- Improved R constructs for complex calls, including argument packing and\n  unpacking, partial function calls, destructuring assignment\n- Guardrails on non-standard-evaluation, allowing for user-facing \n  domain-specific-languages, while allowing a more rigid evaluation scheme\n  internally. \n- Lean into the things that `rust` does well, such as threading, arguably \n  async evaluation, first-class data structures and algebraic error types.\n- Learn from more general languages like `TypeScript` to better understand\n  how static typing can be comfortably embedded in a high-level language.\n\n## Contribution Guide\n\nIf you also want to learn some `rust` or want to explore language design with\nme, I'm happy to have you along for the ride. There are plenty of ways to\ncontribute. In order of increasing complexity, this might include:\n\n- Documenting internals\n- Improving documentation throughout\n- Helping to improve the demo page hosted on GitHub pages\n- Implementing new language concepts\n- Providing feedback on internals\n\nAny and all contributions are appreciated, and you'll earn yourself a mention\nin release notes!\n\n## License\n\nI welcome other contributors, but also have not thoughtfully selected a long-\nterm license yet. For now there's a CLA in place so that the license can\nbe altered later on. I don't intend to keep it around forever. If you have\nsuggestions or considerations for selecting an appropriate license, your\nfeedback would be much appreciated.\n\nMy current preference is toward a copyleft license like GPL as opposed to a\npermissive license like MIT, as I believe that languages are a best-case\ncandidate for such licenses and it fits well with the ethos of the R community\nas being scientific-community first. If you disagree strongly with that\ndecision, now is your time to let me know.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgkf%2Fr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgkf%2Fr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgkf%2Fr/lists"}