Properties
Andrew Dinn
adinn at redhat.com
Wed Apr 24 13:22:01 UTC 2024
On 24/04/2024 13:44, Ron Pressler wrote:
> While some programmers like having lots of features, each addressing
> a specific problem — and some programming languages choose to
> accommodate them — we believe that most programmers prefer languages
> with fewer features, and so the trick is finding ways to *avoid*
> adding language features. The way to do that is to find a smaller
> number of powerful features that address multiple problems — even if
> not perfectly — rather than add a language feature for every problem.
> For example, records help make serialization safer, they help with
> deconstruction (through pattern matching), and at the same time they
> also *reduce* — even if not eliminate — the need for setters, making
> them a smaller problem. Not every problem merits a language feature
> (which complicates the language and thus creates a new problem).
Just as an a fortiori to Ron's point I'll note that Java, like most
managed language runtimes, profits enormously from the fact that it
offers only a limited set of orthogonal, composable features. This
design choice dramatically reduces the suite of basic operations that a
program can employ and *combine*. As a result the circumstances in which
certain operations and outcomes can occur during execution are much more
sharply defined than in more feature-rich languages.
The result is a host of opportunities for Java to perform highly
aggressive optimizations that would be incorrect or, at least,
frequently have indeterminate validity if attempted in those other
languages. When combined with the speculative optimization opportunities
that come from dynamic compilation of an evolving code base (and the
requisite flip-side of that speculative coin, the ability to
de-optimize) this puts Java in its own league when it comes to optimized
performance.
That is a major prize that many of your proposals to extend the language
will run up against. It is also one that Brian Goetz and the other
project (Amber/Panama/Loom/CoreLibs/etc) devs who consider, design and
implement language and lib changes are very well aware of.
regards,
Andrew Dinn
-----------
Red Hat Distinguished Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill
More information about the compiler-dev
mailing list