Skip to content
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

Full coverage of SN posixlib #103

Closed
keynmol opened this issue Sep 3, 2022 · 0 comments · Fixed by #105
Closed

Full coverage of SN posixlib #103

keynmol opened this issue Sep 3, 2022 · 0 comments · Fixed by #105
Labels
enhancement New feature or request
Milestone

Comments

@keynmol
Copy link
Contributor

keynmol commented Sep 3, 2022

Pre-history: because namespaces don't exist in C or binary world, all the names are globally resolved.

As such, wherever we encounter a symbol from libclang which is a struct or a function, we can check it against the globally known list of structs or functions, and if they exist in Scala Native's posixlib, we should use that name, instead of generating our own code.

We already do it for some types: https://github.com/indoorvivants/sn-bindgen/blob/main/modules/bindgen/src/main/scala/BuiltinType.scala#L29-L66 but the list is woefully incomplete.

  1. Find a way to automatically index the posixlib sources of Scala Native
    It would be excellent to use either semanticdb or tasty files served with each
  2. Generate the contents of this file: https://github.com/indoorvivants/sn-bindgen/blob/main/modules/bindgen/src/main/scala/BuiltinType.scala#L29-L66 and provide the SBT task to regenerate it

One major requirement is to group the found posixlib definitions by version in which they were introduced.
Bindgen itself can take a parameter to indicate which version it should target.
In SBT plugin that version will be equal to the SN version enabled in the project

@keynmol keynmol added the enhancement New feature or request label Sep 3, 2022
@keynmol keynmol added this to the 0.1.0 milestone Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant