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

Reimplement associative arrays on runtime #17455

Open
dlangBugzillaToGithub opened this issue Jan 5, 2023 · 1 comment
Open

Reimplement associative arrays on runtime #17455

dlangBugzillaToGithub opened this issue Jan 5, 2023 · 1 comment
Assignees
Labels
Druntime:AA Specific to Associative Arrays Druntime Specific to druntime P4 Severity:Enhancement

Comments

@dlangBugzillaToGithub
Copy link

dlangBugzillaToGithub commented Jan 5, 2023

Marcelo Silva Nascimento Mancini reported this on 2023-01-05T19:38:14Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=23602

Description

Current D Runtime Associative Array is pretty buggy. 
After talking with some, people, its implementation was done even before D having templates, so, it should not be too hard to do it better than how it is now[1]. 
Right no no one wanted to rework on it, but everyone which tried doing a custom druntime basically dropped support for associative arrays given how confusing is to implement them.
 I'm working on them for Adam's minimal runtime and I just saw that implementing them would basically be as complex as implementing everything that has been done so far for this minimal wasm runtime.

There is some proposals such as mapping Associative Array to a library type rather than doing bunch of hooks, which seems to be a better solution for the long run.

[1]: Steve has done a new associative array implementation that maps to the current one, it has roughly 1/3 LoC the current one has and it is a lot easier to understand: https://github.com/schveiguy/newaa/blob/master/source/schlib/newaa.d
@thewilsonator thewilsonator added Severity:Enhancement Severity:blocker Druntime Specific to druntime Druntime:AA Specific to Associative Arrays and removed enhancement Arch:x86 Issues specific to x86 Severity:blocker labels Dec 8, 2024
@schveiguy
Copy link
Member

I think full reimplementation of the AA type in a library is going to be tough, as there are magic pieces in the compiler for inserting and using data, or implicit casting.

But we can remove usage of TypeInfo, which would simplify the implementation and expand the portability to other platforms

FYI, this was your issue @MrcSnm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Druntime:AA Specific to Associative Arrays Druntime Specific to druntime P4 Severity:Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants