IntersectMBO / IntersectMBO/cardano-base

Ensure all static sizes defined in C are reused

Open
#682 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
105
Forks
54
Avg merge
9d 2h
Merged PRs (30d)
4

Description

There are examples of size that are known statically that are hard coded in multiple places on the Haskell side. We should be using CPP instead.
This ticket is about doing inventory and ensuring that these sizes are verified at compile time, similarly to how it is done here:
https://github.com/IntersectMBO/cardano-base/blob/e1d7397e30d23c3c662cbe6ada82dad3bf0401e0/cardano-crypto-class/cbits/blst_util.c#L10-L16

Contributor guide

Open the contributing guide

Research direction

Start by reading cbits/blst_util.c lines 10-16, the referenced example of compile-time size verification. Inventory the Haskell-side hard-coded static sizes and compare them with the corresponding C definitions; done means the duplicated sizes use CPP and are verified at compile time.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, haskell
Domain
build-system
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.