1. A computer-implemented method for facilitating the compilation of a software program, comprising: using a directory hierarchy for the software program to infer a compilation unit to be used in the software program as a member of a module, which involves: obtaining a path in the directory hierarchy for the compilation unit, wherein the path includes package information and a module directory corresponding to the module; and removing the package information from the path to locate the module directory corresponding to the module; obtaining a module declaration for the module using the directory hierarchy; and enabling compilation of the software program by dynamically identifying and locating one or more dependencies of the module using the module declaration and the directory hierarchy.