-
Notifications
You must be signed in to change notification settings - Fork 256
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
Derive property of type access #1300
Draft
keyboardDrummer
wants to merge
28
commits into
master
Choose a base branch
from
derivePropertyOfTypeAccess
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
keyboardDrummer
force-pushed
the
derivePropertyOfTypeAccess
branch
3 times, most recently
from
July 19, 2021 10:30
33c50d6
to
bc8a6ac
Compare
… datatypes like Attribute yet
…, and improved caching
keyboardDrummer
force-pushed
the
derivePropertyOfTypeAccess
branch
from
July 19, 2021 10:31
bc8a6ac
to
9945f7f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use type information to generate code for
Expression.SubExpressions
,Statement.SubExpressions
,Statement.SubStatements
andComponentTypes
.DafnyAst.cs
by about ~400 lines. Note that the absolute size change is smaller because auto-formatting has added extra lines such as white-lines between methods.SubExpressions
implementation forAssignOrReturnStmt
,ChainingExpression
We don't expect any relevant changes in performance. While the code generation uses reflection, which is slow, the generated code does not use reflection. The code generation only runs once per instance of Dafny so the time spent on that is negligible.
Caveats
Alternatives
Instead of runtime code generation, we can use compile-time code generation which resolves caveat 2 and 3 from above. With source generators we don't have the downside of having to run a separate generation process as part of the build and the IDE clearly identifies the generated code. Note that Source generators are still in preview.