Group 4: Song Li, Ying Lu, Hexin Wang, and Michael Walker May 1, 2000

Slides:



Advertisements
Similar presentations
Eiffel: Analysis, Design and Programming Bertrand Meyer (Nadia Polikarpova) Chair of Software Engineering.
Advertisements

ECE 750 Topic 8 Meta-programming languages, systems, and applications Load-time structural reflection in Java – Shigeru Chiba, 2000 May 27, 2004 Shimin.
Object Oriented Programming in Java George Mason University Fall 2011
Generic programming in Java
Lightweight Abstraction for Mathematical Computation in Java 1 Pavel Bourdykine and Stephen M. Watt Department of Computer Science Western University London.
Java Generics.
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.1 Introduction to Java.
1 Introducing Collaboration to Single User Applications A Survey and Analysis of Recent Work by Brian Cornell For Collaborative Systems Fall 2006.
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
Programming Language Semantics Java Threads and Locks Informal Introduction The Java Specification Language Chapter 17.
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
1 Java Grande Introduction  Grande Application: a GA is any application, scientific or industrial, that requires a large number of computing resources(CPUs,
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
1 Dan Quinlan, Markus Schordan, Qing Yi Center for Applied Scientific Computing Lawrence Livermore National Laboratory Semantic-Driven Parallelization.
Abstract Data Types and Encapsulation Concepts
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
JVM And CLR Dan Agar April 16, Outline Java and.NET Design Philosophies Overview of Virtual Machines Technical Look at JVM and CLR Comparison of.
C++ Code Analysis: an Open Architecture for the Verification of Coding Rules Paolo Tonella ITC-irst, Centro per la Ricerca Scientifica e Tecnologica
Comp 311 Principles of Programming Languages Lecture 1 Course Overview and Culture Corky Cartwright August 25, 2008.
Programming Languages and Design Lecture 7 Subroutines and Control Abstraction Instructor: Li Ma Department of Computer Science Texas Southern University,
Chapter 21 Generics 1. Generics - Overview Generic Methods specify a set of related methods Generic classes specify a set of related types Software reuse.
Class Relationships Lecture Oo10 Dependencies. References n Booch, et al, The Unified Modeling Language User Guide, Chapt 5 p.69, Chapt 9 130, Chapt 10.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well.
Structure of Programming Languages Names, Bindings, Type Checking, and Scopes.
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
1 CS Programming Languages Class 22 November 14, 2000.
FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.
Introduction to Programming 1 1 2Introduction to Java.
Arvind Computer Science and Artificial Intelligence Laboratory M.I.T. L05-1 September 21, 2006http:// Types and Simple Type.
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
(Thunking about Thunks)
Lecture 4: Metacircles Eval Apply David Evans
Advanced Computer Systems
Algorithms and Problem Solving
Type Checking and Type Inference
Sections Inheritance and Abstract Classes
Visit for more Learning Resources
Lecture 6: Lambda Calculus
Type Checking Generalizes the concept of operands and operators to include subprograms and assignments Type checking is the activity of ensuring that the.
Compositional Pointer and Escape Analysis for Java Programs
CS 326 Programming Languages, Concepts and Implementation
Lambda Calculus Revisited
Generics, Lambdas, Reflections
Teaching Computing to GCSE
Formal Models for Programming Languages
Generic programming in Java
Lecture 21: Crosscutting Aspect-Oriented Programming Background
CMP 131 Introduction to Computer Programming
Lecture 10: The Return of Paco Background just got here last week
Lecture 7: Data Abstraction
Einführung in die Programmierung Introduction to Programming Prof. Dr
Algorithms and Problem Solving
Lecture 10: Using Object-Oriented Languages
Einführung in die Programmierung Introduction to Programming Prof. Dr
  Introduction  What the generic.  What are the Generic types : - Class - Methods   Type of coding the generic method. - Using the generic method.
Lecture 17: Defeating Malcode (Shameless Self-Promotion) Background
Lecture 19: Proof-Carrying Code Background just got here last week
Lecture 10: Fixed Points ad Infinitum M.C. Escher, Moebius Ants
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Chapter 17 - Component-based software engineering
Einführung in die Programmierung Introduction to Programming Prof. Dr
David Evans Lecture 19: ||ism I don’t think we have found the right programming concepts for parallel computers yet.
Lecture 12: Minding your Ps & Qs:
Lecture 15: Crazy Eddie and the Fixed Points Background
Lecture 18 Compilers and Language Translation (S&G, ch. 9)
Abstract Types Defined as Classes of Variables
Presentation transcript:

Group 4: Song Li, Ying Lu, Hexin Wang, and Michael Walker May 1, 2000 Java ParTy: Java With Parameterized Types “Tonight I’m gonna ParTy like it’s 1999.” Prince Background just got here last week finished degree at MIT week before Philosophy of advising students don’t come to grad school to implement someone else’s idea can get paid more to do that in industry learn to be a researcher important part of that is deciding what problems and ideas are worth spending time on grad students should have their own project looking for students who can come up with their own ideas for research will take good students interested in things I’m interested in – systems, programming languages & compilers, security rest of talk – give you a flavor of the kinds of things I am interested in meant to give you ideas (hopefully even inspiration!) but not meant to suggest what you should work on CS655: Programming Languages University of Virginia Computer Science Group 4: Song Li, Ying Lu, Hexin Wang, and Michael Walker May 1, 2000

University of Virginia CS 655 Outline Motivation Related Work Our Solution: ParTy Evaluation Remaining Work Conclusion 22 July 2019 University of Virginia CS 655

University of Virginia CS 655 Motivation Java provides no support for genericity [JLS] Must use Object parameters with type casting Performance hit Type safety is an issue 22 July 2019 University of Virginia CS 655

Genericity: Potential Benefits Ideal scenario: One generic abstraction that adapts Compiled code is JVM-compatible Type safety control is just as powerful as non-generic code Performance boost in execution speed Small code size 22 July 2019 University of Virginia CS 655

Genericity: Potential Benefits ParTy scenario: One generic abstraction that adapts Compiled code is JVM-compatible Type safety control is just as powerful as non-generic code Performance boost in execution speed Small code size We can’t have everything! But we can delay code blowup... 22 July 2019 University of Virginia CS 655

University of Virginia CS 655 Related Work Examine support for type parameters in other languages C++, Ada, Sather, Eiffel, Haskell, ML Examine current proposals for Java extensions GJ, PolyJ, Pizza, Agesen et. al. 22 July 2019 University of Virginia CS 655

Related Work: GJ and Pizza [Bracha+98] GJ translates into legal JVM bytecode Homogeneous genericity Substitutes type variables by their “bounding type” usually, Object Constrains code size Sacrifices speed No type constraints 22 July 2019 University of Virginia CS 655

Related Work: PolyJ [Liskov+97] Modifies JVM bytecode to express parameterization better performance small code size Adds where clause type constraints a la CLU [LSA+77] Creates a new language 22 July 2019 University of Virginia CS 655

Related Work: Agesen et. al. (Stanford, 1997) Insert preprocess step into JVM loader no change to JVM delays code blowup until load-time! No type constraints Details of implementation are vague 22 July 2019 University of Virginia CS 655

Related Work: Comparison 22 July 2019 University of Virginia CS 655

University of Virginia CS 655 Java ParTy Philosophy Provide a powerful, safe, and efficient construct for designing generic classes without changing JVM bytecodes Rule: Do not add complexity to Java unless its usefulness outweighs its complexity 22 July 2019 University of Virginia CS 655

Our Solution: Java ParTy Constructed JLS-extended syntax and semantics Brief list of features: type parameters within class or interface where clause type constraints type parameter can itself be of a parameterized type 22 July 2019 University of Virginia CS 655

University of Virginia CS 655 ParTy Code Example class myClass<Type1, Type2> where { boolean lt( Type1 t) } extends myBaseClass implements myInterface { // class body } 22 July 2019 University of Virginia CS 655

ParTy Implementation ParTy class A (1) Generic class A written class A<T>{ // body } (1) Generic class A written (2) class B written to instantiate A with actual types ParTy class B Class B { A<int> a; A<String> b; } 22 July 2019 University of Virginia CS 655

ParTy Implementation ParTy class A (3) Classes are sent to compiler (4) Corresponding .pclass created ParTy compiler class A<T>{ // body } A.pclass file ParTy class B Class B { A<int> a; A<String> b; } B.pclass file 22 July 2019 University of Virginia CS 655

ParTy Implementation ParTy class A (5) Regular .class files generated at load-time ParTy compiler ParTy preprocessor class A<T>{ // body } A_int .class A.pclass file A_String .class ParTy class B Class B { A<int> a; A<String> b; } B.pclass file B.class 22 July 2019 University of Virginia CS 655

ParTy Implementation JVM (6) JVM-compatible classes are run ParTy class A ParTy compiler ParTy preprocessor class A<T>{ // body } A_int .class JVM A.pclass file A_String .class ParTy class B Class B { A<int> a; A<String> b; } B.pclass file B.class 22 July 2019 University of Virginia CS 655

Qualitative Evaluation How useful is ParTy? Constructed Pair, Set, LinkedList, OrderedSet generic classes What restrictions are there? No where clause for individual methods no implicit type information allowed no value parameters within <…> 22 July 2019 University of Virginia CS 655

Quantitative Evaluation Code size blowup delay is good for network transmissions Benchmarking Ran ParTy code against equivalent Java Results... 22 July 2019 University of Virginia CS 655

Quantitative Evaluation: Results ParTy yielded code up to 27.6% faster! 22 July 2019 University of Virginia CS 655

University of Virginia CS 655 Remaining Work Finish ParTy compiler add type checks Support for primitive types Integration of ParTy preprocessor into JVM ClassLoader more extensive benchmarking 22 July 2019 University of Virginia CS 655

University of Virginia CS 655 Conclusion 22 July 2019 University of Virginia CS 655

University of Virginia CS 655 Conclusion ParTy provides a powerful, safe, and efficient construct for designing generic classes without changing JVM bytecodes ParTy code size expansion delayed until load time ParTy adds only the most useful features of type parameterization to Java 22 July 2019 University of Virginia CS 655