Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Add support for constants or better global initialization #19

Open
hkalodner opened this issue May 24, 2020 · 1 comment
Open

Add support for constants or better global initialization #19

hkalodner opened this issue May 24, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@hkalodner
Copy link
Contributor

Currently we're using global variables as constants, ex. pristineAccount in accounts.mini. This is awkward to handle since there is not way to initialize them with a set value. It would be great if we could either support constants where the value can be initialized at compile time, or support module initialization functions that would be the first code a VM ran and could initialize the globals like init functions in go.

@hkalodner hkalodner added the enhancement New feature or request label May 24, 2020
@edfelten
Copy link
Contributor

This is high on the list of features to add.

There are pros and cons of the two approaches. Constants are simpler to do but less flexible. Initializers are more powerful, especially if they can call into other modules, but then we would need a way to avoid circularities.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants