In base64 example:
// --- file base64.v ---
module base64
... the rest of the file
Is there a reason for this redundancy and potential for confusion? Following file name = module name rule would be the simplest, making no room to cause a mess. D does this (by default) and it is one of brighter language features.
Modules can have dozens of files.
Modules can have dozens of files.
Is it wise to support such design monsters? If a module really needs to be that big, why not require naming like:
base64.1.v
base64.2.v
base64.3.v
base64.4.v
All such files would form the base64 module.
Perhaps more useful than giant modules would be the ability to express the constraint: "_I want this module to be used only from that module, and by no one else_". Kind of utility modules.
This could be implemented by file names:
base64.v -- exports API of the module
base64.v.impl/ -- subdirectory, uses module name to indicate private implementation
helper.v -- module which is visible and used only from base64
another-helper.v -- more private utilities for base64
something-else.v
Of course having so many files in one module is a bad idea. I should have said "most modules will have more than one file".