Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Builtins] Drop 'RuntimeScheme' #4778
[Builtins] Drop 'RuntimeScheme' #4778
Changes from 1 commit
2ea0b5c
86a3e24
f5639db
c736ebf
4c001d3
39784e3
eb3467d
9f6211f
2475d51
fbc32ec
dc35696
e16a7d0
f8420c0
404df06
150c935
0975598
b0c515f
5866296
5ada64f
369df92
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel a bit weird about this, but I have no good reason for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? It's the same old function, except as a class method now.
I would kinda like to forbid costing of
CekValue
s in the first place and just say that if a function accepts a term whose type is a type variable, the costing function is supposed to either ignore theExMemory
of that argument or to unlift the argument and only then look at theExMemory
of the unlifted value, but I have no idea how to express that and even if we could, I think it would be too much of a complication to worth this static guarantee.Right now I'm just keeping the old behavior and optimizing the machinery.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the reason is that before it was more explicit whereas now it feels like we could accidentally use the typeclass method on something that's not a
CekValue
and not notice. But I don't think this is really a problem.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that's exactly what we do! We call the costing functions over the
ExMemory
of unlifted values now. It's just that we occasionally unlift intoOpaque
for polymorphic builtins, which is a wrapper aroundCekValue
, hence why we need the instance. ForInteger
,Bool
,SomeConstant
etc we callmemoryUsage
directly without going throughCekValue
twice (once for unlifting, once for costing). It's the whole point of this PR!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently I have no idea what the point of this PR is ;)