gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SOMEWHAT OFF-TOPIC] Definition Module is a Misnomer, how can we explain


From: Benjamin Kowarsch
Subject: [SOMEWHAT OFF-TOPIC] Definition Module is a Misnomer, how can we explain this?
Date: Tue, 6 Jun 2023 02:05:10 +0900

I apologise in advance for the slightly off-topic posting.

We have all gotten used to writing DEFINITION MODULE and think of it as a module characterised by containing only definitions.

However, Wirth got this very badly wrong. It is a misnomer.

In Modula-2, there exist no constant declarations and no variable declarations. Constants and variables are always instituted by definitions, no matter in which type of module they appear.

Except for opaque types, all types are instituted by definition, opaque types have a declaration in the definition module and a corresponding definition in an implementation module.

Procedures are declared in a definition module, and defined in implementation and program modules. In fact, implementation and program modules cannot contain any declarations, except in single pass compilers which may use forward declarations.

So why is the definition module called definition module when the primary instrument of program decomposition, the procedure, is only declared but never defined there?

Strictly speaking, the implementation module is the one that could be called definition module because except for forward declarations in single-pass compilers, it contains only definitions.

In linguistic terms,

a definition is

(1) a statement that explains the meaning of a word, phrase, sign or symbol;
(2) the act of defining, or of making something definite.

and a declaration is

(1) an announcement, often formal.
(2) the act of making something known formally or officially.

In computer science terms,

a definition defines a term and its meaning precisely and completely;

while a declaration states that a term exists, but does not define it.

Thus according to both general language use and computer terminology use, the term definition module is a misnomer that we just happen to have swallowed without asking if it actually makes sense. It is wrong and it doesn't make sense.

This is troublesome when writing scholarly articles, specification documents and books.

It is also troublesome when writing a Modula-2 grammar because if the rules are named properly, then the declarations are always in the definition module, and their corresponding definitions are in the implementation module. The definitions that are in a definition module are only there because these don't have declarations (const, type, var).


In Modula-3, the definition module has been renamed to interface module, which is a proper and better name for it. However, we also have the convention for source file types *.def and *.mod and since the former is named for "definition module" that would then also need to be changed. There are only so many three letter combinations and it is very difficult to find one that isn't already in use for some other purpose, let alone getting the changed file type adopted into common editors like vi/vim or emacs. This is not really a nice prospect. I am also not quite sure how such a change would be received by the community. It is one thing to rename module SYSTEM to UNSAFE so that a call to CAST() becomes UNSAFE.CAST(), but quite another when the module header syntax changes.

So, I would like to ask two things here:

(1) what do people think about this messed up nomenclature?

(2) can anybody think of a way to explain this problem away, some kind of spin?

By spin I don't mean Clintonesque spin like "That depends on what the meaning of 'is' is".

I mean something like the name of the smallest addressable unit in PIM, which is not BYTE, but WORD, which is historically explained, since terminology has evolved since, but I really doubt that definition and declaration ever had different meanings from what they mean today, so I am not holding my breath on the prospect of explaining the problem historically, other than writing "Wirth messed this up" which is something I would like to avoid.

Any feedback appreciated.

regards
benjamin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]