Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dictionaries are limited in eWASM target #25

Open
jessicalally opened this issue Sep 9, 2020 · 0 comments
Open

Dictionaries are limited in eWASM target #25

jessicalally opened this issue Sep 9, 2020 · 0 comments
Labels
enhancement New feature or request ewasm Code generation for the eWASM system for Ethereum

Comments

@jessicalally
Copy link
Collaborator

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.

@jessicalally jessicalally added enhancement New feature or request ewasm Code generation for the eWASM system for Ethereum language Issues with the flint-2 Flint language implementation or features labels Sep 9, 2020
@egroge egroge removed the language Issues with the flint-2 Flint language implementation or features label Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ewasm Code generation for the eWASM system for Ethereum
Projects
None yet
Development

No branches or pull requests

2 participants