Compile with errors - #36
Merged
uncomputable merged 6 commits intoMay 14, 2024
Merged
Conversation
Rewrite the get method in a functional style to make it more readable.
Replay pretty compile errors to the user.
Handle arrays / list expressions in the next commit and introduce
temporary unwraps. These are the only unwraps introduced by this commit.
During the translation from Simfony to Simplicity, the only errors we
should get are from the comp and case combinator.
assert{l,r} cannot fail because there is only one branch. The upstream
methods return Result, which is wrong. I will push a fixup to upstream.
pair should never fail because during the translation of Simfony to
Simplicity, the source type is variable. This is hard to prove, however,
so I chose to handle potential pair unification errors. In a future PR,
I hope to write a proof and remove all these nonexistent error paths.
Arrays and lists are nasty: The compiler constructs a lot of products which should never fail to unify... but I cannot convincingly prove it, so I must handle every single pair as potentially failing... In the end, I fold over tree of Result<ProgNode, _> instead of trees of ProgNode. This blows up the compiler code; sorry. I think it is still readable, but we should work on those infalliable pairs :)
apoelstra
approved these changes
May 13, 2024
Collaborator
Author
|
Two PRs in a row with instant ACK :o I feel the same way when I write Rust code and it instantly compiles without warnings. Happy and surprised. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extend #34 to include compile errors.