stdlib-js / stdlib

✨ Standard library for JavaScript and Node.js. ✨
https://stdlib.io
Apache License 2.0
4.31k stars 437 forks source link

[RFC]: Add C implementations to base special math functions (tracking issue) #649

Open kgryte opened 1 year ago

kgryte commented 1 year ago

Description

This RFC proposes adding C implementations to all base special math functions. The purpose of this issue is to serve as a tracking issue for adding C implementations.

Packages

Related Issues

None.

Questions

No.

Other

No.

Checklist

Pratik772846 commented 6 months ago

@kgryte I would like to work on this.

kgryte commented 6 months ago

@Pratik772846 I suggest picking one of the associated RFCs for updating a single package. This is a tracking issue.

kgryte commented 6 months ago

@Pranavchiku As you've been managing a number of the RFCs and PRs, would you mind updating the OP to match the current state of implementations?

Pranavchiku commented 6 months ago

I am not sure if this can be closed now, reopening this.

Planeshifter commented 6 months ago

@Pranavchiku Yeah, I think GitHub unfortunately auto-closes it when we have a PR where the opening comment includes "Fixes #649" or something of the sort. Thanks for opening again!

But I see that I accidentally included "Closes #649" in the merge commit message. Will avoid and see whether that solves it going forward.

Pranavchiku commented 6 months ago

No worries, we can open it anytime so that is fine. Updated tracker to latest main.

Small script, not sure if it traps all cases. There can be false negatives but no false positives.

set -ex

# iterate over all folder in <.../math/base/special/*>
for d in <path>; do
  # if the folder is a directory
  if [ -d "$d" ]; then
    # get the name of the folder
    folder=$(basename $d)
    # check if it has `manifest.json` file
    if [ -f "$d/manifest.json" ]; then
        # if it has `manifest.json` file, then open it as j_, lookup js_[confs][dependencies] and see if it has "@stdlib/math/base/napi/unary"
        # if it has "@stdlib/math/base/napi/unary" then add it to the `names.md`
        jq -r '.jsdoc.confs.dependencies["@stdlib/math/base/napi/unary"]' $d/manifest.json
        if [ $? -eq 0 ]; then
            echo "- [x] $folder" >> names.md
        else
            echo "- [ ] $folder" >> names.md
        fi
    else
        echo "- [ ] $folder" >> names.md
    fi
  fi
done
kgryte commented 5 months ago

@Planeshifter You should always check the PR OP to ensure it properly links to issues and does not auto-close tracking issues. I often correct contributor PR OPs as they commonly include errors, including linking to incorrect issues or closing tracking issues.

Pranavchiku commented 5 months ago

Updated as per latest develop

kgryte commented 2 months ago

@gunjjoshi Would you mind updating the tracking issue with completed APIs? I believe rempio2, csc, and maybe others are finished.

kgryte commented 2 months ago

Would also be good to add relevant single-precision variants which have been, or still need to be, completed.

gunjjoshi commented 2 months ago

Yes @kgryte, I'll do that. But as this issue wasn't opened by me, I am unable to modify or edit this. Should I make a comment consisting of a list of the completed ones, and modifying that each time?

gunjjoshi commented 2 months ago

@kgryte The C implementations of the following functions have been done. They can be marked as completed now.

Planeshifter commented 2 months ago

@gunjjoshi Marked as completed. 🚀

kgryte commented 2 months ago

I updated the issue to include missing single-precision variants.

gunjjoshi commented 2 months ago

The following single-precision variants can also be marked as completed.

kgryte commented 2 months ago

@gunjjoshi Updated!