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

Remove clause guards. #886

Closed
Tracked by #754
KtorZ opened this issue Mar 20, 2024 · 0 comments · Fixed by #990
Closed
Tracked by #754

Remove clause guards. #886

KtorZ opened this issue Mar 20, 2024 · 0 comments · Fixed by #990
Labels
code gen Untyped Plutus Core code generation parsing Parser work typechecking Types and inference

Comments

@KtorZ
Copy link
Member

KtorZ commented Mar 20, 2024

What is your idea? Provide a use case.

Clause guards have proven not-so-useful (from surveying the Aiken community and analyzing available open-source repositories). So let's remove them from the language.

Why is it a good idea?

They clutter the codebase and make maintenance harder than it needs to be. Less code means less things that can go wrong.

Besides, they can also be a great footgun, as they usually force the use of wildcard patterns in pattern-matches. Why is this bad? Because it makes code more brittle and fragile on updates since the a wildcard will swallow any modifications made on new constructor variants. Yet, we do generally want compiler warnings in such a scenario to ensure that cases are handled properly when needed.

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

More maintenance.

@KtorZ KtorZ mentioned this issue Mar 20, 2024
52 tasks
@KtorZ KtorZ added this to the 1.0.26-alpha milestone Mar 20, 2024
@KtorZ KtorZ added parsing Parser work typechecking Types and inference code gen Untyped Plutus Core code generation labels Mar 20, 2024
@KtorZ KtorZ changed the title Remove complex clauses creation (TupleGuard, ClauseGuard, ListGuard) in favor of simplifying when conditions in the Aiken ast Remove clause guards. Mar 20, 2024
@rvcas rvcas moved this to ✅ Done in Project Tracking Mar 22, 2024
@rvcas rvcas moved this from ✅ Done to 🚀 Todo in Project Tracking Mar 22, 2024
@KtorZ KtorZ removed this from the 1.0.27-alpha milestone Apr 4, 2024
KtorZ added a commit that referenced this issue Aug 1, 2024
KtorZ added a commit that referenced this issue Aug 1, 2024
KtorZ added a commit that referenced this issue Aug 1, 2024
MicroProofs pushed a commit that referenced this issue Aug 2, 2024
@github-project-automation github-project-automation bot moved this from 🔨 Todo to ✅ In Next Release in Project Tracking Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code gen Untyped Plutus Core code generation parsing Parser work typechecking Types and inference
Projects
Status: ✅ In Next Release
Development

Successfully merging a pull request may close this issue.

1 participant