Enhancing expressions with mutability?

B. Blaser bsrbnd at gmail.com
Wed Apr 1 18:32:42 UTC 2020

On Mon, 23 Mar 2020 at 20:33, Maurizio Cimadamore
<maurizio.cimadamore at oracle.com> wrote:
> > I'm planning to employ experimentally to solve some
> > tricky performance issues in javac's type inference solving system,
> > see [3].
> With respect to implement type inference using these algorithms, I feel
> less sanguine.

So, here is a concrete experiment:


Quoting from my comment on JBS, it uses a parallel genetic algorithm
to solve all contextual inference variables at once requiring only a
small subset of propagation steps which reduces JDK-8152289 example's
compilation time to a couple of seconds! Note that this heuristic is
dedicated to similar examples and the usual inference algorithm is
still used if the former doesn't converge rapidly enough.

The current design is absolutely not affected as this implementation
additionally uses very expressive mutable expressions like "Term gene
= (`able).link(`adn, `undetvars.get(i), `type());" employing the
quotation operator `. It simply requires a boot JDK (14) including the
patch minus inference changes in Attr, Infer & InferenceContext.

Still not convinced?


More information about the compiler-dev mailing list