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

VIP: defer implementation in .vyi files. #4350

Open
AlbertoCentonze opened this issue Nov 5, 2024 · 2 comments
Open

VIP: defer implementation in .vyi files. #4350

AlbertoCentonze opened this issue Nov 5, 2024 · 2 comments
Labels
VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting

Comments

@AlbertoCentonze
Copy link
Contributor

AlbertoCentonze commented Nov 5, 2024

Simple Summary

Using implements in .vyi files shouldn't force to copy paste the methods from the imported interface. It should just defer the implementation of the methods to future implementations as a dependency.

Motivation

As of now people willing to combine interfaces together similar to solidity's inheritance, have to do so manually in a verbose manner. This approach makes it simple and concise to do so.

Specification

As described in the summary.

Backwards Compatibility

This is a breaking change for .vyi files.

Copyright

Copyright and related rights waived via CC0

@AlbertoCentonze AlbertoCentonze added the needs triage needs triage label Nov 5, 2024
@pcaversaccio
Copy link
Collaborator

I don't oppose the overall proposal here, as I think it's a sane thing to do, but I want to share some additional thoughts/concerns:

  • The proposal breaks the semantics around implements. For me as a library author that offers custom interfaces without explicit implementations, having implements enforce the correctness of my custom interface is a feature.
  • It's problematic for a single keyword to have different meanings based on the compilation target. Furthermore, .vyi files will be made compilable probably in the feature: Vyper interface compilation #4232. So this could lead to the situation where you compile a .vyi file with an incomplete implements statement, which would give a wrong sense of correctness for the interface itself.

@charles-cooper charles-cooper added VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting and removed needs triage needs triage labels Nov 21, 2024
@charles-cooper
Copy link
Member

I don't oppose the overall proposal here, as I think it's a sane thing to do, but I want to share some additional thoughts/concerns:

  • The proposal breaks the semantics around implements. For me as a library author that offers custom interfaces without explicit implementations, having implements enforce the correctness of my custom interface is a feature.
  • It's problematic for a single keyword to have different meanings based on the compilation target. Furthermore, .vyi files will be made compilable probably in the feature: Vyper interface compilation #4232. So this could lead to the situation where you compile a .vyi file with an incomplete implements statement, which would give a wrong sense of correctness for the interface itself.

i think there should just be a different keyword, extends:.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VIP: Discussion Used to denote VIPs and more complex issues that are waiting discussion in a meeting
Projects
None yet
Development

No branches or pull requests

3 participants