-
Notifications
You must be signed in to change notification settings - Fork 7
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]: add support for boolean arrays in stdlib #65
Comments
You show a good understanding of the required technologies and have provided examples of previous projects. However, keep in mind the proverb "show, don't tell": When mentioning prior projects from your portfolio, it's always more effective if you can also link to them. Your proposal itself is comprehensive, but it would be good to include more details on what APIs would have to be implemented and the potential challenges you may run into and how they might be addressed. |
@soumajit23 Thank you for sharing a draft of your proposal. Building on Philipp's comments, I have a few of my own:
|
@kgryte Thank you for reviewing the proposal! |
Full name
Soumajit Chatterjee
University status
Yes
University name
Institute of Engineering and Management, Kolkata
University program
B.Tech in Electronics and Communications Engineering
Expected graduation
2026
Short biography
I am a 2nd year student pursuing a B.Tech in Electronics and Communications Engineering, from Institute of Engineering and Management, Kolkata, where I completed various relevant courses on Statistics, Calculus, Data Structures, and Algorithms. I am highly passionate about software development, especially web development, and have taken courses on Python and web development.
Apart from software, my interest also lies in hardware. I have worked on several Arduino/microcontroller-based projects and other electronics projects.
Timezone
IST (UTC+05:30)
Contact details
email:[email protected], github:soumajit23, IRC nick:soumajit23
Platform
Windows
Editor
I use VSCode since it's less cpu draining and the extensive extension options provide the ability to customize the editor according to requirements. The integrated terminal allows me to run commands and scripts within the editor, increasing productivity.
Programming experience
I have an extensive skill set in various programming languages. I am proficient in HTML, CSS, JavaScript, and C. I also have experience coding in MATLAB, Java, and Python languages.
Furthermore, I am familiar with several technologies such as Bootstrap, Node.js, Express.js, PostgreSQL, EJS, jQuery and REST APIs, and I am well-versed in their usage. I also have a good understanding of CLI usage.
Some projects I have worked on:
Website: soumajit23.github.io/simon-game/
Repository: https://github.com/soumajit23/simon-game
Website: soumajit23.github.io/drum-kit/
Repository: https://github.com/soumajit23/drum-kit
JavaScript experience
I am proficient in JavaScript, having built projects, which use JavaScript for both frontend and backend development.
A thing I like about JavaScript is its vast ecosystem of libraries and frameworks, that simplify development for various tasks like user interface creation, data manipulation, and more. Also, JavaScript has a large and active community of developers who contribute to its growth and improvement. This means there are plenty of resources, tutorials, and open-source projects available to help developers like me, learn and solve problems.
Node.js experience
Experience with Node.js for backend development has given me a robust foundation in building efficient server-side applications. Working on projects with Node.js has allowed me to harness its extensive ecosystem of libraries and frameworks, enabling rapid development and deployment of features. I have implemented RESTful APIs, used frameworks such as Express.js to build efficient server applications, and built projects that have the usage of Node.js.
C/Fortran experience
My familiarity with the C language, gained through university coursework spanning the second and third semesters, has given me a solid understanding of fundamental programming concepts and principles. I've explored various data structures like arrays, linked lists, stacks, queues, trees, and graphs, understanding their implementations, operations, and applications.
Interest in stdlib
Everything, from the source code to the pull requests is well organized, properly named, and easy to follow and refer to. This makes contributing to
stdlib
much easier and more convenient. The community is also very welcoming to people like me who are new to open-source contributions.Furthermore, since I am passionate about mathematics and always get intrigued to learn new ways to implement mathematical and scientific computations to coding,
stdlib
seems like the perfect place to do so.Version control
Yes
Contributions to stdlib
I have 3 open PRs as of now:
blas/ext/base/dssumpw
to follow current project conventions stdlib#1999array/base/assert
namespace stdlib#1955Goals
The primary goal of this project is to enhance
stdlib
for JavaScript by introducing support for boolean arrays (BooleanArray
). Currently,stdlib
provides extensive support for numeric arrays but lacks dedicated support for boolean data types. The introduction ofBooleanArray
aims to address this and provide support for boolean values. This project will refer to previously added custom-typed arrays, namelyComplex64Array
andComplex128Array
.@stdlib/array/bool
Package Creation:The key objective is to create a new
@stdlib/array/bool
package that exposes aBooleanArray
constructor, enabling developers to create and manipulate boolean arrays efficiently. This involves implementing standard array methods, such as indexing, iteration, and manipulation while adhering to the conventions established by existing typed arrays instdlib
.README.md
file to document the package and apackage.json
file to expose the directories and dependencies.BooleanArray
will be a typed array, backed by aUint8Array
and will not simply wrap a generic array.For example,
BooleanArray
will encompass a range of operations such as modification, iteration, filtering, mapping, reducing, and other relevant functionalities. For example, abenchmark.js
file forBooleanArray
can be:Other files like
benchmark.fill.js
,benchmark.filter.js
,benchmark.map.js
,benchmark.to_string.js
, etc. will be added to run benchmarks for a vast set of operations.index.js
file will be added to theexamples
directory to run examples like:lib
directory will be responsible for exporting modules. For instance, afrom-array.js
might look like this:This file exports a
fromArray
function to provide functionality to convert an array of boolean values into a strided array. Similarly other files likefrom_iterator.js
,main.js
will be added.test.ts
file will be implemented for test cases in TypeScript language.Tests, benchmarks and examples will be run thoroughly to address any issue or bug in the code. To run tests,
will be run. Similarly, for benchmarks and examples,
will be run.
Integration of
BooleanArray
Throughoutstdlib
:The project aims to integrate
BooleanArray
seamlessly throughoutstdlib
, ensuring compatibility with existing modules and functions wherever arrays are utilized. This integration effort includes updating documentation, writing tests, refining the implementation based on feedback, etc. This work will probably make up the majority of this project and will require most of the time invested in making sure of proper integration throughoutstdlib
.BooleanArray
as a supported array data type should be done in the@stdlib/array/dtypes
namespace.Here,
bool
should return true after integration of boolean array in the namespace.filledarray()
should recognize the data typebool
and should be able to return a boolean array. This requires the addition of boolean array support to the@stdlib/array/filled
namespace.These are some of the integration work of boolean array in
@stdlib/array/*
. Further work will be done to add support of boolean arrays.Namespaces like
@stdlib/array/to-fancy
,@stdlib/array/typed
, etc. will be worked upon and updated accordingly.@stdlib/strided
namespace will be updated to support a boolean array data type.@stdlib/strided/dtypes
will be updated to support boolean array data type.Similarly,
@stdlib/ndarray
will be updated to support a boolean array data type.Addition of a package
@stdlib/assert/is-booleanarray
will be done for assertion utilities.isBooleanArray
tests if a value is a BooleanArray.Support for Boolean Arrays in ndarray and strided array APIs
The project will also support
BooleanArray
instances as backing for ndarrays and strided arrays. This entails working with C APIs and potentially modifying existing ndarrays and strided arrays functionality to accommodate boolean arrays effectively.@stdlib/strided/base/*
. Boolean will be provided with a character codep
. For instance,Function
void stdlib_strided_pp_p(...)
, can be implemented in the@stdlib/strided/base/binary
namespace. The function takes two boolean array inputs, their shapes and strides, a callback function, and performs element-wise binary operations on the input arrays, storing the results in the boolean array output.Implemented in
@stdlib/strided/base/nullary
. To apply the nullary callback,These are some of the APIs to be implemented for strided arrays. Further careful addition of APIs would be done.
@stdlib/ndarray/*
namespace. For instance an implementation can be,Implemented in
@stdlib/ndarray/base/unary
. To apply callback,Further careful addition and implementation of APIs will be done for ndarrays to support boolean arrays.
Throughout development, attention will be paid to performance optimizations, ensuring that
BooleanArray
operations are efficient and scalable. Moreover, comprehensive documentation will guide developers in utilizingBooleanArray
effectively within their projects.This project aims to enrich the
stdlib
ecosystem with a dedicated boolean array data type, empowering JavaScript developers with enhanced data manipulation and analysis capabilities, particularly in scenarios requiring boolean-based indexing and filtering operations.Why this project?
The addition of
BooleanArray
support expands the capabilities ofstdlib
by providing developers with a dedicated data type for boolean arrays. This enhances its versatility, allowing for more efficient and expressive manipulation of boolean data within JavaScript applications. By addressing the need for boolean arrays withinstdlib
, the project demonstrates responsiveness to the needs of the community. Providing features that align with developers' requirements enhances satisfaction and fosters continued adoption and support forstdlib
.I would like to mention that contributing to this project would not only help in achieving the project's goals but also aid in my personal and professional growth. It would provide me with an opportunity to work on a complex project, collaborate with others, and contribute positively to the community. Moreover, this project would enable me to enhance my JavaScript programming skills, especially in the areas of array manipulation and API design.
Qualifications
Working on this project requires knowledge of JavaScript, C, Node,js, and Native Addons. Whether through University coursework or by building projects, I feel like I have the necessary knowledge of these technologies and would be able to implement these in a major project.
I have also gone through the source code and realized the needs of
stdlib
and the necessity of this project.Prior art
Implementation of custom-typed arrays similar to the proposed
BooleanArray
in other programming languages and libraries:NumPy
provides support for boolean arrays through itsndarray
data structure.NumPy
arrays can hold boolean values and are commonly used for boolean indexing and masking operations, similar to whatBooleanArray
should do.Studying these implementations could prove helpful when working on
@stdlib/array/bool
.Additionally, since there exists prior art for adding custom-typed arrays to stdlib; namely,
Complex64Array
andComplex128Array
, these should serve as the appropriate approach to work on@stdlib/array/bool
.Commitment
I do not have any other professional commitment for the entire summer, and my academic schedule does not clash with the coding period. Therefore, I plan on dedicating 30 hours per week to this project for the entire 12-week program duration.
Schedule
Assuming a 12 week schedule,
Community Bonding Period:
stdlib
codebase and documentation.BooleanArray
constructor and basic functionality.Week 1-2:
BooleanArray
Implementation@stdlib/array/bool
package exposing a new typed array constructor.BooleanArray
implementation.BooleanArray
functionality in isolation to identify and fix any bugs.Week 3-5: Integration with
stdlib
ModulesBooleanArray
support into existingstdlib
modules, starting with basic array manipulation functions.BooleanArray
support and provide examples for users.BooleanArray
with otherstdlib
modules.Week 6-7: Support for ndarrays (midterm)
BooleanArray
support with ndarrays.BooleanArray
as backing arrays and ensure efficient operability between them.Week 8: Optimizations to improve the integration with ndarrays
BooleanArray
-backed ndarrays to ensure correct behavior and performance.Week 9-10: Documentation and Testing
BooleanArray
, including API reference documentation and usage guides.BooleanArray
functionality.Week 11-12: Refinement and Finalization
Final Week: Submission
Note:
Integration of
BooleanArray
throughoutstdlib
and adding support for boolean arrays in ndarrays could be challenging and might take longer than mentioned in the schedule. This might become evident when working on the project and the schedule could be updated accordingly.Related issues
#43
Checklist
[RFC]:
and succinctly describes your proposal.The text was updated successfully, but these errors were encountered: