JaroslavTulach: /* On Enhancing the Java Language */ - 2020-10-10 10:30:52

On Enhancing the Java Language

←Older revision Revision as of 10:30, 10 October 2020
Line 60: Line 60:
'''isEmpty() == false''' in case computing exact '''length()''' is costly?
'''isEmpty() == false''' in case computing exact '''length()''' is costly?
-
Let's assume the primary motivation was the [[ClientAPI]] case - e.g. calling. Rather than using default methods, one could add a compile time extension (like in the [[Kotlin]] language) to the
+
Let's assume the primary motivation was the [[ClientAPI]] case - e.g. calling. Rather than using default methods, one could add a [https://kotlinlang.org/docs/reference/extensions.html compile time extension] (like in the [[Kotlin]] language) to the
{{JDK|java/lang|CharSequence}} interface. That would be purely [[ClientAPI]] (e.g. not [[SPI]]) addition - no impact on existing implementations - e.g. it would be 100% compatible.
{{JDK|java/lang|CharSequence}} interface. That would be purely [[ClientAPI]] (e.g. not [[SPI]]) addition - no impact on existing implementations - e.g. it would be 100% compatible.

JaroslavTulach: /* On Enhancing the Java Language */ - 2020-10-10 10:29:33

On Enhancing the Java Language

←Older revision Revision as of 10:29, 10 October 2020
Line 49: Line 49:
even easier to keep 100% [[BackwardCompatibility]]. Let's run a mental experiment.
even easier to keep 100% [[BackwardCompatibility]]. Let's run a mental experiment.
-
I am not absolutely sure what was the primary motivation for adding `CharSequence.isEmpty()` - was it meant as a [[ClientAPI]], e.g. to let people call:
+
I am not absolutely sure what was the primary motivation for adding [[BinaryCompatibleDefaultMethods|CharSequence.isEmpty()]] - was it meant as a [[ClientAPI]], e.g. to let people call:
<source lang="java">
<source lang="java">

JaroslavTulach: /* On Enhancing the Java Language */ - 2020-10-10 10:28:49

On Enhancing the Java Language

