“…Glew has formalized source-to-source closure conversion for an object calculus that supports the nested definitions of methods [17]. The language is very different from C in that it does not have classes and type equivalence is by structure, not name.…”
SUMMARYWe present a type-preserving translation of System F (the polymorphic lambda calculus) into a forthcoming revision of the C programming language supporting parameterized classes and polymorphic methods. The forthcoming revision of Java in JDK 1.5 also makes a suitable target. We formalize the translation using a subset of C similar to Featherweight Java. We prove that the translation is fully type-preserving and that it preserves behaviour via the novel use of environment-style semantics for System F.We observe that whilst parameterized classes alone are sufficient to encode the parameterized datatypes and let-polymorphism of languages such as ML and Haskell, it is the presence of dynamic dispatch for polymorphic methods that supports the encoding of the 'first-class polymorphism' found in System F and recent extensions to ML and Haskell.
“…Glew has formalized source-to-source closure conversion for an object calculus that supports the nested definitions of methods [17]. The language is very different from C in that it does not have classes and type equivalence is by structure, not name.…”
SUMMARYWe present a type-preserving translation of System F (the polymorphic lambda calculus) into a forthcoming revision of the C programming language supporting parameterized classes and polymorphic methods. The forthcoming revision of Java in JDK 1.5 also makes a suitable target. We formalize the translation using a subset of C similar to Featherweight Java. We prove that the translation is fully type-preserving and that it preserves behaviour via the novel use of environment-style semantics for System F.We observe that whilst parameterized classes alone are sufficient to encode the parameterized datatypes and let-polymorphism of languages such as ML and Haskell, it is the presence of dynamic dispatch for polymorphic methods that supports the encoding of the 'first-class polymorphism' found in System F and recent extensions to ML and Haskell.
“…Interest in fully abstract translation has a long history [25,34,17,40,37,35,6,7,2,18,3,16,29,30], with several authors pointing out that failures of full abstraction can be turned into security exploits [1,21,14].…”
A fully abstract compiler guarantees that two source components are observationally equivalent in the source language if and only if their translations are observationally equivalent in the target. Full abstraction implies the translation is secure: target-language attackers can make no more observations of a compiled component than a source-language attacker interacting with the original source component. Proving full abstraction for realistic compilers is challenging because realistic target languages contain features (such as control effects) unavailable in the source, while proofs of full abstraction require showing that every target context to which a compiled component may be linked can be back-translated to a behaviorally equivalent source context.We prove the first full abstraction result for a translation whose target language contains exceptions, but the source does not. Our translation-specifically, closure conversion of simply typed λ-calculus with recursive types-uses types at the target level to ensure that a compiled component is never linked with attackers that have more distinguishing power than source-level attackers. We present a new back-translation technique based on a shallow embedding of the target language into the source language at a dynamic type. Then boundaries are inserted that mediate terms between the untyped embedding and the strongly-typed source. This technique allows back-translating non-terminating programs, target features that are untypeable in the source, and well-bracketed effects.
“…Clearly, many target languages, including C and C++, do not directly support higher-order functions, and we eliminate them using the process known as closure conversion 1 or lambda lifting [11], [12]. As the result, the descriptor system used in Intel IPP and FFTW naturally arises.…”
Section: Library Generationmentioning
confidence: 99%
“…It is widely known that in object-oriented languages closures can be naturally expressed with objects and vice versa, which makes C++ a good choice for a target language. This conversion is also discussed in detail in [12], [13]. In our library generator, we create a class for each recursion step; the class attributes are the cold and reinit parameters of the recursion step.…”
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.