You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dynamically sized dictionaries are currently unimplemented for the eWASM target. Dictionaries are currently represented as a stack-allocated array of structs, of a fixed size, containing key-value pairs. This means that dictionaries are fairly limited, and only runtime functions for getting values and replacing values given a key are implemented. As they are stack-allocated, they also cannot be returned from functions. To implement dynamic dictionaries, heap allocation is needed, hence allocating and freeing memory will be necessary.
Dictionaries are also currently restricted to having a key type of Int, Address or Bool, the Flint types which are converted to Int in LLVM, as there is currently no equality function implemented for structs and pointers, only int values.
We would suggest a Hashmap as a better implementation of a Dictionary in LLVM.
The text was updated successfully, but these errors were encountered:
Dynamically sized dictionaries are currently unimplemented for the eWASM target. Dictionaries are currently represented as a stack-allocated array of structs, of a fixed size, containing key-value pairs. This means that dictionaries are fairly limited, and only runtime functions for getting values and replacing values given a key are implemented. As they are stack-allocated, they also cannot be returned from functions. To implement dynamic dictionaries, heap allocation is needed, hence allocating and freeing memory will be necessary.
Dictionaries are also currently restricted to having a key type of
Int
,Address
orBool
, the Flint types which are converted toInt
in LLVM, as there is currently no equality function implemented for structs and pointers, only int values.We would suggest a Hashmap as a better implementation of a Dictionary in LLVM.
The text was updated successfully, but these errors were encountered: