New informational JEP: 14: The Tip & Tail Model of Library Development

Alan Snyder javalists at cbfiddle.com
Tue Oct 22 16:32:43 UTC 2024


> On Oct 21, 2024, at 10:15 AM, Alex Buckley <alex.buckley at oracle.com> wrote:
> 
> The JDK is all-in on tip & tail, so backporting new language features to old JDKs isn't going to happen. It's not just a matter of patching javac in JDK 8uXX: it's also the cost of revising the JLS, the JCK, documentation, etc, from the Java 8 release.

Perhaps there is a misunderstanding. My suggestion does not involve changing old JDKs or compilers.

The suggestion is to enhance javac with a new command line flag. This flag is similar to the —enable-preview flag in that it allows some language features to be used that otherwise would be rejected (in this case, because they are not supported by the target JDK release). It is unlike —enable-preview in that it does not have any corresponding JVM support (by definition).

Any language extension that could be implemented on the target JDK using a preprocessor is a candidate for support by this javac feature. (In theory, javac could implement this feature using a preprocessor, but a direct implementation would be simpler.)

I would think that new syntax for string literals would fall in this category as long as the result is a string literal that is supported by the target JDK. The fact that javac uses new APIs to implement the new syntax is irrelevant.

Some language extensions may involve removing restrictions performed by older compilers. Such extensions probably cannot be implemented using a preprocessor. However, if no JVM support is required, then these extensions are also candidates for a direct implementation by javac. Flexible constructor bodies might fit in this category. Even a restricted version of this feature would be useful.

You make a good point that javadoc would need to support the same flag, just as it currently supports —enable-preview.

  Alan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jdk-dev/attachments/20241022/1415b080/attachment.htm>


More information about the jdk-dev mailing list