Affiliation:
1. Università di Genova, Genova, Italy
2. Università di Torino, Torino, Italy
3. Imperial College, London, UK
Abstract
We define
compositional compilation
as the ability to typecheck source code fragments in isolation, generate corresponding binaries,and link together fragments whose mutual assumptions are satisfied, without reinspecting the code. Even though compositional compilation is a highly desirable feature, in Java-like languages it can hardly be achieved. This is due to the fact that the bytecode generated for a fragment (say, a class) is not uniquely determined by its source code, but also depends on the compilation context.We propose a way to obtain compositional compilation for Java, by introducing a
polymorphic form of bytecode
containing type variables (ranging over class names) and equipped with a set of constraints involving type variables. Thus, polymorphic bytecode provides a representation for all the (standard) bytecode that can be obtained by replacing type variables with classes satisfying the associated constraints.We illustrate our proposal by developing a typing and a linking algorithm. The typing algorithm compiles a class in isolation generating the corresponding polymorphic bytecode fragment and constraints on the classes it depends on. The linking algorithm takes a collection of polymorphic bytecode fragments, checks their mutual consistency, and possibly simplifies and specializes them. In particular, linking a self-contained collection of fragments either fails, or produces standard bytecode (the same as would have been produced by standard compilation of all fragments).
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
7 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. A co-contextual formulation of type rules and its application to incremental type checking;Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications;2015-10-23
2. A sound and optimal incremental build system with dynamic dependencies;Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications;2015-10-23
3. Implementing type-safe software product lines using parametric traits;Science of Computer Programming;2015-01
4. A three-valued type system for true positives detection in Java-like languages;Proceedings of the 17th Workshop on Formal Techniques for Java-like Programs - FTfJP '15;2015
5. Explicit substitution calculi with de Bruijn indices and intersection type systems;Logic Journal of IGPL;2014-12-30