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

feat: enable extern declarations to be contingent on OS or target language #3030

Open
davidcok opened this issue Nov 9, 2022 · 3 comments
Open
Labels
area: ffi The {:extern} attribute and otherwise interfacing with code in other languages kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny

Comments

@davidcok
Copy link
Collaborator

davidcok commented Nov 9, 2022

What is the feature you would like to see in a future version of Dafny?

I propose extern declarations be allowed to have syntax like

{:lang java :extern ... }
{:os windows :extern ... }

The declaration would be ignored if the language and/or OS do not match.
Any location that permits :extern declaration would be allowed to have multiple mutually-exclusive such declarations

Allowing this would simplify the interface to the native variations of library functionality

@MikaelMayer
Copy link
Member

Could you please compare your approach with the following one that I proposed previously?
#2397

@davidcok
Copy link
Collaborator Author

davidcok commented Nov 9, 2022

#2397 would accommodate what is requested here. I have no commitment to the mechanism, just the needed functionality -- though the approach here is not a breaking change as is #2397

@MikaelMayer
Copy link
Member

#2397 could be implemented not as a breaking change as well, if we don't get rid of {:extern} and {:compile}.

@fabiomadge fabiomadge added kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny area: ffi The {:extern} attribute and otherwise interfacing with code in other languages labels Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ffi The {:extern} attribute and otherwise interfacing with code in other languages kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny
Projects
None yet
Development

No branches or pull requests

3 participants