ABSTRACT
Low-end embedded systems are still programmed in C and assembly, and adopting high-level languages such as C# should reduce the length of their development cycles. For these systems, code size is a major concern, but run-time efficiency should also be reasonable --- programmers will not migrate to C# unless the overhead compared with C is insignificant. In this paper, we propose a static approach based on whole program optimization for implementing .Net generics in such systems. Indeed, the implementation of run-time generics involves a tradeoff between size and run-time efficiency. In this proposal, generic instances are detected through a generalization of RTA to parametric polymorphism. Also, we propose an implementation scheme which employs code sharing and more effective coercions than boxing. Unlike existing implementation schemes, it is scalable in the number of generic instances without involving boxing and unboxing in a systematic way.
- O. Agesen. Concrete Type Inference: Delivering Object-Oriented Applications. PhD thesis, Stanford University, 1996. Google ScholarDigital Library
- C. S. Ananian and M. C. Rinard. Data size optimizations for Java programs. In LCTES '03, pages 59--68. ACM, 2003. Google ScholarDigital Library
- A. W. Appel. Modern Compiler Implementation in ML. Cambridge University Press, 1998. Google ScholarDigital Library
- D. F. Bacon. Fast and Effective Optimization of Statically Typed Object-Oriented Languages. PhD thesis, University of California, Berkeley, December 1997. Google ScholarDigital Library
- N. Benton, A. Kennedy, and G. Russell. Compiling standard ML to Java bytecodes. In ICFP '98, pages 129--140. ACM Press, 1998. Google ScholarDigital Library
- G. Bracha, M. Odersky, D. Stoutamire, and P. Wadler. Making the future safe for the past: adding genericity to the Java programming language. In OOPSLA '98, pages 183--200. ACM, 1998. Google ScholarDigital Library
- R. Cartwright and G. L. Steele, Jr. Compatible genericity with run-time types for the Java programming language. In OOPSLA '98, pages 201--215. ACM, 1998. Google ScholarDigital Library
- N. H. Cohen. Type-extension type tests can be performed in constant time. ACM Trans. Program. Lang. Syst., pages 626--629, 1991. Google ScholarDigital Library
- R. C. H. Connor. Types and Polymorphism in Persistent Programming Systems. PhD thesis, University of St Andrews, 1990.Google Scholar
- R. Costa and E. Rohou. Comparing the size of .NET applications with native code. In CODES+ISSS '05, pages 99--104. ACM, 2005. Google ScholarDigital Library
- I. Dragos and M. Odersky. Compiling generics through user-directed type specialization. In ICOOOLPS '09, pages 42--47. ACM, 2009. Google ScholarDigital Library
- R. Ducournau. Coloring, a versatile technique for implementing object-oriented languages. Softw., Pract. Exper., pages 627--659, 2011. Google ScholarDigital Library
- A. Kennedy and D. Syme. Design and implementation of generics for the .NET Common Language Runtime. In PLDI '01, pages 1--12. ACM, 2001. Google ScholarDigital Library
- A. Kennedy and D. Syme. Combining generics, pre-compilation and sharing between software-based processes, 2004.Google Scholar
- D. Kerr-Munslow. Advantages and pitfalls of moving from an 8 bit system to 32 bit architectures. In ERTS2 '10, 2010.Google Scholar
- J. S. Miller and S. Ragsdale. The Common Language Infrastructure annotated standard. Addison-Wesley, 2004. ISBN 0-321-15493-2. Google ScholarDigital Library
- M. Odersky and P. Wadler. Pizza into Java: Translating theory into practice. In POPL '97, pages 146--159. ACM, 1997. Google ScholarDigital Library
- O. Sallenave and R. Ducournau. Efficient compilation of .NET programs for embedded systems. In ICOOOLPS '10, pages 3:1--3:8. ACM, 2010. Google ScholarDigital Library
- B. Stroustrup. The C++ Programming Language. Addison-Wesley, 3rd edition, 2000. ISBN 0-201-88954-4. Google ScholarDigital Library
- M. Viroli and A. Natali. Parametric polymorphism in Java: an approach to translation based on reflective features. In OOPSLA '00, pages 146--165. ACM, 2000. Google ScholarDigital Library
- J. Vitek, R. N. Horspool, and A. Krall. Efficient type inclusion tests. In OOPSLA '97, pages 142--157. ACM, 1997. Google ScholarDigital Library
- D. Yu, A. Kennedy, and D. Syme. Formalization of generics for the .NET Common Language Runtime. In POPL '04, pages 39--51. ACM, 2004. Google ScholarDigital Library
- O. Zendra, D. Colnet, and S. Collin. Efficient dynamic dispatch without virtual function tables: The SmallEiffel compiler. In OOPSLA '97, pages 125--141. ACM, 1997. Google ScholarDigital Library
Index Terms
- Lightweight generics in embedded systems through static analysis
Recommendations
Lightweight generics in embedded systems through static analysis
LCTES '12Low-end embedded systems are still programmed in C and assembly, and adopting high-level languages such as C# should reduce the length of their development cycles. For these systems, code size is a major concern, but run-time efficiency should also be ...
Formalization of generics for the .NET common language runtime
POPL '04We present a formalization of the implementation of generics in the .NET Common Language Runtime (CLR), focusing on two novel aspectsof the implementation: mixed specialization and sharing, and efficient support for run-time types. Some crucial ...
Refactoring Java generics by inferring wildcards, in practice
OOPSLA '14Wildcard annotations can improve the generality of Java generic libraries, but require heavy manual effort. We present an algorithm for refactoring and inferring more general type instantiations of Java generics using wildcards. Compared to past ...
Comments