←Older revision Revision as of 10:28, 10 October 2020
Line 46: Line 46:
It is true that adding new [[language]]/[[JVM]] feature can often mitigate
It is true that adding new [[language]]/[[JVM]] feature can often mitigate
compatibility issues. [[JDK]] team is in a unique position to make such changes
compatibility issues. [[JDK]] team is in a unique position to make such changes
-
(regular [[library]] [[API]] designers can't change the language), so it should be
+
(regular [[library]] [[API]] designers can't change the [[language]]), so it should be
even easier to keep 100% [[BackwardCompatibility]]. Let's run a mental experiment.
even easier to keep 100% [[BackwardCompatibility]]. Let's run a mental experiment.

JaroslavTulach: /* On Enhancing the Java Language */ - 2020-10-10 10:28:35

On Enhancing the Java Language

←Older revision Revision as of 10:28, 10 October 2020
Line 46: Line 46:
It is true that adding new [[language]]/[[JVM]] feature can often mitigate
It is true that adding new [[language]]/[[JVM]] feature can often mitigate
compatibility issues. [[JDK]] team is in a unique position to make such changes
compatibility issues. [[JDK]] team is in a unique position to make such changes
-
(regular library API designers can't change the language), so it should be
+
(regular [[library]] [[API]] designers can't change the language), so it should be
even easier to keep 100% [[BackwardCompatibility]]. Let's run a mental experiment.
even easier to keep 100% [[BackwardCompatibility]]. Let's run a mental experiment.

JaroslavTulach: /* On Enhancing the Java Language */ - 2020-10-10 10:28:14

On Enhancing the Java Language

←Older revision Revision as of 10:28, 10 October 2020
Line 44: Line 44:
==== On Enhancing the [[Java]] Language ====
==== On Enhancing the [[Java]] Language ====
-
It is true that adding new [[language]]/[[JVM]] features can often mitigate
+
It is true that adding new [[language]]/[[JVM]] feature can often mitigate
compatibility issues. [[JDK]] team is in a unique position to make such changes
compatibility issues. [[JDK]] team is in a unique position to make such changes
(regular library API designers can't change the language), so it should be
(regular library API designers can't change the language), so it should be

JaroslavTulach: /* On Enhancing the Java Language */ - 2020-10-10 10:27:59

On Enhancing the Java Language

←Older revision Revision as of 10:27, 10 October 2020
Line 44: Line 44:
==== On Enhancing the [[Java]] Language ====
==== On Enhancing the [[Java]] Language ====
-
You are right that adding new [[language]]/[[JVM]] features can often mitigate
+
It is true that adding new [[language]]/[[JVM]] features can often mitigate
compatibility issues. [[JDK]] team is in a unique position to make such changes
compatibility issues. [[JDK]] team is in a unique position to make such changes
(regular library API designers can't change the language), so it should be
(regular library API designers can't change the language), so it should be

JaroslavTulach: /* On Enhancing the Java Language */ - 2020-10-10 10:10:55

On Enhancing the Java Language

←Older revision Revision as of 10:10, 10 October 2020
Line 44: Line 44:
==== On Enhancing the [[Java]] Language ====
==== On Enhancing the [[Java]] Language ====
-
You are right that adding new language/JVM features can often mitigate
+
You are right that adding new [[language]]/[[JVM]] features can often mitigate
-
compatibility issues. JDK team is in a unique position to make such changes
+
compatibility issues. [[JDK]] team is in a unique position to make such changes
(regular library API designers can't change the language), so it should be
(regular library API designers can't change the language), so it should be
-
even easier to keep 100% compatibility. I am not absolutely sure what was the
+
even easier to keep 100% [[BackwardCompatibility]]. Let's run a mental experiment.
-
primary motivation for adding `CharSequence.isEmpty()` - was it meant as an
+
 
-
API, e.g. to let people call:
+
I am not absolutely sure what was the primary motivation for adding `CharSequence.isEmpty()` - was it meant as a [[ClientAPI]], e.g. to let people call:
<source lang="java">
<source lang="java">
Line 58: Line 58:
or was it rather meant as a [[ProviderAPI|Service Provider Interface]]? E.g. allow implementors to effectively reply
or was it rather meant as a [[ProviderAPI|Service Provider Interface]]? E.g. allow implementors to effectively reply
-
`isEmpty() == false` in case computing exact `length()` is costly? Let's
+
'''isEmpty() == false''' in case computing exact '''length()''' is costly?
-
assume the primary motivation was the [[ClientAPI]] case - e.g. calling. Rather than
+
 
-
using default methods, one could add a compile time extension in a [competing
+
Let's assume the primary motivation was the [[ClientAPI]] case - e.g. calling. Rather than using default methods, one could add a compile time extension (like in the [[Kotlin]] language) to the
-
language](https://kotlinlang.org/docs/reference/extensions.html) to the
+
{{JDK|java/lang|CharSequence}} interface. That would be purely [[ClientAPI]] (e.g. not [[SPI]]) addition - no impact on existing implementations - e.g. it would be 100% compatible.
-
`CharSequence` interface. That would be purely API (not SPI) addition - no
+
 
-
impact on existing implementations - e.g. it would be 100% compatible. True,
+
True, improving language features can help improve [[BinaryCompatibility]].
-
improving language features can help improving binary compatibility.
+
[[Category:Video]]
[[Category:Video]]

JaroslavTulach: /* On SourceCompatibility in Java */ - 2020-10-10 10:05:54

On SourceCompatibility in Java

←Older revision Revision as of 10:05, 10 October 2020
Line 40: Line 40:
wants to be a parsing and grammar guru). I also believe it is more important
wants to be a parsing and grammar guru). I also believe it is more important
to be able to compile against some fixed "-release" and then run on multiple
to be able to compile against some fixed "-release" and then run on multiple
-
versions of JVM than to compile on many "-release"s.
+
versions of [[JVM]] than to compile on many "-release"s.
==== On Enhancing the [[Java]] Language ====
==== On Enhancing the [[Java]] Language ====

JaroslavTulach: /* On Policies */ - 2020-10-10 10:04:17

On Policies

←Older revision Revision as of 10:04, 10 October 2020
Line 24: Line 24:
Overall I prefer to not make incompatible changes. At critical places I aim at
Overall I prefer to not make incompatible changes. At critical places I aim at
-
100%, at situations with more [[proximity]] I am fine with "99%". Should the `CharSequence.isEmpty()` problem
+
100%, at situations with more [[proximity]] I am fine with "99%". Should the [[BinaryCompatibleDefaultMethods|CharSequence.isEmpty() problem]]
have been known in advance, I'd avoid adding that method. However, as stated
have been known in advance, I'd avoid adding that method. However, as stated
above, it is a matter of policy: both decisions can be justified.
above, it is a matter of policy: both decisions can be justified.

JaroslavTulach: /* On Being too Demanding */ - 2020-10-10 10:02:29

On Being too Demanding

←Older revision Revision as of 10:02, 10 October 2020
Line 11: Line 11:
Of course 100% compatible [[evolution]] may sound a bit ''too demanding'' for regular beings and their projects.
Of course 100% compatible [[evolution]] may sound a bit ''too demanding'' for regular beings and their projects.
True, but that's how [[science]] works! [[Science]] is supposed to be sharp, predictable, provide clear answers. The [[Platonic|ideal science of all times]] is geometry.
True, but that's how [[science]] works! [[Science]] is supposed to be sharp, predictable, provide clear answers. The [[Platonic|ideal science of all times]] is geometry.
-
All other human attempts to create a science mimic the principles, axioms and style of Euclids geometry. Some get closer (Newton's dynamic) some don't (medicine, social sciences, etc.).
+
All other human attempts to create a science mimic the principles, axioms and style of Euclids geometry. Some get closer (Newton's dynamic) some don't (biology, medicine, social sciences, etc.).
The [[ScienceOfAPIDesign]] shall provide such sharp answers! Whether one uses them or not, is a different story.
The [[ScienceOfAPIDesign]] shall provide such sharp answers! Whether one uses them or not, is a different story.