Skip to content

Conversation

segiddins
Copy link
Contributor

No description provided.

@segiddins segiddins force-pushed the segiddins/expose-prettyprint-serialize-parse-options-in-rust branch from ffece4f to 23fe580 Compare February 13, 2025 23:44
@segiddins segiddins force-pushed the segiddins/expose-prettyprint-serialize-parse-options-in-rust branch from 23fe580 to 0a0f2c2 Compare February 14, 2025 00:02
@kddnewton
Copy link
Collaborator

I'm okay with prettyprint and the parse options, but I'm not sure I understand the use case for the serialization API in rust. Could you explain the motivation?

@segiddins
Copy link
Contributor Author

The motivation is the ability to parse the AST into a more natural shape for use in rust, similar to what the prism ruby gem does (rather than maintaining pointers to the c structure nodes). I am using it in https://github.com/segiddins/gemfile-rs/blob/main/src/prism_ast/generated.rs, an in-progress project of mine

@kddnewton
Copy link
Collaborator

@segiddins Thanks for your patience.

I'm fine accepting the options from the rust side (I definitely think we should do that). I'm much less keen to expose the serialization format. We have only done that for languages that didn't have direct C interop, which I'd like to keep that way. That's why we have the ruby-prism (as opposed to the ruby-prism-sys) crate. Does that crate work for your use case?

Either way, would you be able to split up this PR? The first would be the options, which I'd be happy to merge immediately. The other would be the other APIs you're trying to expose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants