CakeML / CakeML/cakeml

Reduce GiveUps in data_to_word

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

Description

Some of the `GiveUp`s in `data_to_word` could be compiler failures rather than generating code that aborts at runtime. This is better for the user since the failure is caught earlier. However, it requires making the compiler able to fail (`CompileError`) at `data_to_word`. For example, `Cons tag` becomes `GiveUp` if `tag < dimword (:'a) DIV 16` which is decidable at compile time.

(An alternative hack, maybe, is to produce code that will produce an encoding error in asm (i.e., a jump that's too big). Probably too hard and hacky.)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the data_to_word entry point and the existing CompileError path. Check the Cons tag case and its compile-time condition, then determine which GiveUps can become compile-time failures; done means those cases fail during compilation rather than aborting generated code, with the relevant compiler checks covered.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.