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

Alex Buckley alex.buckley at oracle.com
Thu Dec 22 17:05:20 PST 2011


On 12/22/2011 10:07 AM, Neal Gafter wrote:
> I don't think a protection mechanism that involves use-site access
> control (or version control) is an appropriate language extension at
> all.  That is more properly a feature of a build and packaging system.
>   While it may well involve a packaging specification language (e.g. a
> package specification file /or/ a compiler command-line or even the
> layout and organization of files on the disk drive), that language need
> have no relationship to the underlying programming languages of the
> system under construction.  Jigsaw appears to have largely taken that
> approach, with the exception that Jigsaw pretends it is an extension of
> the Java programming language.

OK, now I understand. You do not object to a module system being part of 
the Java SE platform, or to dependences at the granularity of a module. 
You object to including a module declaration in the grammar of the Java 
language, specifically in the CompilationUnit production, and having the 
effects of a module declaration be noticeable in the language's 
visibility and accessibility rules.

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."

 From that open requirement flows a module declaration built from the 
traditional input elements of the Java language, and included under 
CompilationUnit in the Java grammar. Yes, the requirement is open, but 
it's the current direction of the Jigsaw prototype. When modules are as 
much a part of the platform as packages and types, it's not too 
surprising that their declarations live close together.

If the Java SE Platform Specification took it upon itself to define a 
module declaration in a sibling of CompilationUnit, say ModuleUnit, and 
mandated that a ModuleUnit be detected and interpreted at compile-time 
and runtime according to the module system's rules, then I think you 
would be marginally happier. At least the module declaration would be 
"outside" the language.

You would still object to the language's sense of visibility and 
accessibility being determined by another part of the platform, namely 
the module system. But the language has always existed in the context of 
the overall platform, and the omnipresence of the module system is a 
fundamental principle in the requirements. Not sure we have a zone of 
agreement here.

Alex



More information about the jigsaw-dev mailing list