Modules: should we support auto loading?
I need to survey the REBOL expert community for opinions on another important design issue for 3.0.
The REBOL definition of a module is: An standard form of independent context that extends the REBOL run-time environment.
Question: Should REBOL modules have the ability to auto-load from a default directory or URL?
For example, a script may specify:
REBOL [title: "A script" needs: [3.0.1 xml codec/mp3] ...]
This indicates that REBOL 3.0.1 is required, and that the XML and MP3 modules should be loaded.
(The path used for codec/mp3 is just one possibility for organizing modules, and it is not finalized.)
Important points to consider:
- Let it be clear that we are not changing the REBOL principle that most programs should be able to run "out of the box" with REBOL and no modules needed. That will remain as is. We are talking here about modules that are special extensions to REBOL. E.g. a web server module, charting module, special media loaders, new port schemes, etc.
- Many/most other languages do this. When you ask to import a module, the runtime scans a few predetermined directories looking for the correct module to load.
- We would need a way to specify the directory search path for finding such modules. Mostly likely a new system/options field.
- Note that URL's could be allowed. For example, www.rebol.com/lib/ could be one of the default archive locations for modules.
- Module files can be signed. This protects them from malware modifications. An security option will allow you to load non-signed modules.
- Version resolution would be needed. Your code may depend on a more recent version of a module, or even a specific version.
- This is not an essential requirement. You can always specify a file path or URL for importing modules. In fact, you could just use do and specify the module files.
- Implementation is minor. The coding and test period should not be considered a factor.
I know we've discussed this before, but that was informal.
If you want, you can refer to any of the above points by its number. (I won't change the order.)
Let's hear your thoughts.