{'fraction_non_alphanumeric': 0.027074235807860263, 'fraction_numerical': 0.00611353711790393, 'mean_word_length': 4.787878787878788, '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}}
Efficient compilation of tail calls and continuations to JavaScript

This paper describes an approach for compiling Scheme's tail calls and first-class continuations to JavaScript, a dynamic language without those features. Our approach is based on the use of a simple custom virtual machine intermediate representation that is translated to JavaScript. We compare this approach, which is used by the Gambit-JS compiler, to the Replay-C algorithm, used by Scheme2JS (a derivative of Bigloo), and Cheney on the MTA, used by Spock (a derivative of Chicken). We analyse the performance of the three systems with a set of benchmark programs on recent versions of four popular JavaScript VMs (V8, SpiderMonkey, Nitro and Chakra). On the benchmark programs, all systems perform best when executed with V8 and our approach is consistently faster than the others on all VMs. For some VMs and benchmarks our approach is moderately faster than the others (below a factor of 2), but in some cases there is a very large performance gap (with Nitro there is a slowdown of up to 3 orders of magnitude for Scheme2JS, and up to 2 orders of magnitude for Spock).