Repository navigation
README: v0.4.0 parses all three former limitations, and the performance figures re-measured - #36
Merged
Merged
Conversation
…ce figures re-measured
Measured on 2026-09-26, darwin/arm64, against MRI 4.0.5 on the same host.
- Known limitations: all three entries now parse at v0.4.0 (main is exactly v0.4.0).
Verified by calling parser.Parse on each: paren-less command calls with keyword,
splat and block args; default block parameters; and the positional Class(a)
find-pattern. The probe also carried a control that must fail, and it did:
BEGIN { } / END { } are now the only listed refusal.
- Added a completeness figure that can be checked: of 47 top-level CRuby 4.0.5
stdlib files MRI accepts, this parser accepts 46; mkmf.rb is the refusal.
- Performance: the claim that go-ruby-parser "beats MRI's reference C parser" did
not reproduce, and neither did the two ratios beside it. On 46 real CRuby 4.0.5
stdlib files both engines accept (768 KB, 20 in-process iterations):
go-ruby-parser Parse 0.45 ms/file
RubyVM::AST.parse 0.29 ms/file -> MRI's C parser is 1.6x FASTER
Ripper.sexp 0.86 ms/file -> we are 1.9x faster, not ~6x
lexer.Tokenize 0.36 ms/file
Ripper.lex 2.16 ms/file -> we are 6.0x faster, not 24-30x
The section now states these numbers, notes that the two lexers' token counts are
not comparable (82k vs 125k over the same corpus, since Ripper emits whitespace
and comment tokens), and records that the old figures did not reproduce without
claiming the original method was wrong -- the corpus and host both differ.
- Names the current release, v0.4.0, and notes the interpreter still pins v0.3.0 and
that there are no GitHub release notes.
The Usage example was compiled and run against v0.4.0: prog is *ast.Program with 2
top-level nodes (*ast.MethodDef, *ast.Call). The WebAssembly section's claim that CI
builds both js/wasm and wasip1/wasm is correct -- ci.yml has that matrix and both
targets build here.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-measured on 2026-09-26 against MRI 4.0.5 on the same host (darwin/arm64).
mainis exactlyv0.4.0.The three "Known limitations" all parse now
Verified by calling
parser.Parseon each atv0.4.0:The two refusals are the probe's own control: a check that answers "parses" to everything is not a check.
BEGIN { }/END { }are now the only listed gap.Added a completeness figure a reader can verify: of 47 top-level CRuby 4.0.5 stdlib files MRI accepts, this parser accepts 46 (
mkmf.rbis the refusal,expected CONST, got "log_open"), and it parses all 80_spec.rbfiles in the pinned ruby/speclanguage/corpus.The performance claim did not reproduce
The README claimed this parser "beats MRI's reference C parser" — 2.1× on real stdlib files, ~6× on
Ripper.sexp, 24–30× onRipper.lex. Measured on 46 real CRuby 4.0.5 stdlib files that both engines accept (768 KB, 20 in-process iterations each):parser.Parse(full Go AST)RubyVM::AbstractSyntaxTree.parseRipper.sexplexer.TokenizeRipper.lexSo the honest statement is: comfortably quicker than
Ripper, which is what most Ruby tooling actually uses, and roughly 1.6× slower than the C parser inside CRuby. The section now says that, and records that the old figures did not reproduce without claiming the original method was wrong — the corpus and host both differ from that run, and the note tells readers not to quote the old numbers either way.Two honesty notes I built into the measurement: my first corpus was the eight largest stdlib files and included one this parser refuses, which is a biased sample and not "both-accept" — the table above is the corrected run. And the two lexers' token counts are not comparable (82 k vs 125 k over the same corpus, since
Ripperemits whitespace and comment tokens), so only the per-file times are quoted.Checked and left alone
prog is *ast.Program with 2 top-level nodes(*ast.MethodDef,*ast.Call), soprog.Bodyis walkable as documented.ci.ymlreally does have agoos: [js, wasip1]matrix, and both targets build here. (Worth noting the contrast with the interpreter, where the browser target is broken and ungated.)ci.yml.Also names the current release, and notes that go-embedded-ruby's interpreter still pins v0.3.0, so the consumer is one release behind.
🤖 Generated with Claude Code