Cabal vs Haskell [sic]

Henrik Nilsson nhn at Cs.Nott.AC.UK
Thu Apr 21 13:13:20 EDT 2005

Hi there,

Malcolm wrote:

 > There was once a compiler (Freja) that permitted multiple modules
 > to occur in the same source file, which is slightly closer to what
 > you want.

I'm amazed that you remembered that!

Anyway, the point of the Freja design was to have absolutely no
assumptions about any correspondence between module names and
file names: not in the language design, and not anywhere in
the compiler implementation or supporting tool chain. So Freja is
actually even more extreme than most current implementations, I'd
say. (I just never liked the idea of having the module names,
hierarchical or not, forcing the adoptation of any specific file
names and directory structure.)

 > But all other compiler implementations have adopted a
 > separate-compilation model, where the mapping of an import statement
 > (to the source code that supplies those entities) is determined
 > external to the source code of the importing module,

Well, Freja was the same. The reason for its capability to compile more
than one module at a time was to deal with recursive modules, not that
it was incapable of separate compilation. The idea was that an external
make-like tool would be told about ALL source files. It would then
figure out the dependences between the modules contained in those source 
files, group them into strongly connected components, and
then invoke the compiler on individual files or group of files as
appropriate, along with the interface files of previously compiled
modules on which the modules currently being compiled depended.

Thus the compiler would always get the names of ALL relevant files,
source files and interfaces, from an external entity, and thus it
wouldn't need to know much if anything about module/file naming
conventions, any OS-specific restrictions on file names, or organization
of the source hierarchy.

I still think it was a pretty nice and simple design. But it never got
completely implemented.

Best regards,


Henrik Nilsson
School of Computer Science and Information Technology
The University of Nottingham
nhn at

This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

More information about the Libraries mailing list