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-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.1 required=3.0 tests=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 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 6B7C91F462 for ; Wed, 22 May 2019 10:15:18 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 6B01C120A6A; Wed, 22 May 2019 19:15:13 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 8CC99120A68 for ; Wed, 22 May 2019 19:15:11 +0900 (JST) Received: by filter0144p3mdw1.sendgrid.net with SMTP id filter0144p3mdw1-25343-5CE5212F-21 2019-05-22 10:15:11.498713199 +0000 UTC m=+560132.500455350 Received: from herokuapp.com (unknown [3.81.19.97]) by ismtpd0048p1mdw1.sendgrid.net (SG) with ESMTP id Rp0mEjiARuqztV05iMzPwg for ; Wed, 22 May 2019 10:15:11.480 +0000 (UTC) Date: Wed, 22 May 2019 10:15:11 +0000 (UTC) From: eregontp@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 68268 X-Redmine-Project: ruby-trunk 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?KippOI8ZHtTweq7XfQzW93937kJ4QNWwSBuHnaMEcr3QCNloZ34NkxvxP5p0n4?= =?us-ascii?Q?5gp6o5=2FE0gpouCMFWb=2FVW3TwixK8ycucKzrxHEV?= =?us-ascii?Q?a380r0TFmYwnZNcid0n9EK3bTafI5wnWwZRBsv1?= =?us-ascii?Q?RU=2F9toR0lPSmNFMfXqIcKxm9th7Bm71iyeQQ+K5?= =?us-ascii?Q?z1MyZtsigBqqnxgImLwUNYg7jEAO0Mxcn1A=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92782 Subject: [ruby-core:92782] [Ruby trunk 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). akr (Akira Tanaka) wrote: > We are not sure the stability of RubyVM::AbstractSyntaxTree. > For example, Ruby 2.7 will add new node for pattern match. Right, so I think we need to document it's not stable yet as clearly as possible. > We want to know such unstability has big impact for > practical applications or not. New nodes are probably fine, but reordering node fields for instance I guess would break most usages given the current API. > I feel it is difficult to decide stable definition of AST now. I understand, I'm not asking a stable definition. But I'd like to see in the documentation mentions of use-cases where using RubyVM::AbstractSyntaxTree over alternatives would make sense. That way, I hope we can make it clear for some use-cases using RubyVM::AbstractSyntaxTree is not the right tool, or at least not always the best tool for it. > I think what we can now is adding some warning in document. I think that would be a good step for 2.7. ---------------------------------------- Feature #14844: Future of RubyVM::AST? https://bugs.ruby-lang.org/issues/14844#change-78147 * Author: rmosolgo (Robert Mosolgo) * Status: Open * Priority: Normal * Assignee: yui-knk (Kaneko Yuichiro) * Target version: ---------------------------------------- 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/