Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Idea]: achieve ndarray API parity with built-in JavaScript arrays #33

Open
kgryte opened this issue Feb 6, 2024 · 2 comments
Open
Labels
difficulty: 3 Likely to be challenging but manageable. idea Potential GSoC project idea. priority: high High priority. tech: javascript Involves programming in JavaScript.

Comments

@kgryte
Copy link
Member

kgryte commented Feb 6, 2024

Idea

Built-in JavaScript arrays (and typed arrays) have a number of methods for creating, transforming, and manipulating array contents (e.g., forEach, map, reverse, slice, filter, etc). These APIs provide base level functionality forming a default vocabulary for working with array data.

The goal of this idea is to create functional analogs of array methods for working with ndarrays, which are efficient data structures for operating on multi-dimensional data. The main difficulty in implementing analogs is in ensuring efficient iteration of non-contiguous data. The main patterns for such iteration have been established in stdlib, but work remains to apply such patterns for top-level array-equivalent APIs.

Expected Outcomes

Users will be able to use functional APIs (exposed as part of individual packages) for operating on ndarrays in a manner similar to how users can use prototype methods available on built-in arrays and typed arrays.

Involved Software

No other software is necessary.

Prerequisite Knowledge

JavaScript, Node.js.

For APIs not accepting callbacks, certain kernels can be implemented in C, as time and scope allow.

Difficulty

Intermediate. Writing the loop kernels can be involved, but, once understood, are straightforward to apply.

Project Length

90/175/350 hours. Can be scoped accordingly. Scope can be expanded to implement additional ndarray kernels outside of Array method equivalents.

Potential Mentors

@kgryte @Planeshifter @steff456 @rreusser

@kgryte kgryte added idea Potential GSoC project idea. priority: high High priority. difficulty: 3 Likely to be challenging but manageable. tech: javascript Involves programming in JavaScript. labels Feb 6, 2024
@stdlib-js stdlib-js locked and limited conversation to collaborators Feb 23, 2024
@kgryte
Copy link
Member Author

kgryte commented Mar 21, 2024

To reiterate, and as indicated in the OP, no methods should be added to the ndarray.prototype. An ndarray object is intended, and should remain, a minimal wrapper which simply describes meta data. All behavior should be left to functional APIs in the ndarray namespace.

@kgryte
Copy link
Member Author

kgryte commented Jul 24, 2024

Related: stdlib-js/stdlib#2656

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
difficulty: 3 Likely to be challenging but manageable. idea Potential GSoC project idea. priority: high High priority. tech: javascript Involves programming in JavaScript.
Projects
None yet
Development

No branches or pull requests

1 participant