-
Notifications
You must be signed in to change notification settings - Fork 469
Promoting rescript-vector to a primitive data structure #6181
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
Comments
This could fit nicely with a data structure library to go alongside Core. Later on, one could consider deeper integration with the language. @zth thoughts? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
i guess this could still be nice |
More than ever. As we're sunseting OCaml std and Belt, we need a high-quality DS library |
I guess having it as a separate installable package makes sense though, right? |
Yes. I believe we already discussed somrwhete making the |
Can it somehow also extend existing Core modules? There are a lot of convenience functions in Belt that I'd miss like Array.partition. |
I think it depends on the goal of the Core. If it prefers thin, mostly zero-cost bindings, I'd like to split the layer rather than directly replace Belt (like Jane Street's Core and Base). |
Suggesting integrating @namenu's persistent vector library with the compiler.
https://github.com/reason-seoul/rescript-collection/tree/main/packages/vector
This library implemented in pure ReScript is optimized for changing the last element, unlike a list optimized for changing the head (first element).
This is useful if a user needs an Array-like structure but an immutable one. It is faster than the ImmutableJS and Mori, which are homogeneous libraries available in JS. (See benchmark)And its stability has been verified with fuzz tests.
It is available today in any ReScript project, but integrating it with a compiler can provide list-like ergonomics. For example:
The text was updated successfully, but these errors were encountered: