# \[design\] initialize all modules specified on the \`chpl\` command-line?

**URL:** <https://chapel.discourse.group/t/design-initialize-all-modules-specified-on-the-chpl-command-line/8134>\
**Category:** Users\
**Created:** [November 12, 2021, 6:03pm UTC](https://chapel.discourse.group/t/design-initialize-all-modules-specified-on-the-chpl-command-line/8134 "2021-11-12T18:03:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradcray](https://yyz2.discourse-cdn.com/free1/user_avatar/chapel.discourse.group/bradcray/32/72_2.png) [@bradcray](https://chapel.discourse.group/u/bradcray)\
**Post date:** [November 12, 2021, 6:03pm UTC](https://chapel.discourse.group/t/design-initialize-all-modules-specified-on-the-chpl-command-line/8134/1 "2021-11-12T18:03:46Z")

</div>

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

> <https://github.com/chapel-lang/chapel/issues/18714>
>
> \### 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)
