Skip to content

bib: R bibliography and feasibility plan for go-embedded-r - #21

Merged
tannevaled merged 1 commit into
mainfrom
bib-r
Nov 1, 2026
Merged

tannevaled merged 1 commit into
mainfrom
bib-r

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Adds bib/r.md, the bibliography and feasibility plan for go-embedded-r, a pure-Go R interpreter (CGO-free, embeddable, wasm) for ```r cells in go-notebook. It follows the structure of bib/julia.md. The lesson from that file is applied: every count is taken on the pinned R 4.6.2 release tarball (SHA-256 recorded), never on trunk.

Key figures (from tools/rcount):

  • R_FunTab: 773 entries, made of 210 .Primitive and 563 .Internal. Base R's own code reaches 409 of the internals.
  • Grammar: 44 tokens and 12 nonterminals. The 3 980-line lexer sits in the C epilogue of gram.y. There are 129 byte-code opcodes, and the JIT is on by default.
  • Base R code is GPL-2+, so it can be used as an oracle only. §2.6 sets out three options and recommends a BSD interpreter that fetches the pinned R code and never redistributes it (the go-tex/texmf pattern). This licence decision is left to the user before M2.
  • CRAN: of 25 608 packages, 5 620 need compilation. Only 3 851 (15 %) are pure R with dependencies that are also pure R. Porting the top 100 compiled blockers reaches 10 099 (39 %).
  • Plan M0-M8: oracle harness with an RDS reader, parser, evaluator core, base, stats/utils/methods, regex, an SVG graphics device, the notebook bridge, the wasm playground, and CRAN ports. Risks are listed in §6.

Also adds tools/rcount, which produces all of these counts. It is a cobra CLI with 100 % statement coverage and a fuzz test.

No repository was created in go-embedded-r.

🤖 Generated with Claude Code

bib/r.md plans a pure-Go R interpreter for go-notebook cells, counted on
the R 4.6.2 release tarball (SHA-256 recorded): 773 R_FunTab entries =
210 primitives + 563 internals, a 12-nonterminal grammar, 129 byte-code
opcodes, lines per language of base/stats/utils/methods/graphics/grid,
native call sites, the GPL boundary and what is portable (LAPACK, TRE,
XDR), the fleet libraries to reuse, prior art (Renjin, FastR, pqR,
Riposte, webR), the CRAN native-code wall (3 851 of 25 608 packages run
without compiled code), the oracle harness, milestones M0-M8 and risks.

tools/rcount takes every count (cobra CLI, 100% coverage, fuzzed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 24ded56 into main Nov 1, 2026
1 check passed
@tannevaled
tannevaled deleted the bib-r branch November 1, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant