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

[RFC]: achieve ndarray API parity with built-in JavaScript arrays #137

Open
7 tasks done
G4URAV001 opened this issue Apr 4, 2025 · 1 comment
Open
7 tasks done
Assignees
Labels
2025 2025 GSoC proposal. received feedback A proposal which has received feedback. rfc Project proposal.

Comments

@G4URAV001
Copy link

G4URAV001 commented Apr 4, 2025

Full name

Gaurav Jadhav

University status

Yes

University name

Vishwakarma Institute of Information Technology

University program

Bachelor of Technology in Computer science Engineering ( Cyber security )

Expected graduation

2027

Short biography

I am currently in the 2nd year of Undergraduate in Vishwakarma Institute of Information Technology. I started my coding with c/c++ to learn all the basics of coding, then continuing to Data Structure Algorithms, Database Management Systems. I started to get interest in web development, for which I got experience in JavaScript, typescript, react, handling data in mongodb, express etc. I have also some knowledge of some machine learning.

Timezone

Indian Standard Time ( IST ), UTC+5:30

Contact details

[email protected]

Platform

Windows

Editor

I use vs code as my preferred code editor as it was also my first editor used. I tried different IDE's (eclipse, vim, nvim etc) but I keep going back to vs code for vs code being very easy to work with any kind of coding I would like to do with its vast collection of extensions for almost everything making the experience very smooth.

Programming experience

I have got a lot of experience in programming in c/c++, java as part of my college projects, assignments and exams.
On top of that I have worked on some projects -

Web Scrapper -
Register and log in to access the application features
Create and manage scrapers with custom extraction rules
View scraped data and export it in different formats (CSV, JSON)
Configure webhooks to send data to other applications
Schedule scraping jobs to run automatically

finance tracker (College project) -
The app includes features like easy income and expense tracking
Category-wise breakdowns (such as food, travel, and study materials)
Dashboard to view daily and monthly spending summaries
Budget-setting options to help users stay within limits

blood donation database frontend (College project) -
The frontend includes features responsive UI for browsing donor information
Search and filter options based on blood group, location, or availability
Simple form for adding new donors
Sections like donor lists, registration, and contact details

JavaScript experience

I have worked in JavaScript mainly while learning web development and while working on the projects for them. I was enrolled in an cohort where I also got some tasks and assignment that help me get the much-needed experience in JavaScript.

While learning JavaScript the first uphill is when learning about the async callbacks, awaits, promises etc, it was s

Node.js experience

For all the projects I have made I have used node.js as backend. I used things like express for http server, jwt for authentication, axios, fs and many more.

C/Fortran experience

I had experience of c in college while starting to learn programming. I don't have much experience in that. I don't have any experience in fortran but always ready to take a deep dive in it

Interest in stdlib

todo

Version control

Yes

Contributions to stdlib

Open
Closed or Merged

todo

stdlib showcase

todo

Goals

The goal of this project is to implement array methods for ndarrays which are efficient, well documented and well tested.

There are some base implementation that has c APIs c-API funtions.pdf for much efficient operations that can we used in our implementions example.pdf

List of eqvivalent method to be implemented

Array.prototype.reverse
Array.prototype.toReversed
Array.prototype.with (A PR exists)
Array.prototype.fill (ndarray/fill-slice)
Array.prototype.includes
Array.prototype.indexOf
Array.prototype.lastIndexOf
Array.prototype.some
Array.prototype.concat
Array.prototype.copyWithin
Array.prototype.find
Array.prototype.findIndex
Array.prototype.findLast
Array.prototype.findLastIndex

Why this project?

For most of the time i was seeing stdlib, most of the interesting issues that i worked on happened to be related to arrays and arrays remained to be favorite section to work on. The ndarray help me to elevate this interest in arrays by taking it to next level with it new complexities and challenges of which glimpses i saw

Qualifications

The time I spend on stdlib has given me a lot of knowledge with working on arrays like

Implementation of toSorted --
it was help me understand how to does an method on array actually work and the basic, small yet important things that should be known.

Implementation of broadcasted-quinary5d --
It was a jump from simple to-sorted implementation that introduced the complexity and how to write full implementations of methods

Implementation of copyWithin --
This filled the gap of experience of working with typed-arrays and the opportunity that comes with them to squeeze more efficiency from them

Prior art

I know that NumPy has range of functions for multi-dimensional arrays and had seen some like concat etc and
Ndarray https://numpy.org/neps/nep-0020-gufunc-signature-enhancement.html

math.js also have some implementations. https://mathjs.org/docs/datatypes/matrices.html

Commitment

I am ready to invest 15 hr/week or more for 12-week schedule as I don't have any other commitment, and I also have months long holidays allowing me to focus completely on this project. I will not have any exam or not going on any vacation during the program

Schedule

Assuming a 12 week schedule,

  • Community Bonding Period:

  • Week 1:
    Implement Array.prototype.some with tests
    Begin implementation of Array.prototype.reverse
    Write documentation for both methods

  • Week 2:
    Complete implementation of Array.prototype.reverse (if not finished)
    Implement Array.prototype.toReversed building on reverse
    Write tests and documentation

  • Week 3:
    Implement ndarray/fill-slice extending existing fill functionality
    Write tests for edge cases and documentation
    Begin work on Array.prototype.concat design

  • Week 4:
    Complete Array.prototype.concat implementation
    Add comprehensive tests for concat with various dimensions
    Finalize documentation
    Prepare midterm evaluation materials

  • Week 5:
    Implement Array.prototype.includes with tests
    Begin documentation for includes
    Implement Array.prototype.indexOf with tests

  • Week 6: (midterm)
    Implement Array.prototype.lastIndexOf with tests
    Add documentation for both methods
    Address feedback from previous PRs

  • Week 7:
    Begin Array.prototype.copyWithin implementation
    Write tests for basic functionality

  • Week 8:
    Complete Array.prototype.copyWithin to handle complex cases:
    Strided arrays
    Overlapping regions
    Add additional tests and documentation

  • Week 9:
    Create shared code infrastructure for find family of methods
    Implement Array.prototype.find with tests
    Implement Array.prototype.findIndex with tests

  • Week 10:
    Implement Array.prototype.findLast with tests
    Implement Array.prototype.findLastIndex with tests
    Write documentation for all find methods

  • Week 11:
    Code freeze, no new feature implementations
    Address feedback from previous PRs
    Enhance test coverage to address edge cases
    Improve documentation with more examples

  • Week 12:
    Finalize all documentation
    Begin preparation of final report

  • Final Week:
    Submit final project report

This is the 12 week plan

Related issues

There is an rfc tracking issue #2656 that list the potential method for ndarray and the status.

Checklist

  • I have read and understood the Code of Conduct.
  • I have read and understood the application materials found in this repository.
  • I understand that plagiarism will not be tolerated, and I have authored this application in my own words.
  • I have read and understood the patch requirement which is necessary for my application to be considered for acceptance.
  • I have read and understood the stdlib showcase requirement which is necessary for my application to be considered for acceptance.
  • The issue name begins with [RFC]: and succinctly describes your proposal.
  • I understand that, in order to apply to be a GSoC contributor, I must submit my final application to https://summerofcode.withgoogle.com/ before the submission deadline.
@G4URAV001 G4URAV001 added 2025 2025 GSoC proposal. rfc Project proposal. labels Apr 4, 2025
@kgryte kgryte self-assigned this Apr 4, 2025
@kgryte
Copy link
Member

kgryte commented Apr 5, 2025

@G4URAV001 Thank you for opening this RFC. A few questions/comments:

  1. You mention creating shared code infrastructure for the find family of methods. How do you envision that infrastructure looking like?
  2. Of the methods that you propose implementing, which will require "base" kernels and which won't? (see ndarray/every vs ndarray/base/every)
  3. How is copyWithin going to work? Are you planning on supporting multiple axes? If so, what is this going to look like and how will this be achieved? If only a single axis, how will indices be specified and apply across dimensions? E.g., if I want to apply copyWithin to each row, will indices be the same for each row or will they be different?
  4. I suggest putting together various API signatures. Merely saying that you will implement API foo doesn't tell us much about how you are envisioning constructing these APIs.
  5. Which of the proposed methods will have corresponding C implementations and which won't? It would be good to explain your rationale.

@kgryte kgryte added the received feedback A proposal which has received feedback. label Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2025 2025 GSoC proposal. received feedback A proposal which has received feedback. rfc Project proposal.
Projects
None yet
Development

No branches or pull requests

2 participants