From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id C2F2A1F5AE for ; Sat, 1 Aug 2020 13:11:10 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 36685120BA0; Sat, 1 Aug 2020 22:10:37 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 48143120B9E for ; Sat, 1 Aug 2020 22:10:33 +0900 (JST) Received: by filterdrecv-p3iad2-d8cc6d457-4rql4 with SMTP id filterdrecv-p3iad2-d8cc6d457-4rql4-20-5F2569E4-99 2020-08-01 13:11:00.969849827 +0000 UTC m=+241365.914568097 Received: from herokuapp.com (unknown) by ismtpd0007p1iad2.sendgrid.net (SG) with ESMTP id y2frkcAcTIS0BXK05FwlIg for ; Sat, 01 Aug 2020 13:11:00.927 +0000 (UTC) Date: Sat, 01 Aug 2020 13:11:01 +0000 (UTC) From: eregontp@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 75264 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 14844 X-Redmine-Issue-Author: rmosolgo X-Redmine-Issue-Assignee: yui-knk X-Redmine-Sender: Eregon X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?KippOI8ZHtTweq7XfQzW93937kJ4QNWwSBuHnaMEcr1LXjcARzynP0sC6MePYx?= =?us-ascii?Q?A02ME+d5ixLJJH8PFyyTzcr29uKmEZD41tWSscY?= =?us-ascii?Q?VRJirn1UrloUi77qUGZSkM2TUM4+e3hPZLjvcdF?= =?us-ascii?Q?JplwFElfqxPoqY6VABWo7JnQFhYnWdKe6G3y4C3?= =?us-ascii?Q?g0ER=2F6FYPCku8AmpWLTwd0zVvNEkkIzRwFqPxja?= =?us-ascii?Q?B5m5Yj=2FSEGdYtaqgo=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 99435 Subject: [ruby-core:99435] [Ruby master Feature#14844] Future of RubyVM::AST? X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #14844 has been updated by Eregon (Benoit Daloze). [RBS](https://github.com/ruby/rbs) is using `RubyVM::AbstractSyntaxTree` for `rbs prototype`. RBS is an official project under the Ruby organization, so I believe it should be able to fully work on other Ruby implementations too ([issue](https://github.com/ruby/rbs/issues/348) about this in RBS). That is impossible as long as `AbstractSyntaxTree` is under `RubyVM`, or as long as RBS uses `RubyVM::AbstractSyntaxTree` with no fallback. So, I think it is time to move `AbstractSyntaxTree` outside of RubyVM. Otherwise, other Ruby implementations will have no choice but to define `RubyVM` too, which everyone seems to agree is unwanted as RubyVM is (at least currently) meant CRuby-only. I see three ways forward: * Move `AbstractSyntaxTree` under `ExperimentalFeatures` (#15752), so it is still experimental but at least other Ruby implementations can implement it too. * Make `AbstractSyntaxTree` stable, and move it under a stable namespace (maybe just `::AbstractSyntaxTree`?) * Change the meaning of RubyVM so it is not CRuby-specific but also exists on other Ruby implementations. Many people don't know that `RubyVM` means experimental, so `ExperimentalFeatures` seems much clearer. I prefer the first option, but any of the 3 unblocks the situation (which is also explained in #15752). Can we pick one? @matz can you decide? ---------------------------------------- Feature #14844: Future of RubyVM::AST? https://bugs.ruby-lang.org/issues/14844#change-86890 * Author: rmosolgo (Robert Mosolgo) * Status: Open * Priority: Normal * Assignee: yui-knk (Kaneko Yuichiro) ---------------------------------------- Hi! Thanks for all your great work on the Ruby language. I saw the new RubyVM::AST module in 2.6.0-preview2 and I quickly went to try it out. I'd love to have a well-documented, user-friendly way to parse and manipulate Ruby code using the Ruby standard library, so I'm pretty excited to try it out. (I've been trying to learn Ripper recently, too: https://ripper-preview.herokuapp.com/, https://rmosolgo.github.io/ripper_events/ .) Based on my exploration, I opened a small PR on GitHub with some documentation: https://github.com/ruby/ruby/pull/1888 I'm curious though, are there future plans for this module? For example, we might: - Add more details about each node (for example, we could expose the names of identifiers and operators through the node classes) - Document each node type I see there is a lot more information in the C structures that we could expose, and I'm interested to help out if it's valuable. What do you think? -- https://bugs.ruby-lang.org/