JaroslavTulach: /* Providing a Hint */ - 2012-07-24 13:46:36

Providing a Hint

←Older revision Revision as of 13:46, 24 July 2012
Line 60: Line 60:
And that is all. Useful and simple to resolve [[dependency]] system for [[Java]] modularity has just been born. Heuréka!
And that is all. Useful and simple to resolve [[dependency]] system for [[Java]] modularity has just been born. Heuréka!
 +
 +
== Language Change ==
 +
 +
So the problematic case is '''requires service'' constraint. We need to avoid its current form and always require a ''hint''. Here is my proposal how to do it:
 +
 +
<source lang="java">
 +
module M1 {
 +
requires service S with default M2@1.6;
 +
}
 +
</source>
 +
 +
Not a big change, but it makes huge impact. The [[NP-Complete]]ness is gone. Whenever somebody wants to compile against module ''M1'', we also have to verify that the module M2 at revision 1.6 can be enabled. This is trivial polynomial check that can easily be done by [[JavaC]].
<comments/>
<comments/>

JaroslavTulach at 13:40, 24 July 2012 - 2012-07-24 13:40:49

←Older revision Revision as of 13:40, 24 July 2012
Line 1: Line 1:
[[Dependencies]] in [[modular system]]s are subject to [[NP-Complete]] problems: [[LibraryReExportIsNPComplete]] and for example [[OSGi]] suffers from that. It would be amazing, if we could learn from past mistakes and come up with a system of [[dependencies]] for [[Jigsaw]] that is not inherently [[NP-Complete]].
[[Dependencies]] in [[modular system]]s are subject to [[NP-Complete]] problems: [[LibraryReExportIsNPComplete]] and for example [[OSGi]] suffers from that. It would be amazing, if we could learn from past mistakes and come up with a system of [[dependencies]] for [[Jigsaw]] that is not inherently [[NP-Complete]].
 +
 +
Here are [[Media:PolynomialDependencies.pdf|slides]] from my 2012 presentation on this topic.
== [[NP-Complete]] Services ==
== [[NP-Complete]] Services ==

JaroslavTulach: /* Providing a Hint */ - 2012-06-21 14:20:21

Providing a Hint

←Older revision Revision as of 14:20, 21 June 2012
Line 48: Line 48:
Trivial and [[NP-Complete]]ness is gone.
Trivial and [[NP-Complete]]ness is gone.
-
== Providing a Hint ==
+
== Providing a [[Hint]] ==
Of course, some may argue and everyone can see that there is a better (in sense of richer) configuration to satisfy the previous example. If the [[Jigsaw]] selects ''nptest'', ''A2'' and ''B1'' modules the pleasure of execution is likely to be higher. What can we do to help [[Jigsaw]] to prefer such configuration and still not fall into [[NP-Complete]] trap?
Of course, some may argue and everyone can see that there is a better (in sense of richer) configuration to satisfy the previous example. If the [[Jigsaw]] selects ''nptest'', ''A2'' and ''B1'' modules the pleasure of execution is likely to be higher. What can we do to help [[Jigsaw]] to prefer such configuration and still not fall into [[NP-Complete]] trap?
-
There should be a way to provide ''hints''. A developer (or a deployer) of the application should be able to tell [[Jigsaw]] to try module ''A2'' when it seeks for provider of service ''a'' first. Here is the resolution example:
+
There should be a way to provide [[hint]]s. A developer (or a deployer) of the application should be able to tell [[Jigsaw]] to try module ''A2'' when it seeks for provider of service ''a'' first. Here is the resolution example:
# Try ''A2'' - We got a hint to try ''A2'' first when somebody needs implementation of service ''a''. It resolves (as ''A1'' is disabled)
# Try ''A2'' - We got a hint to try ''A2'' first when somebody needs implementation of service ''a''. It resolves (as ''A1'' is disabled)

JaroslavTulach: /* NP-Complete Services */ - 2012-06-21 09:24:23

NP-Complete Services

←Older revision Revision as of 09:24, 21 June 2012
Line 3: Line 3:
== [[NP-Complete]] Services ==
== [[NP-Complete]] Services ==
-
One of the primary suspects for the complexity were [[RangeDependenciesAnalysed|range dependencies]], but we [[RangeDependenciesAnalysed|know now]] that it is not the real problem. A threat of [[NP-Complete]]ness still remains in the form of services. Here is a simple sketch showing why system with service dependencies can solve [[3SAT]]. The full proof would be similar to [[LibraryReExportIsNPComplete]]. Imagine a module which requires two services:
+
One of the primary suspects for the complexity were [[RangeDependenciesAnalysed|range dependencies]], but we [[RangeDependenciesAnalysed|know now]] that it is not the real problem. A threat of [[NP-Complete]]ness still remains in the form of services. Here is a simple sketch showing why system with service [[dependencies]] can solve [[3SAT]]. The full proof would be similar to [[LibraryReExportIsNPComplete]]. Imagine a module which requires two services:
<source lang="java">
<source lang="java">

JaroslavTulach at 09:23, 21 June 2012 - 2012-06-21 09:23:41

←Older revision Revision as of 09:23, 21 June 2012
Line 1: Line 1:
-
[[Dependencies]] in [[modular system]]s are subject to [[NP-Complete]] problems: the [[LibraryReExportIsNPComplete]] and for example [[OSGi]] suffers from that. It would be amazing, if we could learn from past mistakes and come up with a system of [[dependencies]] for [[Jigsaw]] that is not inherently [[NP-Complete]].
+
[[Dependencies]] in [[modular system]]s are subject to [[NP-Complete]] problems: [[LibraryReExportIsNPComplete]] and for example [[OSGi]] suffers from that. It would be amazing, if we could learn from past mistakes and come up with a system of [[dependencies]] for [[Jigsaw]] that is not inherently [[NP-Complete]].
== [[NP-Complete]] Services ==
== [[NP-Complete]] Services ==

JaroslavTulach at 09:21, 21 June 2012 - 2012-06-21 09:21:51

←Older revision Revision as of 09:21, 21 June 2012
Line 1: Line 1:
-
[[Jigsaw]] is a project that modularizes [[Java]] core parts with the plan to set an example up the [[modularity]] should be done in [[Java]]. [[NetBeans]] IDE needs to [[netbeans:Jigsaw|care]] about [[Jigsaw]], as [[NetBeans]] IDE is the primary tooling for [[OpenJDK]]. I am interested in the project due to another reason as well. [[Dependencies]] in [[modular system]]s are subject to [[NP-Complete]] problems: the [[LibraryReExportIsNPComplete]] and for example [[OSGi]] suffers from that. It would be amazing, if we could learn from past mistakes and come up with a system of [[dependencies]] that is not inherently [[NP-Complete]].
+
[[Dependencies]] in [[modular system]]s are subject to [[NP-Complete]] problems: the [[LibraryReExportIsNPComplete]] and for example [[OSGi]] suffers from that. It would be amazing, if we could learn from past mistakes and come up with a system of [[dependencies]] for [[Jigsaw]] that is not inherently [[NP-Complete]].
== [[NP-Complete]] Services ==
== [[NP-Complete]] Services ==

JaroslavTulach: Jigsaw moved to JigsawServices: In future we may need to talk about something more general in Jigsaw, so let's separate the services stuff into own page. - 2012-06-21 09:20:27

Jigsaw moved to JigsawServices: In future we may need to talk about something more general in Jigsaw, so let's separate the services stuff into own page.

←Older revision Revision as of 09:20, 21 June 2012

JaroslavTulach: /* Providing a Hint */ - 2012-06-21 09:17:34

Providing a Hint

←Older revision Revision as of 09:17, 21 June 2012
Line 58: Line 58:
And that is all. Useful and simple to resolve [[dependency]] system for [[Java]] modularity has just been born. Heuréka!
And that is all. Useful and simple to resolve [[dependency]] system for [[Java]] modularity has just been born. Heuréka!
 +
 +
<comments/>

JaroslavTulach: /* Providing a Hint */ - 2012-06-21 09:17:21

Providing a Hint

←Older revision Revision as of 09:17, 21 June 2012
Line 57: Line 57:
# Try ''B1'' - [[good]], it resolves now (as ''A1'' is disabled and ''A2'' has more suitable [[dependencies]])
# Try ''B1'' - [[good]], it resolves now (as ''A1'' is disabled and ''A2'' has more suitable [[dependencies]])
-
And that is all. Useful and simple to resolve [[dependency]] system for [[Java]] has just been born. Heuréka!
+
And that is all. Useful and simple to resolve [[dependency]] system for [[Java]] modularity has just been born. Heuréka!

JaroslavTulach: /* Providing a Hint */ - 2012-06-21 09:16:55

Providing a Hint

←Older revision Revision as of 09:16, 21 June 2012
Line 57: Line 57:
# Try ''B1'' - [[good]], it resolves now (as ''A1'' is disabled and ''A2'' has more suitable [[dependencies]])
# Try ''B1'' - [[good]], it resolves now (as ''A1'' is disabled and ''A2'' has more suitable [[dependencies]])
-
And that is all. Heuréka!
+
And that is all. Useful and simple to resolve [[dependency]] system for [[Java]] has just been born. Heuréka!