What is a language construct? (was Re: Comment on state of Project Jigsaw)

Alex Buckley alex.buckley at oracle.com
Thu Dec 22 18:37:47 PST 2011


On 12/22/2011 5:55 PM, Neal Gafter wrote:
> On Thu, Dec 22, 2011 at 5:05 PM, Alex Buckley <alex.buckley at oracle.com
> <mailto:alex.buckley at oracle.com>> wrote:
>
>     Many presentations on Jigsaw have covered the need for modules to
>     _look_ familiar to Java programmers, leading to the open requirement:
>
>     "Java-like syntax — The syntax of module declarations must be
>     similar to that of declarations of a like nature in the Java
>     programming language."
>
>
> In what sense are module declarations "of a like nature" to anything
> currently in the Java programming language?

I take it the rest of my email accurately summarized your views.

You are querying whether the _semantics_ of module declarations are like 
the semantics of anything currently in the language. Obviously not. The 
module concept is new, even though the concepts of visibility (a.k.a. 
observability) and accessibility are old.

Precisely because a module is a first-class concept in the language 
(affecting visibility and accessibility), it is not unreasonable to 
represent it syntactically using the traditional input elements of the 
Java programming language.

The fact that a type declaration doesn't refer to a module name seems to 
be causing people to think that modules are not a first-class concept in 
the language. But they are.

Wouldn't it be odd if some declarations of first-class language concepts 
were made in Java-like syntax while others were made in, say, JSON? 
After all, a package is a different thing to a field, and yet both exist 
in the Java grammar. Just because a module is a different thing to a 
field doesn't mean a module should be excluded from the Java grammar.

Alex



More information about the jigsaw-dev mailing list