Reduce GiveUps in data_to_word
- 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