NIKX-Tech / NIKX-Tech/numx

numx_func1d_t: add a context parameter

Open
#77 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api-design community-feedback
Dominant language
C
Stars
23
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Raised during the v1.0.0 launch on r/embedded (EpochVanquisher): numx_func1d_t is a plain numx_real_t ()(numx_real_t) with no void context parameter, so closures or extra parameters aren't possible without a global, which would violate the project's own no-global-mutable-state rule. Confirmed as a real limitation, not a false alarm, affects roots.c, integrate.c, differentiate.c, and ode.c.

Three options discussed, need a decision:

  1. Add new _ctx variant functions alongside the existing ones (non-breaking, grows the API surface)
  2. A clean breaking change as part of v2.0.0 with a migration guide (this milestone)
  3. Leave it as a documented, accepted limitation

Filed under v2.0.0 as the breaking-change option since that's the version where API breaks are expected; the decision itself (including possibly choosing option 1 or 3 instead) should happen before implementation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the numx_func1d_t declaration and its use sites in roots.c, integrate.c, differentiate.c, and ode.c. Compare the three API options against the no-global-mutable-state rule and the v2.0.0 scope. Done means a documented decision on the compatibility strategy and its implementation or deferral.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.