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

Compiler directive #impure #757

Open
emil14 opened this issue Nov 9, 2024 · 0 comments
Open

Compiler directive #impure #757

emil14 opened this issue Nov 9, 2024 · 0 comments

Comments

@emil14
Copy link
Collaborator

emil14 commented Nov 9, 2024

Introduce new compiler directive #impure and mark all native components in stdlib with it. Analyzer must restrict usage of this directive to stdlib and native components only - normal components and components outside of stdlib must never use it.

// http

#impure
def Get(...) (...)

This way it would be possible to tell at compile-time that some node-tree is pure or impure. E.g. it would be possible to implement other features like restrict Map to be used with pure components only, so it's always possible to run it concurrently (see #754 for a related problem)

Questions

  1. How to handle components with interfaces?
  2. What to do with components that does go-interopability (when it will be here)?

In the future when there will be Go interop, component that does it must either be always threaten like "impure" or it's up to developer to mark it (analyzer should allow it then). Maybe there are other options to think about though.


Related to #228

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

No branches or pull requests

1 participant