-
Notifications
You must be signed in to change notification settings - Fork 68
[jnigen] [ffigen] Unify Dart API #2062
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
Comments
I think this should be changed to have
Both FFIgen and JNIgen will at some point need to output a list of dependencies. #1009 #1008 So we should probably have an output objects that can easily be read to communicate to a generate hook what written files are, and what the read inputs (dependencies) are. |
Ffigen already has multiple output files (Dart code, ObjC code, symbols), so it definitely makes sense to group them into an
Visitors definitely make more sense. But does that mean you have to expose your entire set of AST classes to the public API? Or does the visitor only see a more base-ish class that only exposes stuff the user is likely to want to alter (eg name, filtering flag etc)? Ffigen unfortunately puts a lot of functionality into the AST classes, rather than having the AST be dumb data and doing all the manipulations using separate functions. So exposing all that to a visitor would show a lot of internal details. It would also make it way harder to refactor things in the future since that would all be part of the public API, so would be subject to semver. I'd want to do a gigantic refactor before exposing the AST, and we don't really have time for that if this change is going to land in EAP.
I'd prefer |
JNIgen also exposes a minimal AST. |
FfiGen().run(...)
. jnigen uses the top levelgenerateJniBindings
Uri output
. jnigen has aOutputConfig
since it also has a multifile modeshouldExposeFunctionTypedefFunc
, ... jnigen has aList<Visitor>
that combines all such functionsUri
, should we useString
s instead to specify paths? (related: Making build/link APIs useString
s to represent filepaths instead ofUri
s #1506)DeclarationFilter
s for excluding elements, jnigen has aList<Visitor>
that combines all such filters@liamappelbe, let's discuss the points above and other points that come up in this issue.
cc @dcharkes
The text was updated successfully, but these errors were encountered: