040coders.nl: Talks and Videos. Food and Drinks. Every 3rd Thursday somewhere in the 040 region. 040coders.nl: Talks and Videos. Food and Drinks. Every 3rd Thursday somewhere in the 040 region.



Transpilation using Recursive Rewrite Rules

From Legacy to Maintainable Code


Talk

Piërre van de Laar By: Piërre van de Laar
From: TNO-ESI

Talk at Meetup 2026-05-21


Abstract

Software systems often depend on third-party components, such as libraries and frameworks. When these components become deprecated, maintenance is required to ensure the continued functionality of these systems.

In this presentation, we focus on a case study at ASML, one of the world’s leading manufacturers of chip-making equipment, involving the deprecation of a UI framework, which necessitated the transpilation of part of an industrial code base from C to Python.

ASML estimated that manual transpilation would require 100 man-years of effort.

To significantly reduce this effort, we developed a novel rejuvenation methodology based on three key pillars aimed at producing maintainable code in the target language.
The first pillar focuses on efficient transpilation through source code analysis that quantifies the frequency of recurring patterns – such as variable initialization, UI framework calls, and function definitions – by prioritizing the automation of the most frequently recurring patterns.
The second pillar automates the transpilation by using a novel rule-based recursive rewrite system that matches concrete syntax patterns with placeholders to sequences of AST nodes, rewrites the placeholders within the matches recursively, and has default rules for unmatched AST nodes that offer clear guidance for manual transpilation.
The third pillar focuses on generating test cases, first to capture usage context and, second to detect functional regression.

Awareness of the usage context enables idiomatic rather than literal transpilation, resulting in more readable and maintainable code in the target language. We validated our methodology using two components dependent on the deprecated UI framework. ASML estimates that applying this methodology will reduce the required effort by 70%, demonstrating the effectiveness of our strategy.


Biography

Piërre van de Laar is a Research Fellow at TNO-ESI in Eindhoven, The Netherlands, and has participated in multiple public–private research projects with Philips, Thales, ASML, VDL, ITEC, and most Dutch universities focusing on the following technical topics: Before joining TNO-ESI, Piërre worked at Philips Research in Eindhoven, The Netherlands, where he investigated the exploitation of architecture description languages for product families, visualization, verification, aspect-orientation, and dependability.

Piërre studied theoretical and computational physics and received his Ph.D. at the Catholic University of Nijmegen, The Netherlands.



contact: organizers at 040coders.nl
contact: organizers at 040coders.nl