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

Fast nockma eval #2580

Merged
merged 10 commits into from
Jan 19, 2024
Merged

Fast nockma eval #2580

merged 10 commits into from
Jan 19, 2024

Conversation

janmasrovira
Copy link
Collaborator

@janmasrovira janmasrovira commented Jan 11, 2024

Adds annotations to cells to indicate that it is a call to the stdlib and might be evaluated faster in the Haskell evaluator.

The syntax for stdlib calls is as follows:

[stdlib@add args@<args-term> <left-term> <right-term>]

where add is the name of the function being called, <args-term> is a nockma term that points to the position of the arguments, and <left-term> and <right-term> are the actual components of the cell.

@@ -167,7 +172,7 @@ eqStack st = eqSubStack st []
unfoldTerm :: Term Natural -> NonEmpty (Term Natural)
unfoldTerm t = case t of
TermAtom {} -> t :| []
TermCell Cell {..} -> _cellLeft NonEmpty.<| unfoldTerm _cellRight
TermCell (Cell l r) -> l NonEmpty.<| unfoldTerm r
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? Doesn't it go against our general style (of using named fields)?

@lukaszcz lukaszcz merged commit 39d176e into main Jan 19, 2024
4 checks passed
@lukaszcz lukaszcz deleted the fast-nockma-eval branch January 19, 2024 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants