monte-language / typhon

A virtual machine for Monte.
Other
67 stars 10 forks source link

Use module parameters for benchmarking and tests #224

Open MostAwesomeDude opened 3 years ago

MostAwesomeDude commented 3 years ago

Right now we use module imports to pass two magic names, bench and unittest, to modules which ask for it. The import is completely safe, using Any guards, and was an explicit allowance in our original module-design discussions. However, the module loaders have to treat these names specially.

We could instead use module parameters. This would make it easier to compile modules so that the loader can choose at runtime whether to run benchmarks or self-tests by choosing how to parameterize the entire compiled collection of modules (the muffin) rather than having to thread names through the imports.