Comments (1)
Golang's team intentionally made it random, starting with Go 1, to make developers not rely on it.
See https://go.dev/blog/maps.
Protobuf also specifies that they have fewer guarantees and implements them as slices of structs on the wire.
And on a side note, some web2 CTO friends added linters to prevent their teams from using maps. Even in web2, indeterministic maps were too confusing with flappy unit tests or bugs discovered in production. They told me that maps are generally deficient in performance, not only in go. But please, keep this comment as a hint and not a fact.
My current feeling:
- We should not deny them thoroughly (I hope we can one day find a technical and legal way to convert and import web2 libraries that make sense).
- We should make them determinist.
- We should/could deny them from being used as global values, function parameters, or returned values. So they can only be used for some patterns and inside functions, i.e., removing duplicates from a slice.
- we should create better structures like
p/avl.Tree
andp/avl.MutTree
to have easy-to-use data structs optimized for chains. - If we deny maps completely, we can suggest alternative approaches like
[]struct{Key:..., Value:...}
, which is the most common approach for other languages not having map support or looking for more excellent compatibility.
from gno.
Related Issues (20)
- [gnoweb] Text not rendered properly
- Implement GRC165
- CI: Remove custom docker builds and use goreleaser
- CI: Check examples workflow and see how we can better test them maybe using go tests.
- CI: Check makefiles and simplify them
- CI: Should we move portal loop boilerplate to its own repository?
- CI: Test with several go versions when needed
- CI: Add cache where it makes sense
- CI: Fix race conditions and run tests with -race flag
- CI: Build binaries and serve them as artifacts on every PR
- CI: `TestPackages` should only test the standard libraries. Rename it to `TestStdlibs`
- [OPS] Wishlist - Feature ideas
- Expect full denoms in Banker.IssueCoin and Banker.RemoveCoin
- Portal loop from cli: Signature verification failed; verify correct account, sequence, and chain-id HOT 2
- Implement utility packages HOT 1
- [docs] Add gnolang/faucet HOT 2
- [docs] Add references to Portal Loop faucet and Faucet Hub in documentation HOT 1
- [Docs] gnokey command in Getting Started
- [Docs] gnoland command in Getting Started
- [Docs] gnodev command in Getting Started
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 gno.