moteur de recherche

Séminaire Algo - Rémi Forax
Séminaire Algo - Rémi Forax
26-sept.-2017 14:30
Il y a: 3 yrs

Rémi Forax

On implementing data structures pattern matching in Java

Salle de séminaire (4B05R) - Bâtiment Copernic

In the magic wonderland of the unicorns, implementing the pattern matching in a language like Java that already provides a mechanism to check the class of a value at runtime (instanceof in Java) is easy. The translation consists in replacing each predicate with an if .. instanceof. It's maybe a little harder if like in Scala, you allow to decompose patterns (see a Point as tuples of integers) but it should be ok, right ? No, trying the naive approach makes the execution of such code either slow or embarrassingly slow.

In this presentation, I will explain why the naive translation is so slow and propose a new translation that is fast at runtime (as fast as a polymorphic call) and also takes care of the dynamic nature of Java (runtime class loading, separate compilation, etc).

<- retour: