CakeML / CakeML/cakeml

Improve compilation of Pancake's exception

Open
#1,475 1 comment 0 reactions 0 assignees View on GitHub
Pancake
Dominant language
Standard ML
Stars
1.2k
Forks
104
Avg merge
2d 21h
Merged PRs (30d)
16

Description

Pancake's `Raise` semantics has a check that the exception value shape is smaller than 32 words (see code below), because it is currently compiled into stores to wordLang `Temp` stores later on in the compiler. A possible improvement is to remove this check which can allow arbitrary shape exception and compile it in a different manner.
```
(evaluate (Raise eid e,s) =
case (FLOOKUP s.eshapes eid, eval s e) of
| (SOME sh, SOME value) =>
if shape_of value = sh ∧
size_of_sh_with_ctxt s.structs (shape_of value) <= 32
then (SOME (Exception eid value),empty_locals s)
else (SOME Error,s)
| _ => (SOME Error,s)) /\
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with Pancake's Raise evaluation and the shown exception-shape check, then trace how exception values become wordLang Temp stores later in the compiler. Done means defining and implementing the alternative compilation approach so arbitrary-shape exceptions are supported without the current 32-word restriction.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.