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

Use a decision tree for when Expressions #1040

Merged
merged 35 commits into from
Nov 8, 2024
Merged

Use a decision tree for when Expressions #1040

merged 35 commits into from
Nov 8, 2024

Conversation

MicroProofs
Copy link
Member

@MicroProofs MicroProofs commented Oct 8, 2024

Using the algorithm from this paper
https://www.cs.tufts.edu/comp/150FP/archive/luc-maranget/jun08.pdf

We can make the pattern matching when expressions in Aiken both more efficient and simpler in codegen. Instead of processing a TypedExpr of cases and nested cases. We instead build up a decision tree and use that to produce the Air op codes to carry out the pattern matching. Which enables a large simplification to the existing op codes today.

For another in depth explanation and implementation of the algorithm described above. Look here
https://github.com/clojure/core.match/wiki/Understanding-the-algorithm

@MicroProofs MicroProofs merged commit cd42f51 into main Nov 8, 2024
13 checks passed
@MicroProofs MicroProofs deleted the decision-trees branch November 8, 2024 19:24
@MicroProofs
Copy link
Member Author

Closes #887

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

Successfully merging this pull request may close these issues.

1 participant