gm2
[Top][All Lists]
Advanced

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

Re: [SOMEWHAT OFF-TOPIC] Definition Module is a Misnomer, how can we exp


From: Benjamin Kowarsch
Subject: Re: [SOMEWHAT OFF-TOPIC] Definition Module is a Misnomer, how can we explain this?
Date: Thu, 8 Jun 2023 11:40:01 +0900


On Thu, 8 Jun 2023 at 04:56, Christoph Schlegel <modula2@christophschlegel.at> wrote:

I see the problem but.

I always thought the important thing is to hide information not needed
for the users of the module. Teams also should be able to work on
different tasks without having to care about implementation details.

Like: I can write a text on lots of computers, but I don't really
understand completely how they work. I can drive most cars, because I
have the usual interface.

As a user of a programming language, it is very important to know the syntax,
and for that it is very important that the grammar is intuitive and comprehensible.

So here is the problem with that:

compilationUnit :=
  definitionModule | implementationModule | programModule
  ;

definitionModule :=
  DEFINITION MODULE moduleIdent ';'
  import* declaration* END moduleIdent '.'
  ;

implementationModule :=
  IMPLEMENTATION MODULE moduleIdent ';'
  import* definition* block? END moduleIdent '.'
  ;

declaration :=
  CONST ( constDefinition ';' )+ |
  TYPE ( typeDefinition ';' )+ |
  VAR ( varDefinition ';' )+ |
  procDeclaration ';'
  ;

definition :=
  CONST ( constDefinition ';' )+ |
  TYPE ( privateTypeDefinition ';' )+ |
  VAR ( varDefinition ';' )+ |
  procDefinition ';'
  ;

This is clearly counter-intuitive. Why is the module called definition module
when the implementation module is the one that contains only definitions,
and the definition module is the one with (at least some) declarations?

This violates the law of least surprise. A very big No-No in computer science.

And when you write a paper for submission to a peer reviewed journal, it gets
worse since there is always a struggle to keep it short for it may be rejected
simply on the grounds that it is too long, they always want it shorter still.

But now you seem to have a big error in your paper. You apparently confused
definitions and declarations, how could your paper be accepted then? So, you
need to waste valuable space to explain this terminology F*** UP.

Likewise when you want to submit a book draft to a publishing house.

Last but not least, these kinds of things make a very bad impression on
people who are curious about the language and might want to use your
compiler but eventually conclude that the implementors are bloody
amateurs who can't even get the terminology right and thus you
lose potential adopters or even contributors.

Proper terminology and naming is very important. So, to me this is not
a minor issue.

I would not invest too much energy in semantic problems related to a
programming languge which will soon turn 50 - it is a definition
module for a long time now :-) but why not add the INTERFACE synonym to
R10?

I am talking about the R10 documentation and its bootstrap compiler, as well as
the fifth edition of PIM which Springer are interested in publishing.

Indeed, I have now changed the reserved word to INTERFACE and made
DEFINITION a synonym. For now I will keep the .def file type ending though.

https://github.com/m2sf/m2c/blob/main/grammar/m2c-grammar.gll#L25

https://github.com/m2sf/m2c/blob/main/src/m2c-token.h#L77
https://github.com/m2sf/m2c/blob/main/src/imp/m2c-reswords.c#L501

Thanks for the feedback.

regards
benjamin

reply via email to

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