Skip to content

feat(number): add number/uint64/ctor#10908

Open
impawstarlight wants to merge 33 commits intostdlib-js:developfrom
impawstarlight:feature/uint64
Open

feat(number): add number/uint64/ctor#10908
impawstarlight wants to merge 33 commits intostdlib-js:developfrom
impawstarlight:feature/uint64

Conversation

@impawstarlight
Copy link
Copy Markdown
Contributor

@impawstarlight impawstarlight commented Mar 13, 2026

Resolves none.

Description

What is the purpose of this pull request?

This pull request:

  • Implements a constructor for creating 64-bit unsigned integers

Related Issues

Does this pull request have any related issues?

No

Questions

Any questions for reviewers of this pull request?

I've put various questions throughout the code as TODO comments

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

A lot of package structure stuff are missing and I committed with --no-verify since I wanted an early review. Also, how to run lint only for a specific package? I found filter env vars for running examples, tests, benchmarks but not for lint.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

I used Gemini and Copilot for discussing ideas, resolving errors and generating tests but the main implementation is fully done by hand.


@stdlib-js/reviewers

@impawstarlight
Copy link
Copy Markdown
Contributor Author

@kgryte I've worked out an initial implementation of the uint64/ctor

@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented Mar 13, 2026

Coverage Report

Package Statements Branches Functions Lines
number/uint64/ctor $\color{red}986/1022$
$\color{green}+0.00%$
$\color{red}72/80$
$\color{green}+0.00%$
$\color{green}10/10$
$\color{green}+0.00%$
$\color{red}986/1022$
$\color{green}+0.00%$

The above coverage report was generated for the changes in this PR.

@impawstarlight impawstarlight marked this pull request as ready for review March 13, 2026 21:35
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Mar 13, 2026
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: passed
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: passed
  - task: lint_license_headers
    status: passed
---
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@github-actions github-actions Bot mentioned this pull request Mar 29, 2026
@kgryte kgryte added Feature Issue or pull request for adding a new feature. difficulty: 3 Likely to be challenging but manageable. review: 5 and removed Needs Review A pull request which needs code review. labels Apr 21, 2026
@kgryte kgryte self-requested a review April 21, 2026 03:32
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Apr 21, 2026
… from string

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: passed
  - task: lint_package_json
    status: passed
  - task: lint_repl_help
    status: passed
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: passed
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: passed
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: passed
  - task: lint_license_headers
    status: passed
---
@kgryte kgryte requested a review from a team April 21, 2026 10:03
Copy link
Copy Markdown
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@impawstarlight Thank you for opening this PR. I went ahead and did a fair amount of surgery in hopes of simplifying the constructor and reducing the size of the implementation.

In particular, I moved support for materializing a Uint64 from a string to a separate stubbed package, which still needs to be completed.

I added various FIXMEs and TODOs for things which need follow-ups. The tests in particular I removed, as they need to be replaced with something more inline with stdlib conventions.

Ultimately, I think this and Int64 will be welcome additions and will help pave the way for Int64Array and Uint64Array arrays, which will be nice to have for other work we are currently doing with ndarrays.

Have to discuss further, but hopefully, this should provide some direction.

@kgryte
Copy link
Copy Markdown
Member

kgryte commented Apr 21, 2026

@impawstarlight Also, looks like you'll want to go ahead and setup verified commits. This will make editing your PRs a bit easier going forward.

@kgryte kgryte added Needs Changes Pull request which needs changes before being merged. review: 3 and removed Needs Review A pull request which needs code review. review: 5 labels Apr 21, 2026
Comment thread lib/node_modules/@stdlib/number/uint64/ctor/benchmark/benchmark.js
Comment thread lib/node_modules/@stdlib/number/uint64/ctor/lib/main.js
Comment thread lib/node_modules/@stdlib/number/uint64/ctor/test/test.js
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: passed
  - task: lint_license_headers
    status: passed
---
…d both BYTES_PER_ELEMENT property

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: passed
  - task: lint_license_headers
    status: passed
---
* var obj = x.toJSON();
* // returns { 'type': 'Uint64', 'words': [ 0, 5 ] }
*/
toJSON(): any;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we use any here instead of the exact object shape?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to replace with an interface. Agreed that this is under-typed, as is the complex number constructors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

difficulty: 3 Likely to be challenging but manageable. Feature Issue or pull request for adding a new feature. Needs Changes Pull request which needs changes before being merged. review: 3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants