-
Notifications
You must be signed in to change notification settings - Fork 154
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
Exclusion of location fields in serialize for execution #807
Comments
For those I suggest we annotate them with |
Here is an interesting case where I am not sure how this should be structured if you remove the token:
If the token is removed then it will be pointing at '&b' and not 'b'. I think the solution would be to assume first char is '&'? Today I use the name token. |
@jemmaissroff Is this layout/strategy ok? I open up individual issues where excluding the token would lead to loss of information and mention this issue in the description? I am willing to audit all in config.yml but don't want know if this is how it should be done. |
For Such identifiers should most likely use the constant pool long term, and then they're pretty short in serialized form + avoids rereading the same identifier multiple times (and to convert from byte[] to java.lang.String or so). So I'd say use |
@eregon I am going with the assumption the goal is to replace anything which is token and is needed to what we want to read. You are correct we can add a temporary |
Yeah, agreed. I think an interned identifier in the constant pool is the way to go here (but we don't have a constant pool yet in YARP). |
I'm going to close this once #997 is merged. At that point all tokens are off the tree and only locations remain. I think going forward we can operate as if there is a future where all location fields on nodes are removed from the serialization. In that case if there is anything that y'all need for compilation that isn't serviced by just the name of the node and its fields that aren't locations, we should add flags. The only one I know of at the moment is the range node where we need to indicate exclusivity. Other than that I think we have all the information we need? We certainly will find out pretty soon once we integrate into CRuby and start our own compilation work. |
Let me reopen this with the original intent, i.e. the possibility to have no token and no location fields in serialization, and also no location fields in Java nodes. |
* Add a include_location_fields argument for serialize functions. * Add a byte in the header to indicate whether location fields are included. * Fixes ruby#807
* Add a include_location_fields argument for serialize functions. * Add a byte in the header to indicate whether location fields are included. * Fixes ruby#807
* Add a include_location_fields argument for serialize functions. * Add a byte in the header to indicate whether location fields are included. * Fixes ruby#807 * Simplify the build-java CI job now that the FFI backend is available so JRuby can serialize.
* Add a include_location_fields argument for serialize functions. * Add a byte in the header to indicate whether location fields are included. * Fixes ruby#807 * Simplify the build-java CI job now that the FFI backend is available so JRuby can serialize.
* Add $YARP_SERIALIZE_ONLY_SEMANTICS_FIELDS to control where to serialize location fields at templating time, this way there is no overhead for either case and nothing to check at runtime. * Add a byte in the header to indicate whether location fields are included as expected. * Fixes ruby#807 * Simplify the build-java CI job now that the FFI backend is available so JRuby can serialize. * Support keeping some location fields which are still needed until there is a replacement
* Add $YARP_SERIALIZE_ONLY_SEMANTICS_FIELDS to control where to serialize location fields at templating time, this way there is no overhead for either case and nothing to check at runtime. * Add a byte in the header to indicate whether location fields are included as expected. * Fixes ruby#807 * Simplify the build-java CI job now that the FFI backend is available so JRuby can serialize. * Support keeping some location fields which are still needed until there is a replacement
* Add $YARP_SERIALIZE_ONLY_SEMANTICS_FIELDS to control where to serialize location fields at templating time, this way there is no overhead for either case and nothing to check at runtime. * Add a byte in the header to indicate whether location fields are included as expected. * Fixes ruby#807 * Simplify the build-java CI job now that the FFI backend is available so JRuby can serialize. * Support keeping some location fields which are still needed until there is a replacement
* Add a include_location_fields argument for serialize functions. * Add a byte in the header to indicate whether location fields are included. * Fixes ruby#807 * Simplify the build-java CI job now that the FFI backend is available so JRuby can serialize.
* Add $YARP_SERIALIZE_ONLY_SEMANTICS_FIELDS to control where to serialize location fields at templating time, this way there is no overhead for either case and nothing to check at runtime. * Add a byte in the header to indicate whether location fields are included as expected. * Fixes ruby/prism#807 * Simplify the build-java CI job now that the FFI backend is available so JRuby can serialize. * Support keeping some location fields which are still needed until there is a replacement ruby/prism@fc5cf2df12
Execution does not need all info contained in Nodes defined in config.yml. In particular, they do not need any Tokens or Location fields. We should allow templates for serialization and loading to not include those in the blob or in the generated AST.
Towards this goal issues will get opened we encounter places where we DO currently need tokens (e.g. CallNode.call_operator (. vs &.) or RegularExpressionNode.closing (/ix).
The text was updated successfully, but these errors were encountered: