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

type consistency with boolean comparisons #211

Open
A60AB5450353F40E opened this issue Sep 18, 2024 · 1 comment
Open

type consistency with boolean comparisons #211

A60AB5450353F40E opened this issue Sep 18, 2024 · 1 comment
Labels
cashc-compiler Relates to the cashc compiler
Milestone

Comments

@A60AB5450353F40E
Copy link

bool b, bool a;

a == b should compile to OP_NUMEQUAL (rather than OP_EQUAL)
a != b should compile to OP_NUMNOTEQUAL (rather than OP_EQUAL OP_NOT)

@mr-zwets
Copy link
Member

thanks for opening this issue!

In the first case I don't see why it would matter to use OP_NUMEQUAL rather than OP_EQUAL (they are functionally the same in this case so what is the benefit of making the breaking change?)

the second case would indeed save one opcode 👍 I quickly confirmed the compiler behavior on the playground

Making breaking changes to the compiler is only something we want to do very infrequently

@mr-zwets mr-zwets added the cashc-compiler Relates to the cashc compiler label Oct 14, 2024
@mr-zwets mr-zwets added this to the v1 milestone Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cashc-compiler Relates to the cashc compiler
Projects
None yet
Development

No branches or pull requests

2 participants