What is a language construct? (was Re: Comment on state ofProject Jigsaw)
David Bosschaert
david.bosschaert at gmail.com
Wed Jan 4 07:17:27 PST 2012
Not at all! I'm a big fan of the many features that are being worked
on for the language.
However, I think that specifying the module metadata in a Java source
file is the wrong choice and especially having it in a .class file at
runtime seems highly limiting and only focused on one particular
use-case. This type of information asks for a separate type of file
with its own format: a little DSL or something like that. It should
not be precompiled as a .class file for one particular use but rather
stay in its original format inside the module.
Java runtimes can, as a performance optimization, cache their own
binary version of it if they wish, but that's really a hidden
implementation detail...
Best regards,
David
On 4 January 2012 14:50, Stephen McConnell <mcconnell at dpml.net> wrote:
> Woops - sorry, need clarification.
> Are your suggesting that the language is frozen and cannot evolve?
> /SJM
>
> -----Original Message----- From: David Bosschaert
> Sent: Thursday, January 05, 2012 12:27 AM
> To: jigsaw-dev at openjdk.java.net
> Subject: Re: What is a language construct? (was Re: Comment on state
> ofProject Jigsaw)
>
>
> On 23 December 2011 01:05, Alex Buckley <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."
>
>
> I'd say these presentations represent only a limited section of the
> community.
> There have been many arguments made by a variety of people arguing for
> a DSL or other mechanism which is more suited for storing module
> declarations. This email trail is an example of that.
>
> Just to give one example where it doesn't fit:
> A module declaration applies to the artifact as a whole, i.e. the
> module jar file, so it doesn't fit naturally alongside other java
> classes in any java file - it needs to be in a special file of its
> own. And that special file will look different from all the other java
> files so hence it doesn't make sense to make it part of the java
> syntax as this syntax is only used in this special place, effectively
> creating a separate language, as Neal mentioned above.
> Making things worse, having it in a .java file implies that it will be
> compiled into a .class file which makes thing unnecessarily complex
> for tools and other module systems to read this thing at runtime.
> Additionally, having it in a .class file compromises the extensibility
> of the module metadata, which is needed for module systems that may
> have more features and need extensions to JSE module metadata.
>
>> 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.
>
>
> Its an open requirement clearly because opinions diverge over this
> issue. We need to stress that Jigsaw is a prototype and that this
> aspect of the prototype can't 'just make it' into JSE8 without proper
> discussion in the upcoming modularity JSR.
>
> Best regards,
>
> David
More information about the jigsaw-dev
mailing list