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

Rémi Forax forax at univ-mlv.fr
Thu Jan 5 06:14:21 PST 2012


On 01/05/2012 02:23 PM, Peter Kriens wrote:
> On 4 jan. 2012, at 17:02, Rémi Forax wrote:
>> The .class format is already an extensible versioned container format
>> with a dictionnary which is able to store string and class name.
>> No shoehorn here.
> Hmmmmm. To me this is the biggest shoehorn I've seen in a long, long time ... Would you ever, ever, use this format if it had not been there before? Is there any reason to use the class file except that it happens already be there?
>
> The worst thing is that you could view a class as a container of members, which on a higher level is also true for a module. However, the way the class format is used is ignoring this possibility and only (ab)uses the constant pool and the type's (!) attributes. Further:
>
> a) It is not easy readable for inspection

javap module-info.class

> c) You have to stopgap mandatory fields like super class, access, class name, etc.

No, the access_flags will indicate that it's a module descriptor.

> d) It will confuse the heck out of any existing class parsers

No, the classfile is versioned. It has already changed twice (1.5 and 1.7)

> e) It is not easy extendable for other module systems

The attribute_info let you store any attributes you want.

> f) There is just no need to use the class file

a circular argument, sorry my brain overflow.

> h) It unnecessarily complicates management systems

why ?

>
> This is an almost perfect example of Conways law pointed out by Gafter. Once you're familiar with a technology you frame solutions in that technology.

A module descriptor has to be versioned, extensible, to contains 
synthetized values (tagged as such),
be validated (by at least checking that referenced modules, packages and 
types exist),
in my opinion, that's match what the classfile format is.

If you prefer another format, I have no problem but, in my opinion,
it will be enough close to the classfile format to not worth to create a 
new format.

>
> Kind regards,
>
> 	Peter Kriens

cheers,
Rémi




More information about the jigsaw-dev mailing list