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)
- Constant Declaration with Slice Type Compiles Without Error HOT 1
- [infra] Minimal Setup of Observability node running monitoring service
- `gno fmt` adds an extra line at the end of the file HOT 3
- Panic on Type Assertion with Interface HOT 2
- Incorrect Variable Assignment
- [infra] GnoFaucet - Create Healthcheck enpoint HOT 1
- Better Gno Error Handling HOT 1
- Removing the admin from the system contract entirely.
- error: primitive type int cannot be indexed
- [Native Banker] Implement `TotalCoin` HOT 2
- GnoDev - Conflicting Package Resolution Between Personal Repo and Examples Folder HOT 4
- Investigate effect of "0.0.0.0 Day" issue in browsers on running gno locally
- [Homepage] `/r/gnoland/featured` realm
- bug(gnovm): prohibit conversion of non-convertible typed constants
- Gno Playground - deploy on portal loop does not take my namespace input HOT 1
- [Debugger] Debug realms during transaction execution HOT 2
- GnoWeb not rendering correctly on Windows HOT 1
- Add timezone support to the gno standard library's `time` package
- How to verify the timestamp of a node? HOT 1
- Feature: GnoLinks BlockChain Interactions
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.