-
Notifications
You must be signed in to change notification settings - Fork 23
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
(Optional) type information #57
Comments
I've had this on my mind. Not in terms of some explicit support for type-annotations, but rather some generic facility for annotating the AST in-line with extension attributes. These could be used to associate various pieces of information that could be used by tooling (stripped before release), and allow for a simple and straightforward processing of a single data structure across a variety of transformations and annotations. You could do type annotations, in-line source-notes (for debug builds, reducing workflow complexity and number of artifacts), or any other arbitrary data. Now, whether it's feasible in practice or not is something that requires careful consideration. I can sense some of the counter-arguments that might be made (e.g. possibility of hidden payloads in BinAST files, security issues, etc.). It's a good idea but it needs to be thought about carefully. |
Yes, we had early specs on how to store/strip such data with the previous format. On the other hand, it's low-priority at the moment. We first want to ship something that works fast, and then we'll think of additional metadata! |
The possible types of a variable and/or the types the variable has during its lifetime could potentially be put to the metadata header for optimization purposes. However, type annotations would be a separate topic, I'd assume |
Binary AST could hold additional type information for variables, parameters and return types. This can help VMs do some optimizations ahead of time. Of course types should be statically validated but potentially this static analyse could be done by the same toolchain as used for binary AST creation. Was this idea considered?
The text was updated successfully, but these errors were encountered: