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

Expand std.containers #72

Open
crazymonkyyy opened this issue Aug 11, 2020 · 7 comments
Open

Expand std.containers #72

crazymonkyyy opened this issue Aug 11, 2020 · 7 comments
Labels
core development phobos projects related to phobos

Comments

@crazymonkyyy
Copy link

crazymonkyyy commented Aug 11, 2020

Description

Std containers is... inadequate; which doesn't make much sense given the more palatable templates compared to c++ and the comfyness of having a definition of ranges to aim for.

What are rough milestones of this project?

  1. Make a dozen or so, formal specification and example code for some criticism.
  2. Purge the list of ideas that won't actually work in practice, and smooth out the user experience.
  3. Get 100% compliant with the d style guide and documentation standards to submit it to the std.

How does this project help the D community?

Good data structures shouldn't be a weakness here; but quite frankly they are. Data structure with op overloads and range like standards can be zero overhead abstractions that compile down roughly to the same speed as well written c code, without the same maintenance and user knowledge/work that would entail. Is that not your goal here?

Recommended skills

  • Data oriented design.
  • Rough idea what modern processors are doing.
  • Templates.

Rating

Medium

Project Type

Core development

What can students expect to get out of doing this project?

Experience to contributing to a high standard codebase.
Experience with generic programming.
Being involved with a highly passionate and experience community.

Point of Contact/Potential Mentors

@crazymonkyyy @edi33416

References

https://issues.dlang.org/show_bug.cgi?id=20801

@wilzbach
Copy link
Member

Thanks a lot for your idea, but I'm not sure whether this is a good project as Phobos can't be easily modified without breaking backwards compatibly.

A modern approach to containers in D can be found here: https://github.com/dlang-community/containers

It was planned to integrate this project into druntime, but unfortunately this effort stalled.

@crazymonkyyy
Copy link
Author

I'm more then a little confused by the repeated comments that gc this or gc that effects this.
If you allocate a large array only a very very bad gc trying to do something far to clever for its own good could screw it up and make your iteration thru it slow which given that pointers work d isnt doing that. Its a question of how you iterate thru it and manage the memory there a one time cost to allocate something big you leave alive for a long period of time is fine.

@wilzbach
Copy link
Member

There are many discussions about this, but essentially the point of a new containers library is to give people the option to choose the best-fitting allocator for their respective data.

@crazymonkyyy
Copy link
Author

Not to have good data containers?

I feel like your grouping my poor esteem for std.containers with the goals std.experimental.allocators; I'm not really interesting in custom allocators.

@wilzbach
Copy link
Member

wilzbach commented Aug 11, 2020

Well, my point was that one can't just touch the existing std.containers due to code breakage. Phobos is essentially frozen due to this problem and that's why one needs to start with a v2. However, such a v2 would need to be usable within @nogc.

@Hackerpilot
Copy link
Member

Customizing the allocator is a very important step in optimizing the way that a container actually performs in the real world.

@crazymonkyyy
Copy link
Author

Surely thats only true if it has frequent allocations; and if it has frequent allocations its cough a bad data structure.

Big data belongs in big well organized arrays

@RazvanN7 RazvanN7 added core development gsoc2021 phobos projects related to phobos labels Feb 19, 2021
@RazvanN7 RazvanN7 removed the gsoc2021 label Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core development phobos projects related to phobos
Projects
None yet
Development

No branches or pull requests

4 participants