Comments (4)
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.
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.
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.
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)
- Error propagation in CI is broken HOT 1
- Deque.size() is missing
- Stack overflow for Heap.fromIter
- AssocList is missing keys(), vals() HOT 1
- bug: undocumented functions
- Class `SHA224` in `Principal.mo` contains dead data HOT 1
- Array.chain(): Error "index out of bounds"
- Principal.mo uses deprecated function HOT 5
- sequence-like collections should have a `group` operation that lumps together equal subsequences
- utilities for tuple comparisons
- FR: consider adding List.contains : (List<A>, A, (A,A) -> Bool) -> Bool (or similar)
- FR: consider adding module `VarArray` with mutable versions of the immutable array functions in `Array`
- chore: test `viper` again
- Motoko Base gives warnings on DFX deploy. HOT 2
- Principal - new functions | toSubaccount | toICRC1Text
- Would Dfinity like to take over publishing base package on Mops? HOT 5
- chore: remove unused identifiers in base and tests HOT 1
- rename `toLedgerAccount` to `toIcpLedgerAccountIdentifier` to avoid confusion
- Recurring Timer Cancelling HOT 4
- Blob.size is missing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from motoko-base.