Re-thinking D's modules

Russel Winder russel at winder.org.uk
Wed Jul 18 02:24:36 PDT 2012


On Wed, 2012-07-18 at 11:00 +0200, Paulo Pinto wrote:
[…]
> > Java has been criticised often for not having modules. 

In the beginning there was WORA which assumed so much that was
unrealistic. It's consequence has been that artefact versioning is a
complete mess in Java.  OK so the Maven repository and build frameworks
like Gradle and Maven are getting close to defeating the problem. Sadly
transitive dependencies are still a nightmare.

Of course I have probably violated a Sun/Oracle patent by even
mentioning the acronym WORA.

> > Apparently Java 9 SE will have them, and in my humble opinion, 
> > Java 9 module system is going to be far more powerful (or 
> > perhaps better word would be USEFUL) than what D currently has.
> >
> > More about Java Jigsaw: 
> > http://cr.openjdk.java.net/~mr/jigsaw/notes/jigsaw-big-picture-01

Assuming that it doesn't get bounced to Java 10. It already got bounced
from Java 7 to Java 8 and now Java 8 to Java 9.

> > Why is this better? - Speaking from a (senior) software 
> > engineer point of view, Java Jigsaw is engineered for large 
> > systems where versioning, module-dependency, and 
> > module-restrictions are very important.
> >
> > I do not like few things about Jigsaw, but most of the things 
> > they plan there simply make sense, especially the versioning 
> > and module-restrictions, which I urge D developers to take a 
> > look and come up with something similar for D2 or D3... This is 
> > extremely useful, and will be even more useful once we have 
> > shared libraries where we can have N different shared libraries 
> > that contain the same module, but different version of it...

Isn't the real question why is the same dynamic library linking problem
happening again. Has nothing been learned from UNIX shared objects and
Windows DLLs?

Go solves the problem by refusing all notion of dynamic linking and
insisting on static linking of all applications.

> >
> > Kind regards
> 
> Jigsaw has just been dropped from Java 8.
> http://mreinhold.org/blog/late-for-the-train

That is because to all intents and purposes Jigsaw is vapourware.  The
competition, that the Jigsaw folks are studiously ignoring, is OSGi. I
know there are some slight differences in overall aim and goal between
the two, but in the end the effect is the same: being able to run
different versions of the same artefact on the same JVM in the same
application.

> Still I would say this is so relevant that most current build 
> systems
> have versions as first class concept.

Certainly Gradle and Maven support this idea very well.  Sadly Make,
CMake, Autotools, SCons, Waf,… tend to delegate the problem to someone
else.

> For those that don't know .NET, due to the DLL Hell experience, 
> Microsoft
> has built version support in the CLR from day 1.

But, as ever, Microsoft see things like this as a way to try and get
everyone to use Windows via proprietary lock-in rather than by trying to
educate people about possible solutions. Otherwise we would already have
solved the problem rather than have the shared object mess we currently
have, OSGi, Jigsaw, the mess that is Debian and Fedora support for
multiple versions of dynamically linked libraries and Java artefacts.

Sadly I have nothing constructive to say except that which stems from
the above: in a large system comprising subsystems with transitive
dependencies, if I cannot use different versions of the same subsystem
in the overall system then everything will break. Especially in the face
of dependency injection.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120718/ded0524c/attachment-0001.pgp>


More information about the Digitalmars-d mailing list