Hi Chapel user community —
The following issue points out that if there is no code path from the main module defining a Chapel program to a given helper module, then that module is not initialized even if it is specified on the command-line. We're interested in input about whether this behavior seems beneficial or surprising. Let us know your thoughts on the issue if you have an opinion.
Thanks,
-Brad
opened 12:53AM - 11 Nov 21 UTC
### Summary
There are cases where initializing a module that has been specified… by the command line could affect execution of the main module, even if not referenced from the main module, so it seems that may be something worth adding.
### Example
a.chpl:
```chpl
proc main() {
writeln("in a");
}
```
b.chpl:
```chpl
module b {
use a;
writeln("in b");
}
```
Compiling and running the above files with both files on the command line today like this: `chpl a.chpl b.chpl` causes only `in a` to be printed. In other words, module b was never even initialized. This seems a bit strange since it was specifically put on the command-line and I think it would be valuable to initialize the module if specified like this.
### Additional questions
Other things to think about here are:
- Should the extra module initializations just be done at the end?
- Should the module initializations follow in the same order they were passed on the command line?
- Are there special cases where we would want different behavior? (e.g., module b used module a in the example above)