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

Simplify Binding with #bind #814

Open
emil14 opened this issue Dec 18, 2024 · 0 comments
Open

Simplify Binding with #bind #814

emil14 opened this issue Dec 18, 2024 · 0 comments
Assignees

Comments

@emil14
Copy link
Collaborator

emil14 commented Dec 18, 2024

We don't have that much compiler directives and highly likely won't need any more. They can have their own syntax and include message literal syntax inside so we don't have to create a const and bind it, we just pass literal to the #bind

// before
const x int = 42

#bind(x)
some_node SomeNode

// after
#bind(42)
some_node SomeNode

You can however only do that with primitives because it's possible to parse their types from the text. For complex data types you would still have to use const approach. I think it makes it questionable if it worth it. Especially given that compiler directives are a feature for language and stdlib implementors, rather than end-users. Even though they have access to it (it might be useful for e.g. implementing Go-interop)

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