{'fraction_non_alphanumeric': 0.02108433734939759, 'fraction_numerical': 0.0, 'mean_word_length': 5.850515463917525, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Specialization for applications using shared libraries

Shared libraries have been prevalently deployed in many systems and application domains in the last decade. Their ubiquity depends largely on their allowance for sharing; ie., a single copy of the library is used across multiple applications running on a single system. Unfortunately, traditional partial evaluation does not consider the sharing issue. Specifically, libraries are treated as if they are statically linked, and sharing is not preserved during the process of creating and running specialized libraries, especially across different specialized applications. In this paper, we propose a methodology for run-time specialization that aims to maximize sharing during the whole specialization process. Specifically, we advocate a stand-alone specialization of shared libraries (independent of their clients), and propose a specialization mechanism which enables sharing of run-time specialized library code both within a specialized application and across multiple specialized applications. Our proposal includes a novel static transformation that constructs a generic specialization library/component, aiming to eliminate code duplication arising at compile-time, as well as a novel run-time specialization that eliminates code duplication occurring at run-time.