archives

Parameterized Modules

I am designing a module system for Heron. I was originally going to just pop in something that resembled the Python module system when I started reading some of Gilad Bracha's blog posts and articles, and some of the related discussions on Lambda-the-Ultimate.org and various other blogs.

There are two major considerations for me:

  1. A module system should be easy to use, and keep the language easy to use. Python's success as a language seems to me to be largely due to how easy it is to write and use modules.
  2. It would be nice to do some things right with the module system. To avoid some of the problems with module systems in existing language.

In my experience with modules systems in Turbo Pascal / Delphi the biggest practical problem I faced with reusing modules was that they were hard to reuse generically. Ideally I wanted a way to pass arguments to a module when it is loaded, so that I could configure it. This seems to be one of the benefits offered by the Newspeak module system.

I believe this is what other people are talking about when they refer to parameterized modules, correct? Would simply having the ability to parameterize modules, make an improvement to simple module systems like those found in Python?

Some related links that I have been studying:

A question of metadata

A recent post about a Lisp variant got me thinking about the usefulness of metadata and its desired properties.

  1. - should metadata be preserved by copy?
  2. - should metadata be preserved by reuse (my language is prototype-based)?
  3. - should metadata be preserved when assigned a new value to the variable?

Points 1 and 2 raise the question whether the metadata should be part of the variable or outside of it.
Point 3 questions if the metadata should be associated with a name or with a memory location.

Is there a good list of desirable properties for metadata?