Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2491956.2491962acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

Harmonizing classes, functions, tuples, and type parameters in virgil iii

Published: 16 June 2013 Publication History

Abstract

Languages are becoming increasingly multi-paradigm. Subtype polymorphism in statically-typed object-oriented languages is being supplemented with parametric polymorphism in the form of generics. Features like first-class functions and lambdas are appearing everywhere. Yet existing languages like Java, C#, C++, D, and Scala seem to accrete ever more complexity when they reach beyond their original paradigm into another; inevitably older features have some rough edges that lead to nonuniformity and pitfalls. Given a fresh start, a new language designer is faced with a daunting array of potential features. Where to start? What is important to get right first, and what can be added later? What features must work together, and what features are orthogonal? We report on our experience with Virgil III, a practical language with a careful balance of classes, functions, tuples and type parameters. Virgil intentionally lacks many advanced features, yet we find its core feature set enables new species of design patterns that bridge multiple paradigms and emulate features not directly supported such as interfaces, abstract data types, ad hoc polymorphism, and variant types. Surprisingly, we find variance for function types and tuple types often replaces the need for other kinds of type variance when libraries are designed in a more functional style.

References

[1]
E. Allen and R. Cartwright. The case for run-time types in generic Java. In Proceedings of the 1st Conference on the Principles and Practice of Programming in Java (PPPJ'02). Dublin, Ireland. Jun 2002.
[2]
C. Baker-Finch, K. Glynn, and S. P. Jones. Constructed product result analysis for Haskell. In Journal of Functional Programming (JFP), Volume 14, Issue 2. Mar 2004.
[3]
L. Bergstrom and J. Reppy. Arity raising in Manticore. In Proceedings of the 21st International Conference on Implementation and Application of Functional Languages (IFL'09). South Orange, NJ. Sep 2009.
[4]
N. H. Cohen. Type-extension type tests can be performed in constant time. In ACM Transactions on Programming Languages and Systems (TOPLAS), Volume 13, Issue 4. Oct 1991.
[5]
J. Dean, D. Grove and C. Chambers. Optimization of object-oriented programs using static class hierarchy analysis. In Proceedings of the 9th European Conference on Object-Oriented Programming (ECOOP'95). Aarhus, Denmark. Aug 1995.
[6]
A. Diwan, K. McKinley, and J. E. B. Moss. Using types to analyze and optimize object-oriented programs. In ACM Transactions on Programming Languages and Systems (TOPLAS), Volume 23, Issue 1. Jan 2001.
[7]
I. Dragos and M. Odersky. Compiling generics through user-directed type specialization. In Proceedings of the 4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems (ICOOOLPS'09). Genova, Italy. Jul 2009.
[8]
B. Emir, A. Kennedy, C. Russo, and D. Yu. Variance and generalized constraints for C# generics. In Proceedings of the 20th Annual European Conference on Object-Oriented Programming (ECOOP'06). Nantes, France. Jul 2006.
[9]
D. Frampton, S. M. Blackburn, P. Cheng, R. J. Garner, D. Grove, J. E. B. Moss, and S. I. Salishev. Demystifying magic: high-level low-level programming. In Proceedings of the International Conference on Virtual Execution Environments (VEE'09). Washington, DC. Mar 2009.
[10]
K. Faxén. Representation analysis for coercion placement. In Proceedings of the 9th International Symposium on Static Analysis (SAS'02). Madrid, Spain. Sep 2002.
[11]
E. Gamma, R. Helm, R. Johnson and J. Vlissides. Design patterns: elements of reusable object-oriented software. Addison-Wesley Longman Publishing Co., Inc. Boston, MA. 1995.
[12]
A. Goldberg and D. Robson. Smalltalk-80: the language and its implementation. Addison-Wesley Longman Publishing Co., Inc. Boston, MA. 1983.
[13]
Guava: Google Core Libraries for Java 1.5+http://code.google.com/p/guava-libraries/
[14]
J. J. Hallett, V. Luchangco, S. Ryu and G. L. Steele Jr. Integrating coercion with subtyping and multiple dispatch. In Science of Computer Programming, Volume 75, Issue 9. 2010.
[15]
R. Harper and G. Morrisett. Compiling polymorphism with intensional type analysis. In Proceedings of the 22nd Symposium on Principles of Programming Languages (POPL'95). San Francisco, CA. Jan 1995.
[16]
A. Igarashi and M. Viroli. On variance-based subtyping for parametric types. In Proceedings of the 16th Annual European Conference on Object-Oriented Programming (ECOOP'02). Malaga, Spain. June 2002.
[17]
JSR 335: Lambda expressions for the Java(TM) programming language.http://jcp.org/en/jsr/detail?id=335
[18]
A. J. Kennedy and D. Syme. Design and implementation of generics for the .NET Common Language Runtime. In Proceedings of the 23rd Conference on Programming Language Design and Implementation (PLDI 2001). Snowbird, UT. Jun 2001.
[19]
A. J. Kennedy and D. Syme. Combining generics, pre-compilation and sharing between software-based processes. Jan 2004.
[20]
The Maxine Virtual Machine.http://labs.oracle.com/projects/maxine/
[21]
J. E. Moreira, S. P. Midkiff, M. Gupta, P. V. Artigas, M. Snir, and R. D. Lawrence. Java programming for high performance numerical computing. In IBM Systems Journal, Volume 39, Issue 1. Jan 2000.
[22]
M. Odersky and P. Wadler. Pizza into Java: translating theory into practice. In Proceedings of the 24th Symposium on Principles of Programming Languages (POPL'97). Paris, France. Jan 1997.
[23]
M. Odersky, M. Sulzmann and M. Wehr. Type inference with constrained types. In Proceedigns of the 4th International Workshop on Foundations of Object-Oriented Programming (FOOL'97). Paris, France. Jan 1997.
[24]
B. Oliveira and J. Gibbons. Scala for generic programmers. In Proceedings of the Workshop on Generic Programming (WGP'08). Victoria, BC. Sep 2008.
[25]
J. Palsberg. Type-based analysis and applications. In Proceedings of the Workshop on Program Analysis for Software Tools (PASTE'01). Snowbird, UT. Jun 2001.
[26]
B. C. Pierce. Advanced topics in types and programming languages. MIT Press. 2004.
[27]
B. C. Pierce and D. N. Turner. Local type inference. In Proceedings of the 25th Symposium on Principles of Programming Languages (POPL'98). San Diego, California. Jan 1998.
[28]
C. van Reeuwijk and H. J. Sips. Adding tuples to Java: a study in lightweight data structures. In Proceedings of the Joint Java Grande/ISCOPE Conference (JGI'02). Seattle, Washington. Nov 2002.
[29]
O. Sallenave and R. Ducournau. Lightweight generics in embedded systems through static analysis. In Languages, Compilers, Tools and Theory for Embedded Systems (LCTES'12). Beijing, China. Jun 2012.
[30]
D. Smith and R. Cartwright. Java type inference is broken: can we fix it? In Proceedings of the 23rd Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'08). Nashville, Tennesee. Oct 2008.
[31]
B. L. Titzer. Virgil: Objects on the head of a pin. In Proceedings of the 21st Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'06). Portland, Oregon. Oct 2006.
[32]
B. L. Titzer and J. Palsberg. Vertical object layout and compression for fixed heaps. In Proceedings of the International Conference on Compilers, Architecture, and Synthesis for Embedded Systems (CASES'07). Salzburg, Austria. Oct 2007.
[33]
D. Tsafrir, R. W. Wisniewski, D. F. Bacon, and B. Stroustrup.Minimizing dependencies within generic classes for faster and smaller programs. In Proceedings of the 24th Annual Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'09). Orlando, FL. Oct 2009.
[34]
J. Vitek and B. Bokowski. Confined types. In Proceedings of the 14th Annual Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'99). Denver, CO. Oct 1999.
[35]
S. Weeks. Whole-program compilation in MLton. In Proceedings of the 2006 workshop on ML. Portland, OR. Sep 2006.Slides available: http://mlton.org/pages/References/attachments/060916-mlton.pdf
[36]
L. Ziarek, S. Weeks and S. Jagannathan. Flattening tuples in an SSA intermediate representation. In Journal of Higher-Order and Symbolic Computation, Volume 21, Issue 3. Sept 2008.

Cited By

View all
  • (2024)Flexible Non-intrusive Dynamic Instrumentation for WebAssemblyProceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 310.1145/3620666.3651338(398-415)Online publication date: 27-Apr-2024
  • (2022)A fast in-place interpreter for WebAssemblyProceedings of the ACM on Programming Languages10.1145/35633116:OOPSLA2(646-672)Online publication date: 31-Oct-2022
  • (2024)Unboxing Virgil ADTs for Fun and ProfitProceedings of the Workshop Dedicated to Jens Palsberg on the Occasion of His 60th Birthday10.1145/3694848.3694857(43-52)Online publication date: 22-Oct-2024

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PLDI '13: Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation
June 2013
546 pages
ISBN:9781450320146
DOI:10.1145/2491956
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 48, Issue 6
    PLDI '13
    June 2013
    515 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/2499370
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 16 June 2013

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. closures
  2. flattening
  3. functional programming
  4. monomorphization
  5. multi-paradigm languages
  6. object- oriented programmin
  7. parametric types
  8. static compi- lation
  9. tuples
  10. unboxing
  11. variance

Qualifiers

  • Research-article

Conference

PLDI '13
Sponsor:

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)18
  • Downloads (Last 6 weeks)1
Reflects downloads up to 20 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Flexible Non-intrusive Dynamic Instrumentation for WebAssemblyProceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 310.1145/3620666.3651338(398-415)Online publication date: 27-Apr-2024
  • (2022)A fast in-place interpreter for WebAssemblyProceedings of the ACM on Programming Languages10.1145/35633116:OOPSLA2(646-672)Online publication date: 31-Oct-2022
  • (2024)Unboxing Virgil ADTs for Fun and ProfitProceedings of the Workshop Dedicated to Jens Palsberg on the Occasion of His 60th Birthday10.1145/3694848.3694857(43-52)Online publication date: 22-Oct-2024

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media