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

Support namespaces/modules #2

Open
ecton opened this issue Nov 18, 2022 · 2 comments
Open

Support namespaces/modules #2

ecton opened this issue Nov 18, 2022 · 2 comments
Labels
budlang Issues related to the Bud language budvm Issues related to the virtual machine or IR enhancement New feature or request

Comments

@ecton
Copy link
Member

ecton commented Nov 18, 2022

The virtual machine needs to be able to have an environment of nested namespaces/modules, allowing for functionality to be organized better.

The language will need support for finding named items within namespace.

@ecton ecton added enhancement New feature or request budlang Issues related to the Bud language budvm Issues related to the virtual machine or IR labels Nov 18, 2022
@ModProg
Copy link
Contributor

ModProg commented Dec 29, 2022

did you plan to allow dynamic resolution in runtime or only during compilation?

@ecton
Copy link
Member Author

ecton commented Dec 29, 2022

Initially, I plan on the same approach as functions, I think: modules will be stored in a list and their index is what is used to refer to a function in a specific module. This would be something that is resolved by name during the linking phase of the IR into final instructions.

But, I do want to add support for both function and module resolution at runtime. There are just design considerations with trying to keep the Value enum from gaining any additional size or requiring allocations like Dynamic does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
budlang Issues related to the Bud language budvm Issues related to the virtual machine or IR enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants