Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/1168054.1168079acmotherconferencesArticle/Chapter ViewAbstractPublication PagespppjConference Proceedingsconference-collections
Article

Typeless programming in Java 5.0

Published: 30 August 2006 Publication History

Abstract

With the introduction of Java 5.0 [9] the type system has been extended by parameterized types, type variables, type terms, and wildcards. As a result very complex types can arise. The termVector<Vector<AbstractList<Integer>>>is for example a correct type in Java 5.0.Considering all that, it is often rather difficult for a programmer to recognize whether such a complex type is the correct one for a given method or not. Furthermore there are methods whose principle types would be intersection types. But intersection types are not implemented in Java 5.0. This means that Java 5.0 methods often don't have the principle type which is contradictive to the OOP-Principle of writing re-usable code.This has caused us to develop a Java 5.0 type inference system which assists the programmer by calculating types automatically. This type inference system allows us, to declare method parameters and local variables without type annotations. The type inference algorithm calculates the appropriate and principle types.We implement the algorithm in Java using the observer design pattern.

References

[1]
A. Aiken and E. L. Wimmers. Type inclusion constraints and type inference. In Functional Programming Languages and Computer Architecture, pages 31--41, 1993.
[2]
E. Berk. JLex: A lexical analyzer generator for Java(TM). http://www.cs.princeton.edu/appel/modern/java/JLex, 1.2 edition, October 1997.
[3]
L. Damas and R. Milner. Principal type-schemes for functional programs. Proc. 9th Symposium on Principles of Programming Languages, 1982.
[4]
A. Donovan, A. Kiezun, M. S. Tschantz, and M. D. Ernst. Converting java programs to use generic libraries. In OOPSLA '04: Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 15--34, New York, NY, USA, 2004. ACM Press.
[5]
J. Eifrig, S. Smith, and V. Trifonov. Type Inference for Recursively Constrained Types and its Application to Object Oriented Programming. Electronic Notes in Theoretical Computer Science, 1, 1995.
[6]
R. Fuhrer, F. Tip, A. Kiezun, J. Dolby, and M. Keller. Efficiently refactoring Java applications to use generic libraries. In ECOOP 2005 --- Object-Oriented Programming, 19th European Conference, Glasgow, Scotland, July 27--29, 2005.
[7]
Gang of Four. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995.
[8]
A. Goldberg and D. Robson. Smalltalk-80: The Language and Its Implementation. Addison-Wesley, 1983.
[9]
J. Gosling, B. Joy, G. Steele, and G. Bracha. The Java#8482; Language Specification. The Java series. Addison-Wesley, 3rd edition, 2005.
[10]
S. P. Jones, editor. Haskell 98 Language and Libraries, The Revised Report. Cambridge University Press, 2003.
[11]
D. Kozen, J. Palsberg, and M. I. Schwartzbach. Efficient inference of partial types. Journal of Computer and System Sciences, 49(2):306--324, 1994.
[12]
B. Kühl and A.-T. Schreiner. jay -- Compiler bauen mit Yacc und Java. iX, 1999. (in german).
[13]
A. Martelli and U. Montanari. An efficient unification algorithm. ACM Transactions on Programming Languages and Systems, 4:258--282, 1982.
[14]
R. Milner. The definition of Standard ML (Revised). MIT Press, Cambridge, Mass., 1997.
[15]
N. Oxhoj, J. Palsberg, and M. I. Schwartzbach. Making type inference practical. Proceedings of ECOOP'92, Sixth European Conference on Object-Oriented Programming, LNCS 615:329--349, July 1992.
[16]
M. Plümicke. OBJ-P The Polymorphic Extension of OBJ-3. PhD thesis, University of Tuebingen, WSI-99-4, 1999.
[17]
M. Plümicke. Type unification in Generic--Java. In M. Kohlhase, editor, Proceedings of 18th International Workshop on Unification (UNIF'04), July 2004.
[18]
G. Smolka. Logic Programming over Polymorphically Order-Sorted Types. PhD thesis, Department Informatik, University of Kaiserslautern, Kaiserslautern, Germany, May 1989.

Cited By

View all

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Other conferences
PPPJ '06: Proceedings of the 4th international symposium on Principles and practice of programming in Java
August 2006
230 pages
ISBN:3939352055
DOI:10.1145/1168054
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]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 30 August 2006

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. code generation
  2. language design
  3. program design and implementation
  4. type inference
  5. type system

Qualifiers

  • Article

Acceptance Rates

Overall Acceptance Rate 29 of 58 submissions, 50%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 13 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2015)More Type Inference in Java 8Perspectives of System Informatics10.1007/978-3-662-46823-4_20(248-256)Online publication date: 19-Apr-2015
  • (2009)Java Type Unification with WildcardsApplications of Declarative Programming and Knowledge Management10.1007/978-3-642-00675-3_15(223-240)Online publication date: 21-Apr-2009
  • (2008)Intersection types in JavaProceedings of the 6th international symposium on Principles and practice of programming in Java10.1145/1411732.1411757(181-188)Online publication date: 9-Sep-2008
  • (2007)Typeless programming in Java 5.0 with wildcardsProceedings of the 5th international symposium on Principles and practice of programming in Java10.1145/1294325.1294336(73-82)Online publication date: 5-Sep-2007

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media