r/programming • • Sep 15 '20

Java 15 released!

https://jdk.java.net/15/
214 Upvotes

130 comments sorted by

View all comments

215

u/Ravoos Sep 15 '20 edited Sep 15 '20

Java devs: Cool.....I'm still using Java 8 tough.

Edit: Okay, I got a lot of interesting comments here when I just made a joke. Still, it is fun to read it all and to see just bow dedicated the Java guys are to their language

7

u/[deleted] Sep 15 '20

*Laughs in private PC, that has currently Java 14 and tomorrow Java 15*

4

u/Ameisen Sep 16 '20

Laughs in C++14 when C++20 is done.

2

u/Ipotrick Sep 16 '20

thr move to c++20 eill be like using a new language

1

u/Ameisen Sep 16 '20 edited Sep 16 '20

Problem is that the only compilers that support modules at the moment are MSVC and Clang. Very few build systems do; MSVC's does in their preview branch, but Intellisense still doesn't.

I'm also still not fond of the dependency issues with C++20 modules. It limits parallelism and prohibits circular module references which would be allowed with normal source files. I wish that they'd bitten the bullet and made it so C++ modules used two-pass compilation rather than one-pass.

Concept support is still a bit spotty as well. I haven't had much of a chance to mess with concepts, yet. My hope is that constexpr and concepts combined will let me reduce template nesting for type management, which should improve compile times.

1

u/flatfinger Sep 16 '20

Two-pass compilation offers so many advantages over one-pass that I'd regard the latter as appropriate only in languages which are making a bona fide effort to maximize simplicity of implementation (something C++ abandoned long ago).

1

u/Ameisen Sep 16 '20

The problem is that two-pass compilation would indeed require a complete rewrite of significant parts of the C++ specification, and would be a very breaking change.

The thing is... they could have implemented it for modules. They sort of did, but not entirely.

1

u/flatfinger Sep 16 '20

I would think a two-pass compilation approach for modules could make adaptation of implementations to support them easier, if they were designed in such a way that the first pass would convert code that uses modules into code that could be processed by existing implementations.

Probably the biggest obstacle I can see to efficiently something like that is the way debug line-number symbols are presently handled, which vastly increases the number of intermediate files that would change as a result of editing anything in the source. If the debug line numbers passed through intermediate stages of compilation were relative to the start of the outermost function or object declaration wherein they occur, and a final cleanup pass converted those line numbers into actual source-file line numbers, that could minimize the amount of stuff that would have to be rebuilt when things change.