GithubHelp home page GithubHelp logo

Remove AssocList? about motoko-base HOT 4 OPEN

dfinity avatar dfinity commented on July 30, 2024
Remove AssocList?

from motoko-base.

Comments (4)

chenyan-dfinity avatar chenyan-dfinity commented on July 30, 2024

I think other modules are using it, e.g. TrieSet/TrieMap. The name says it's a List not a Map, and hopefully will convey the right time complexity?

from motoko-base.

rossberg avatar rossberg commented on July 30, 2024

I think it's is safe to assume that 75% of programmers do not know about time complexities, and select data types solely by interface. AssocList is more attractive to use than maps, because you don't have to provide an ordering for the key type, and because it can be shared.

If we can't remove it, then we should at least put a big fat warning in the documentation.

from motoko-base.

lsgunnlsgunn avatar lsgunnlsgunn commented on July 30, 2024

FWIW, I know some of our example apps import AssocList. If that isn't the best choice, maybe we should revisit/update the examples that use it?
Or possibly incorporate the warning message somehow in the examples?

from motoko-base.

matthewhammer avatar matthewhammer commented on July 30, 2024

This issue could be closed, IMO.

Yet their existence may mistake programmers into thinking that their use is adequate when it isn't.

They are "adequate" so long as the lists are bounded, as they are in the Trie, which uses them in its implementation.

I think it's is safe to assume that 75% of programmers do not know about time complexities

Probably not true of the developers that are first to approach the Internet Computer, but I take the general point about hiding things that are not efficient enough to be useful in real systems, at large scales.

But AssocList is useful in real systems, so long as the lists are not "too long." :)

Regarding scaling: There are so many different gotchas we have yet to address, that this one (still) seems like a minor one to me. (A more urgent issue is having any representation for stable memory that is efficient.)

from motoko-base.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.