Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mirror ruby/yarp into ruby/ruby #7964

Merged
merged 4 commits into from Jun 21, 2023
Merged

Conversation

jemmaissroff
Copy link
Contributor

This PR accomplishes the following:

  • Add yarp to the tool/sync_default_gems.rb sync script
  • Adds yarp files to common.mk
  • Does an initial sync of all files in YARP

@jemmaissroff jemmaissroff force-pushed the mirror-yarp branch 8 times, most recently from 5fdbe8f to 9b77eec Compare June 21, 2023 14:03
@k0kubun
Copy link
Member

k0kubun commented Jun 21, 2023

The changes look good to me.

Could you include [Feature #19741] in the message of one (or all) of the commits? We could squash them and add it there, but I assume you prefer keeping the commit history.

This PR accomplishes the following

In terms of features added to CRuby, are the following features what this PR is adding?

  • yarp standard library (not gemified)
    • yarp.rb: for require "yarp", YARP's Ruby API
    • yarp.so: for require "yarp.so", the actual parser implementation used by yarp.rb internally

Are the both files upgradable by installing yarp.gem? My general understanding is that it would require the standard library to be gemified, but I wonder there's any trick that you used inside ruby_init_ext or somewhere.


Also, since it's not clarified in https://bugs.ruby-lang.org/issues/19741, could we clarify the next steps that you're going to work on before Ruby 3.3 release? In particular, I'm interested in whether you plan to do the following stuff or not:

  • Auto-generate files in the Ruby build process instead of on sync_default_gems
  • Add a way to optionally switch the parser of the interpreter from parse.y to YARP
  • Provide C API in the interpreter that can be used by other C extension gems
    • Or is YARP supposed to be used as a C code in third-party extensions?

(I'm not requesting them for 3.3 but just curious about the timeline)

The default gems sync script now includes YARP, found in the
ruby/yarp repo. This script primarily syncs over the src, test, lib
directories. It also migrates all encoding files to be prefixed
with `yp_` in order to deconflict from existing encoding files.
Add yarp to common.mk and windows builds to enable us to run yarp
correctly with CI.
Init_YARP is called from inits.c, and it loads the YARP C extension
correctly
This commit is the initial sync of all files from ruby/yarp
into ruby/ruby. Notably, it does the following:

* Sync all ruby/yarp/lib/ files to ruby/ruby/lib/yarp
* Sync all ruby/yarp/src/ files to ruby/ruby/yarp/
* Sync all ruby/yarp/test/ files to ruby/ruby/test/yarp
@jemmaissroff
Copy link
Contributor Author

In terms of features added to CRuby, are the following features what this PR is adding?

  • yarp standard library (not gemified)

    • yarp.rb: for require "yarp", YARP's Ruby API
    • yarp.so: for require "yarp.so", the actual parser implementation used by yarp.rb internally

Yes!

Are the both files upgradable by installing yarp.gem? My general understanding is that it would require the standard library to be gemified, but I wonder there's any trick that you used inside ruby_init_ext or somewhere.

We haven't looked into this in detail yet, but we'd like to enable upgrading of yarp.gem independent of the Ruby release schedule. We will figure this out before the Ruby 3.3 release.

Also, since it's not clarified in https://bugs.ruby-lang.org/issues/19741, could we clarify the next steps that you're going to work on before Ruby 3.3 release? In particular, I'm interested in whether you plan to do the following stuff or not:

  • Auto-generate files in the Ruby build process instead of on sync_default_gems

Yes, we will do this after merging this PR!

  • Add a way to optionally switch the parser of the interpreter from parse.y to YARP

Yes, this will require more work to integrate YARP's AST with the compiler. I plan to work on this after merging this PR.

  • Provide C API in the interpreter that can be used by other C extension gems
    • Or is YARP supposed to be used as a C code in third-party extensions?

We haven't made a decision about this yet.

@k0kubun k0kubun merged commit cc7f765 into ruby:master Jun 21, 2023
92 checks passed
@k0kubun k0kubun deleted the mirror-yarp branch June 21, 2023 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants