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

Add support for "deprecation" declaration #1108

Open
nemo83 opened this issue Feb 24, 2025 · 1 comment
Open

Add support for "deprecation" declaration #1108

nemo83 opened this issue Feb 24, 2025 · 1 comment

Comments

@nemo83
Copy link

nemo83 commented Feb 24, 2025

What is your idea? Provide a use case.

I've been refactoring a large set of aiken validators and I have been re-writing some pieces in order to make them more maintainable and cheap.

Although I'm happy w/ the work, and given the code is not final, I wanted to mark some functions as deprecated so that my colleagues wouldn't accidentally start using them instead of the new super cool ones.

Why is it a good idea?

Now sure how much of a good idea it is, as having deprecated code in a smart contract is not a good idea. But it could make sense for unfinished contracts where there is an ongoing, long term, multi people effort, to signal that there are multiple algorithms to solve the same problem, one of which should supersede the other, but for a while new and old code should be kept for some time.

What is the current alternative and why is it not good enough?

Current alternative is to //comment the code which is okay, but it gives no explicit warnings to users.

Afaik Aiken compiler knows how to distinguish dead branches and dead code. Which means by default it could be setup to warning or even better error out if a function is marked deprecated.

@rvcas
Copy link
Member

rvcas commented Feb 24, 2025

great idea, we'll discuss this in our biweekly thursday meeting, which you are welcome to join on the pragma discord server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🪣 Backlog
Development

No branches or pull requests

2 participants