-
Notifications
You must be signed in to change notification settings - Fork 99
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
Write out types in topological order #62
Write out types in topological order #62
Conversation
@inquisitivepenguin what would you think about making the RustThing in |
I'm hesitant to do so because |
That’s fair. Do you consider it a hack just as it is currently being used in |
It was originally introduced to accomplish a hack (so yes, the former option), in this case treating a struct as a type alias. I'm not opposed to have a heterogeneous container type, but since this is going to be a new public type, we could still make a few changes:
|
@adriangb Since this PR is getting kind of stale, I'm going to go ahead and implement the requested changes myself. Let me know if this is conflicting with any work you're doing. |
No problem at all! I've been very distracted from OSS with personal / paid job lately, sorry for dropping the ball. |
@adriangb No worries at all, thank you for all of your contributions. |
…l-sort-before-writing
…l-sort-before-writing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good, just a few nits:
- could the other functions taking mutable vecs in topsort.rs have shims like the topsort impl? It'd reduce extra lines needed around those functions. Doc comments on those would be nice as well. I don't think this is significant enough to block merge though.
Thank you for taking this over @inquisitivepenguin ! |
Sub-piece of #25.
Python in particular needs this for type aliases:
Won't work although it is fine in Rust.
As discussed in #20 I think it makes sense to just make this the default for all languages, I don't think it's a con in any language.
Tricky bits:
RustThing
. I essentially duplicatedRustThing
fromparser.rs
torust_types.rs
because it made sense for topological sorting. I think this needs some cleanup / further thought.write_types
. I copy pasted logic into the Go implementation (it already has duplicate logic w.r.tmod.rs
) although it is not strictly necessary for Go, just to keep things the same across languages.