REBOL 3.0

Modules: should we support auto loading?

Carl Sassenrath, CTO
REBOL Technologies
31-Aug-2006 17:34 GMT

Article #0040
Main page || Index || Prior Article [0039] || Next Article [0041] || 17 Comments || Send feedback

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:

  1. 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.

  2. 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.

  3. We would need a way to specify the directory search path for finding such modules. Mostly likely a new system/options field.

  4. Note that URL's could be allowed. For example, www.rebol.com/lib/ could be one of the default archive locations for modules.

  5. Module files can be signed. This protects them from malware modifications. An security option will allow you to load non-signed modules.

  6. Version resolution would be needed. Your code may depend on a more recent version of a module, or even a specific version.

  7. 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.

  8. 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.

17 Comments

REBOL 3.0
Updated 25-Nov-2024 - Edit - Copyright REBOL Technologies - REBOL.net