budlang icon indicating copy to clipboard operation
budlang copied to clipboard

Support namespaces/modules

Open ecton opened this issue 3 years ago • 2 comments

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 avatar Nov 18 '22 03:11 ecton

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

ModProg avatar Dec 29 '22 11:12 ModProg

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.

ecton avatar Dec 29 '22 17:12 ecton