Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 393
    • Issues 393
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 24
    • Merge requests 24
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Merge requests
  • !307

No more guards for type pattern checks

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jordy Aaldering requested to merge yet-another-guard into develop Jun 17, 2024
  • Overview 1
  • Commits 35
  • Changes 81

NoMoreGuardsProposal.pdf

Changes:

  • Removed type_fix prf
  • Removed guard_error prf
  • Removed type arguments from guard prf
    x1', .., xn' = guard(x1, .., xn, t1, .., tn, p1, .., pm) → x1', .., xn' = guard(x1, .., xn, p1, .., pm)
  • Created new prf conditional_error
    acc' = conditional_error(acc, pred, "msg")
    Which returns true if both the accumulator and predicate are true, and false otherwise. By weaving in this accumulator we ensure that the function is not optimised away, and based on the predicate we are more likely to be able to print an error message already at compile-time.
  • Created a new global object rterror, which we use to weave in the accumulated value from conditional_error into the control flow. This approach seems to be better than the guards we had previously, as we now open the door to more optimisation potential again.
  • Remove no longer necessary WrapperFundef and CheckImplFundef from N_fundef AST node.
  • Cleanup type pattern test cases (ensure they always do -ecc -check c).
Edited Jul 09, 2024 by Jordy Aaldering
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: yet-another-guard