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

Split overloaded if construct into if and when for compiletime and runtime conditions #3

Open
VonTum opened this issue Aug 12, 2024 · 1 comment
Assignees
Labels

Comments

@VonTum
Copy link
Collaborator

VonTum commented Aug 12, 2024

We should use an extra keyword when to distinguish runtime conditions from compiletime codegen conditions?

There's a semantic difference between them. if prevents a section of hardware from being generated, while when just adds runtime conditions to it.

The big benefits are clarity of intent on the programmer's part. Also the benefit is the compiler can warn the programmer when using a when with a compile time constant, or an error on if with a non-constant.

The rest of the syntax can be entirely shared!

@VonTum VonTum changed the title if and when for compiletime or runtime conditions Split overloaded if construct into if and when for compiletime and runtime conditions Aug 13, 2024
@VonTum VonTum added good first issue Good for newcomers and removed Good for starters labels Aug 24, 2024
@TomSkarabis TomSkarabis self-assigned this Dec 7, 2024
@TomSkarabis
Copy link
Collaborator

First half is here: ceeccc6 , if you want to take a look at it @VonTum . The insane amount of line changes are because I had to regenerate the tree-sitter stuff. Is this normal or did I break something?

I will start a merge request once I get the warnings to work.

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

No branches or pull requests

2 participants