CakeML / CakeML/cakeml

Support custom failure exceptions in the translator

Open
#181 1 comment 0 reactions 0 assignees View on GitHub
help wanted low effort translator
Dominant language
Standard ML
Stars
1.2k
Forks
104
Avg merge
2d 21h
Merged PRs (30d)
16

Description

Currently, if you translate something with a side-condition from `ARB`, the translator produces the code `raise Bind`. It would be nice to tweak this a little to allow an arbitrary exception. For example:
```
val _ = register_exn ``Size``; (* made this up... not sure how it should work *)
val sub_def = Define`sub i ls = if i < LENGTH ls then EL i ls else FAIL Size ARB`;
```
to produce code that calls `raise Size` rather than `raise Bind`.
This requires the translator to support defining exceptions too.

For sophisticated use of exceptions, one must use CF, but for exceptions that correspond to side-conditions we expect to always be true, it would be nicer to just use the translator.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.