2009-10-02

REBOL Module Names

One of the best new features of the upcoming REBOL 3 is the module system. I’m not going to go into the rationale behind modules, but I would like to make a proposal about module names.

Every module can optionally have a name. A name is required if the module author wishes to export words from the module. If the module is contained in a file, it’s important to note that the module name and the file name need not be the same. REBOL uses the module name to ensure that a module is never loaded twice. This allows us to import the module as often as we like without incurring any additional overhead.

The name of a module must be a valid REBOL word. Many REBOL programmers are used to REBOL’s "programming in the small" (PITS) philosophy, so I think their tendency will be to use simple module names. However, modules are not a PITS feature, they are a "programming in the large" (PITL) feature. Using simple module names will decrease the opportunity for reuse by making collisions more likely.

So my proposal is to take a page from Java and use package-style module names. Fortunately, the "." character is perfectly valid inside a REBOL word and has no particular meaning as it does in other languages. Here are some examples:

com.rebol.math
net.revolucent.math

As you can see, these are names for math modules. My fear is that many REBOL programmers will release modules naively named "math" and this will make it much harder to use them together. By hijacking Java's simple convention of reverse domain names, the problem is neatly solved.

13 comments:

  1. This is a great web site. Good sparkling user interface and very informative blogs. I will be coming back in a bit, thanks for the great article. I have found it enormously useful.

    ReplyDelete
  2. Map: Will help you tag locations of interest on an interactive map. downlodable pdf With this method great songs are created in no time, songs that can keep up with the ones of your idols.

    ReplyDelete
  3. A dedicated developer who will add more features and keep improving the application. Get it! And watch out, sometimes the coach will lob a grenade at you to make sure you are paying attention.

    ReplyDelete
  4. #1Backup breaks down the 2 Gb file size limitation even with FAT disk partitions. download software Background and residents' posture are chosen and an image can be saved to the photograph of iPhone.

    ReplyDelete
  5. Added ability to add/remove people from training games. downlodable manuals Use of this app is subject to the Nickelodeon End User License Agreement.

    ReplyDelete
  6. While there may be some compensation upon being let go from the firm you work for, this money wont last forever. downlodable keygens The DevExpress DataExplorer provides a unique way of building native iOS data-driven applications without having to write a single line of code.

    ReplyDelete