Linguistic Reflection Via Mirrors

Size: px
Start display at page:

Download "Linguistic Reflection Via Mirrors"

Transcription

1 Linguistic Reflection Via Mirrors Gilad Bracha Joint work with David Ungar 1

2 Reflection: Overview Reflection is the ability of a program to manipulate itself More than just metaprogramming Earliest Reflective Language? 2

3 Reflection: Overview (2) Earliest Reflective Language: EDVAC/ EDSAC/Manchester Mark I Reflection is Inherent in the Von Neumann Architecture: stored program computer treats its own program as data How to structure this power in HLLs? 3

4 Introspection Reflective functionality can be divided into several distinct parts Introspection: Read only access to the program Incomparable to the notion of programs as data. Stronger - we need this program as data (so it's not just metaprogramming) Weaker - read only; e.g., cannot create programs. Java supports introspection through core reflection 4

5 Introspection: Example class Introspector { public static void main(string[] args) { Introspector i = new Introspector(); Class myclass = i.getclass(); for (Method m : myclass.getmethods()) System.out.println(m); } 5

6 Self-modification (1) Changing the current computation as it executes: Routine in Smalltalk, Self, Erlang, Lisp, Prolog, APL Limited support in JDI Enables breakpointing, fix and resume debugging, some forms of profiling 6

7 Self-modification (2) Self-modification subsumes more restricted functionality, such as: Executing data that represents code, e.g., Method.invoke() Creating new code as in ClassLoader.defineClass() 7

8 Intercession Modification of the language semantics: CLOS MOP is most extensive example More limited form in Smalltalk Class loaders allow for load-time intercession We won't discuss intercession further 8

9 Mirror Overview Mirror = an object that reflects another object. Three principles: Encapsulation: Clients of reflection must not depend on specific implementation of reflection, only on interface. Stratification: There must be a clean separation between the reflective and nonreflective levels. Correspondence: model the programming language structurally and temporally 9

10 Mirror Overview (2) Mirrors are the application of good OO software engineering to the reflective facilities of the language. Mirror implementations: Self (origin of idea) Strongtalk JDI APT 10

11 Traditional API Usage: Define Class anobjectsclass; SomeClass anobject; anobjectsclass = anobject.getclass(); Then, query a class for its superclass Class anobjectssuperclass; anobjectssuperclass = anobjectsclass.getsuperclass (); 11

12 Traditional API (2) class Object { Class getclass();... } class Class { Class getsuperclass();... } 12

13 Traditional API (3) Traditional APIs support reflection at the core of the system. Every object has at least one reflective method, which ties it to Class and (most likely) an entire reflective system. 13

14 Mirror based API class Object {... // no reflective methods } class Class {... // no reflective methods } interface Mirror { // in JDI, tostring() and virtualmachine() go here 14

15 Mirror based API (2) class Reflection { // called Bootstrap in JDI // In JDI, creates a VMManager which creates VMMirror Mirror reflect(object o); } // called ObjectReference in JDI interface ObjectMirror extends Mirror { ClassMirror getclass();... // referencetype() in JDI } // called ClassType in JDI interface ClassMirror extends Mirror { ClassMirror getsuperclass();... // superclass() in JDI } 15

16 Mirror based API Usage Object anobject; ObjectMirror anobjectmirror; ClassMirror anobjectsclassmirror, anobjectssuperclassmirror; anobjectmirror = Reflection.reflect(anObject); anobjectsclassmirror = anobjectmirror.getclass(); anobjectssuperclassmirror = anobjectsclassmirror.getsuperclass(); 16

17 Advantages of Mirrors Distribution Clients can interact with metadata sources that are local or remote w/o change to the client. JDI is an existence proof of distribution. A client can interact with multiple sources of metadata at run time, and interact with metaobjects from different implementations simultaneously. 17

18 Example: A Class Browser a. Write a class browser using core reflection b. Want to reuse code for distributed browsing 18

19 Switching Implementations One can switch implementations by modifying an import statement. Replace: import java.lang.reflect.* with import com.moi.reflection.* Some adaption needed in client (exception handling, maybe distributed GC), but once done, new version will work local or remote 19

20 Problems with Imports 2 source programs to maintain. 2 sets of binaries to distribute. Twice the code footprint. Hard for two versions to interoperate. Moral: imports are for coupling things, not decoupling. They just localize the coupling. 20

21 Problems with Imports (2) A 3rd task (c) browse from source (use parser). Again, small changes at top level. Now 3 sources, binaries, runtime versions. But, if you design (b) to an interface, (b) and (c) can be shared. In practice (a) is core reflection, (b) is JDI, and (c) is doclets/apt. 21

22 Relation to Type System The type system (or its absence) can help prevent implementation dependency. Options: 1) Structural type system 2) Nominal type system based exclusively on interfaces 3) Optional type system (with 1 or 2) 4) Dynamic typing 22

23 Relation to Type System (2) If you design a new reflective API, you might think that you can control the type system design. In practice, reflection is often added to an existing language as an afterthought (e.g., Java, MetaBeta). 23

24 Relation to Type System (3) So if you don't have one of the options 1-4? If the language at least supports interfaces, use them as much as possible! If not, use abstract classes. 24

25 Encapsulation => Stratification Exposing the class of an instance makes proxies detectable Examples: getclass(), casts, instanceof Mirrors can eliminate getclass(), but in some languages, classes have base-level semantics (e.g., instance creation in Smalltalk) Beware of identity issues 25

26 Security Stratification implies easy to identify entry point for reflection Very beneficial for security one entry point to protect easier to reason about, implement correctly 26

27 Deployment Dynamic languages failed to separate out the meta level. Classes in Smalltalk and CLOS are both meta- and non-meta-objects. Class methods and class variables are an issue. Cannot be avoided - instance construction is a class method. Difficult to deploy non-reflective applications written in reflective languages on platforms without a reflective implementation. 27

28 Deployment (2) Examples: Small devices or embedded systems Applications where footprint, security or bandwidth discourage/preclude deployment of built-in reflection support. 28

29 Relation to Type System (4) Mandatory nominal type system makes it easy to track what functionality is used. Not that easy with either structural (1), optional (3) or dynamic (4) type systems. Intersection with 1-4 yields 2 (nominal with interfaces only) as insurance against design failure. Many other considerations dictate optional nominal system with interfaces only + careful mirror based design 29

30 Deployment and Types Mandatory nominal type system with only interfaces can help avoid deployment of reflection However, if one wishes to deploy reflection dynamically, mirrors are still necessary Given disadvantages of mandatory type systems, mirrors are essential 30

31 Deployment + Distribution Interesting capabilities Remote debugging of mobile phones smart appliances Adding reflection to a running computation. Possible with Klein, experimental metacircular VM based on Self 31

32 Other issues Reflecting the HLL or the VM Reflecting method bodies Code vs. Computation Metadata Unifying Reflection and Metaprogramming 32

33 Reflect at source level or VM level? Implementation requires reflective access to VM Which Language to Reflect? VM may support high-level language(s) with different semantics Each HLL must have its own reflective API, or semantic discrepancies will arise Strongtalk is only mirror system that separates mirrors into low and high levels. 33

34 Example: Nested Classes in Java VM does not directly support nested classes Compiler uses synthetic members as part of translation from HLL (Java) to VML (Java byte code) Core reflection exposes all members, synthetic or not, exposing translation strategy 34

35 Reflecting Method Bodies Traditional reflective APIs do not reflect the internals of a method Debuggers need this; APIs often provide raw byte code (VML) which clients attempt to decompile Issues: ability to reconstruct source 35

36 Code vs. Computation The word program is ambiguous Must distinguish between Code: A description written in some programming language Computation: An executing computational process Code is intentional, declarative, static Computation is extensional, stateful, dynamic 36

37 Code vs. Computation An API like JDI is not well suited to writing a class browser that examines source files Notions like active threads, call stacks, object instantiation assume a computation Conversely, source code contains things like comments that might not be available at run time Metaprogramming APIs should model the commonalities and distinctions between code and computation (2) 37

38 Metadata User-defined metadata is a fashionable topic Allows programmers to add user-defined annotations to ASTs Popularized by C#; Being added to Java 38

39 Metadata (2) Many of the same issues arise: Code vs. Computation - should all metadata be retained at run-time? Reflecting method bodies: Some metadata (like types) requires ability to add metadata to every node of AST Distribution: Access metadata remotely, transparently 39

40 Unifying Reflection and Metaprogramming If one models the ontology of the programming language, both structurally and temporally, one may be able to unify reflection and metaprogramming Use consistent framework for compilers, assemblers, debuggers, browsers and for reflection Example applications: javac, javap/ jdis/jasm/jcod, verifier, JIT. 40

41 The Goal? The ideal reflective API: Corresponds to the language, structurally and temporally Respects encapsulation and stratification Supports introspection, selfmodification and intercession Are these goals mutually consistent? 41

42 Related Work Self Strongtalk JDI Wirfs-Brock/Smalltalk Firewall MOP Class loaders Templ/Oberon MetaBeta, Yggdrasil 42

Dart. Gilad Bracha for the Dart Team

Dart. Gilad Bracha for the Dart Team Dart Gilad Bracha for the Dart Team Part I: Overview Why Dart? We want to improve the state of the art of Web Programming Web Programming Web Programming has huge Advantages: 1. Zero-install 2. Automatic

More information

The Art of Metaprogramming in Java. Falguni Vyas Dec 08, 2012

The Art of Metaprogramming in Java. Falguni Vyas Dec 08, 2012 The Art of Metaprogramming in Java Falguni Vyas Dec 08, 2012 Metadata What is Metadata? Data that describes other data Defined as data providing information about one or more aspects of the data, such

More information

New Programming Paradigms

New Programming Paradigms New Programming Paradigms Lecturer: Pánovics János (google the name for further details) Requirements: For signature: classroom work and a 15-minute presentation Exam: written exam (mainly concepts and

More information

CSCE 314 TAMU Fall CSCE 314: Programming Languages Dr. Flemming Andersen. Java Reflection

CSCE 314 TAMU Fall CSCE 314: Programming Languages Dr. Flemming Andersen. Java Reflection CSCE 314 TAMU Fall 2017 1 CSCE 314: Programming Languages Dr. Flemming Andersen Java Reflection CSCE 314 TAMU Fall 2017 Reflection and Metaprogramming Metaprogramming: Writing (meta)programs that represent

More information

Towards Secure Systems Programming Languages. Gilad Bracha

Towards Secure Systems Programming Languages. Gilad Bracha Towards Secure Systems Programming Languages Gilad Bracha Convergence: Viruses, Worms and Terrorists Mainstream Operating Systems are insecure Cyber-Pearl harbor is only a matter of time Expect every Windows

More information

CSCE 314 Programming Languages

CSCE 314 Programming Languages CSCE 314 Programming Languages! Reflection Dr. Hyunyoung Lee! 1 Reflection and Metaprogramming Metaprogramming: Writing (meta)programs that represent and manipulate other programs Reflection: Writing (meta)programs

More information

Compilation I. Hwansoo Han

Compilation I. Hwansoo Han Compilation I Hwansoo Han Language Groups Imperative von Neumann (Fortran, Pascal, Basic, C) Object-oriented (Smalltalk, Eiffel, C++) Scripting languages (Perl, Python, JavaScript, PHP) Declarative Functional

More information

Notes of the course - Advanced Programming. Barbara Russo

Notes of the course - Advanced Programming. Barbara Russo Notes of the course - Advanced Programming Barbara Russo a.y. 2014-2015 Contents 1 Lecture 2 Lecture 2 - Compilation, Interpreting, and debugging........ 2 1.1 Compiling and interpreting...................

More information

CSE P 501 Compilers. Java Implementation JVMs, JITs &c Hal Perkins Winter /11/ Hal Perkins & UW CSE V-1

CSE P 501 Compilers. Java Implementation JVMs, JITs &c Hal Perkins Winter /11/ Hal Perkins & UW CSE V-1 CSE P 501 Compilers Java Implementation JVMs, JITs &c Hal Perkins Winter 2008 3/11/2008 2002-08 Hal Perkins & UW CSE V-1 Agenda Java virtual machine architecture.class files Class loading Execution engines

More information

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview Introduction to Visual Basic and Visual C++ Introduction to Java Lesson 13 Overview I154-1-A A @ Peter Lo 2010 1 I154-1-A A @ Peter Lo 2010 2 Overview JDK Editions Before you can write and run the simple

More information

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1 Agenda CSE P 501 Compilers Java Implementation JVMs, JITs &c Hal Perkins Summer 2004 Java virtual machine architecture.class files Class loading Execution engines Interpreters & JITs various strategies

More information

<Insert Picture Here> Multi-language JDI? You're Joking, Right?

<Insert Picture Here> Multi-language JDI? You're Joking, Right? Multi-language JDI? You're Joking, Right? Jim Laskey Multi-language Lead Java Language and Tools Group The following is intended to outline our general product direction. It is intended

More information

Why are there so many programming languages? Why do we have programming languages? What is a language for? What makes a language successful?

Why are there so many programming languages? Why do we have programming languages? What is a language for? What makes a language successful? Chapter 1 :: Introduction Introduction Programming Language Pragmatics Michael L. Scott Why are there so many programming languages? evolution -- we've learned better ways of doing things over time socio-economic

More information

Java reflection. alberto ferrari university of parma

Java reflection. alberto ferrari university of parma Java reflection alberto ferrari university of parma reflection metaprogramming is a programming technique in which computer programs have the ability to treat programs as their data a program can be designed

More information

Metamodelling & Metaprogramming. Lena Buffoni

Metamodelling & Metaprogramming. Lena Buffoni Metamodelling & Metaprogramming Lena Buffoni lena.buffoni@liu.se What is a model? A representation of a concept, phenomenon, relationship, structure, system from the real world Used to communicate, test

More information

Lecture 9 : Basics of Reflection in Java

Lecture 9 : Basics of Reflection in Java Lecture 9 : Basics of Reflection in Java LSINF 2335 Programming Paradigms Prof. Kim Mens UCL / EPL / INGI (Slides partly based on the book Java Reflection in Action, on The Java Tutorials, and on slides

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

COP4020 Programming Languages. Compilers and Interpreters Robert van Engelen & Chris Lacher

COP4020 Programming Languages. Compilers and Interpreters Robert van Engelen & Chris Lacher COP4020 ming Languages Compilers and Interpreters Robert van Engelen & Chris Lacher Overview Common compiler and interpreter configurations Virtual machines Integrated development environments Compiler

More information

Blackboard MVC Reflection. Lecture 8

Blackboard MVC Reflection. Lecture 8 Blackboard MVC Reflection Lecture 8 Blackboard Pattern Operative Metaphor: Patient Chart in an ICU Operative Image: MIT Math Session in the movie Good Will Hunting (aka Repository Systems) Penny Nii Quote

More information

interface MyAnno interface str( ) val( )

interface MyAnno interface str( ) val( ) Unit 4 Annotations: basics of annotation-the Annotated element Interface. Using Default Values, Marker Annotations. Single-Member Annotations. The Built-In Annotations-Some Restrictions. 1 annotation Since

More information

More About Objects. Zheng-Liang Lu Java Programming 255 / 282

More About Objects. Zheng-Liang Lu Java Programming 255 / 282 More About Objects Inheritance: passing down states and behaviors from the parents to their children. Interfaces: requiring objects for the demanding methods which are exposed to the outside world. Polymorphism

More information

Introduction to Programming (Java) 2/12

Introduction to Programming (Java) 2/12 Introduction to Programming (Java) 2/12 Michal Krátký Department of Computer Science Technical University of Ostrava Introduction to Programming (Java) 2008/2009 c 2006 2008 Michal Krátký Introduction

More information

Combined Object-Lambda Architectures

Combined Object-Lambda Architectures www.jquigley.com jquigley#jquigley.com Chicago Lisp April 2008 Research Goals System Goals Conventional Systems Unconventional Systems Research Goals Question: How to make with Pepsi and Coke? The Goal:

More information

OracleAS 10g R3: Java Programming

OracleAS 10g R3: Java Programming OracleAS 10g R3: Java Programming Volume I Student Guide D18382GC20 Edition 2.0 April 2007 D50171 Authors Patrice Daux Kate Heap Technical Contributors and Reviewers Ken Cooper C Fuller Vasily Strelnikov

More information

1. Introduction to the Common Language Infrastructure

1. Introduction to the Common Language Infrastructure Miller-CHP1.fm Page 1 Wednesday, September 24, 2003 1:50 PM to the Common Language Infrastructure The Common Language Infrastructure (CLI) is an International Standard that is the basis for creating execution

More information

CS252 Advanced Programming Language Principles. Prof. Tom Austin San José State University Fall 2013

CS252 Advanced Programming Language Principles. Prof. Tom Austin San José State University Fall 2013 CS252 Advanced Programming Language Principles Prof. Tom Austin San José State University Fall 2013 What are some programming languages? Why are there so many? Different domains Mobile devices (Objective

More information

Metamodeling and Metaprogramming Seminar

Metamodeling and Metaprogramming Seminar Metamodeling and Metaprogramming Seminar 1. Introduction Prof. O. Nierstrasz Spring Semester 2008 Metamodeling and Metaprogramming Seminar Lecturer: Assistant: WWW: Oscar Nierstrasz www.iam.unibe.ch/~oscar

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

JIVE: Dynamic Analysis for Java

JIVE: Dynamic Analysis for Java JIVE: Dynamic Analysis for Java Overview, Architecture, and Implementation Demian Lessa Computer Science and Engineering State University of New York, Buffalo Dec. 01, 2010 Outline 1 Overview 2 Architecture

More information

9/5/17. The Design and Implementation of Programming Languages. Compilation. Interpretation. Compilation vs. Interpretation. Hybrid Implementation

9/5/17. The Design and Implementation of Programming Languages. Compilation. Interpretation. Compilation vs. Interpretation. Hybrid Implementation Language Implementation Methods The Design and Implementation of Programming Languages Compilation Interpretation Hybrid In Text: Chapter 1 2 Compilation Interpretation Translate high-level programs to

More information

Multi-Level Virtual Machine Debugging using the Java Platform Debugger Architecture

Multi-Level Virtual Machine Debugging using the Java Platform Debugger Architecture Multi-Level Virtual Machine Debugging using the Java Platform Debugger Architecture Thomas Würthinger 1, Michael L. Van De Vanter 2, and Doug Simon 2 1 Institute for System Software Johannes Kepler University

More information

EMBEDDED SYSTEMS PROGRAMMING More About Languages

EMBEDDED SYSTEMS PROGRAMMING More About Languages EMBEDDED SYSTEMS PROGRAMMING 2015-16 More About Languages JAVA: ANNOTATIONS (1/2) Structured comments to source code (=metadata). They provide data about the code, but they are not part of the code itself

More information

Chapter 10 :: Data Abstraction and Object Orientation

Chapter 10 :: Data Abstraction and Object Orientation Chapter 10 :: Data Abstraction and Object Orientation Programming Language Pragmatics, Fourth Edition Michael L. Scott Copyright 2016 Elsevier Chapter10_Data_Abstraction_and_Object_Orientation_4e 1 Object-Oriented

More information

Remote Debugging and Reflection in Resource Constrained Devices. Nikolaos Papoulias - December 2013

Remote Debugging and Reflection in Resource Constrained Devices. Nikolaos Papoulias - December 2013 Remote Debugging and Reflection in Resource Constrained Devices Nikolaos Papoulias - December 2013! 1 Outline Introduction Related Work Contributions Implementation Validation Conclusion & Future Work

More information

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content Core Java - SCJP Course content NOTE: For exam objectives refer to the SCJP 1.6 objectives. 1. Declarations and Access Control Java Refresher Identifiers & JavaBeans Legal Identifiers. Sun's Java Code

More information

Towards a dynamic object model within Unix processes

Towards a dynamic object model within Unix processes Towards a dynamic object model within Unix processes Stephen Kell stephen.kell@cl.cam.ac.uk Computer Laboratory University of Cambridge p.1 p.2 Fragmentation by VM photo: AngMoKio p.3 p.4 Language VMs

More information

CSc 372. Comparative Programming Languages. 2 : Functional Programming. Department of Computer Science University of Arizona

CSc 372. Comparative Programming Languages. 2 : Functional Programming. Department of Computer Science University of Arizona 1/37 CSc 372 Comparative Programming Languages 2 : Functional Programming Department of Computer Science University of Arizona collberg@gmail.com Copyright c 2013 Christian Collberg 2/37 Programming Paradigms

More information

PINOCCHIO: Bringing Reflection to Life with First-Class Interpreters

PINOCCHIO: Bringing Reflection to Life with First-Class Interpreters PINOCCHIO: Bringing Reflection to Life with First-Class Interpreters Toon Verwaest Camillo Bruni David Gurtner Adrian Lienhard Oscar Nierstrasz Software Composition Group, University of Bern, Switzerland

More information

Program Transformation with Reflective and Aspect-Oriented Programming

Program Transformation with Reflective and Aspect-Oriented Programming Program Transformation with Reflective and Aspect-Oriented Programming Shigeru Chiba Dept. of Mathematical and Computing Sciences Tokyo Institute of Technology, Japan Abstract. A meta-programming technique

More information

Crafting a Compiler with C (II) Compiler V. S. Interpreter

Crafting a Compiler with C (II) Compiler V. S. Interpreter Crafting a Compiler with C (II) 資科系 林偉川 Compiler V S Interpreter Compilation - Translate high-level program to machine code Lexical Analyzer, Syntax Analyzer, Intermediate code generator(semantics Analyzer),

More information

Chapter 9 :: Data Abstraction and Object Orientation

Chapter 9 :: Data Abstraction and Object Orientation Chapter 9 :: Data Abstraction and Object Orientation Programming Language Pragmatics Michael L. Scott Control or PROCESS abstraction is a very old idea (subroutines!), though few languages provide it in

More information

FlexiNet. A flexible component oriented middleware system. Introduction. Architecting for Components. Richard Hayton, Andrew Herbert. APM Ltd.

FlexiNet. A flexible component oriented middleware system. Introduction. Architecting for Components. Richard Hayton, Andrew Herbert. APM Ltd. FlexiNet flexible component oriented middleware system Richard Hayton, ndrew Herbert. P Ltd. Introduction Generally, research middleware platforms have provided application programmers with facilities

More information

Compiling and Interpreting Programming. Overview of Compilers and Interpreters

Compiling and Interpreting Programming. Overview of Compilers and Interpreters Copyright R.A. van Engelen, FSU Department of Computer Science, 2000 Overview of Compilers and Interpreters Common compiler and interpreter configurations Virtual machines Integrated programming environments

More information

CO Java SE 8: Fundamentals

CO Java SE 8: Fundamentals CO-83527 Java SE 8: Fundamentals Summary Duration 5 Days Audience Application Developer, Developer, Project Manager, Systems Administrator, Technical Administrator, Technical Consultant and Web Administrator

More information

The Procedure Abstraction

The Procedure Abstraction The Procedure Abstraction Procedure Abstraction Begins Chapter 6 in EAC The compiler must deal with interface between compile time and run time Most of the tricky issues arise in implementing procedures

More information

https://asd-pa.perfplusk12.com/admin/admin_curric_maps_display.aspx?m=5507&c=618&mo=18917&t=191&sy=2012&bl...

https://asd-pa.perfplusk12.com/admin/admin_curric_maps_display.aspx?m=5507&c=618&mo=18917&t=191&sy=2012&bl... Page 1 of 13 Units: - All - Teacher: ProgIIIJavaI, CORE Course: ProgIIIJavaI Year: 2012-13 Intro to Java How is data stored by a computer system? What does a compiler do? What are the advantages of using

More information

Why are there so many programming languages?

Why are there so many programming languages? Chapter 1 :: Introduction Programming Language Pragmatics, Fourth Edition Michael L. Scott Copyright 2016 Elsevier 1 Chapter01_ Introduction_4e - Tue November 21, 2017 Introduction Why are there so many

More information

Stream. Two types of streams are provided by Java Byte and Character. Predefined Streams

Stream. Two types of streams are provided by Java Byte and Character. Predefined Streams Stream Stream is a sequence of bytes that travel from the source to destination over a communication path. For example, source might be network, destination might be a file on the file system. We may want

More information

Reflection (in fact, Java introspection)

Reflection (in fact, Java introspection) Reflection (in fact, Java introspection) Prof. Dr. Ralf Lämmel Universität Koblenz-Landau Software Languages Team Elevator speech So programs are programs and data is data. However, programs can be represented

More information

COP 3330 Final Exam Review

COP 3330 Final Exam Review COP 3330 Final Exam Review I. The Basics (Chapters 2, 5, 6) a. comments b. identifiers, reserved words c. white space d. compilers vs. interpreters e. syntax, semantics f. errors i. syntax ii. run-time

More information

Design issues for objectoriented. languages. Objects-only "pure" language vs mixed. Are subclasses subtypes of the superclass?

Design issues for objectoriented. languages. Objects-only pure language vs mixed. Are subclasses subtypes of the superclass? Encapsulation Encapsulation grouping of subprograms and the data they manipulate Information hiding abstract data types type definition is hidden from the user variables of the type can be declared variables

More information

JOVE. An Optimizing Compiler for Java. Allen Wirfs-Brock Instantiations Inc.

JOVE. An Optimizing Compiler for Java. Allen Wirfs-Brock Instantiations Inc. An Optimizing Compiler for Java Allen Wirfs-Brock Instantiations Inc. Object-Orient Languages Provide a Breakthrough in Programmer Productivity Reusable software components Higher level abstractions Yield

More information

Goals of design. satisfies problem requirements, usable error free, resistant to incorrect input. readable, not purposefully cryptic.

Goals of design. satisfies problem requirements, usable error free, resistant to incorrect input. readable, not purposefully cryptic. OOP design revisited design revisited 1 Goals of design usable software robust implementable understandable reusable generalizable extendable solves the problem, satisfies problem requirements, usable

More information

Chapter 3:: Names, Scopes, and Bindings (cont.)

Chapter 3:: Names, Scopes, and Bindings (cont.) Chapter 3:: Names, Scopes, and Bindings (cont.) Programming Language Pragmatics Michael L. Scott Review What is a regular expression? What is a context-free grammar? What is BNF? What is a derivation?

More information

Parley: Federated Virtual Machines

Parley: Federated Virtual Machines 1 IBM Research Parley: Federated Virtual Machines Perry Cheng, Dave Grove, Martin Hirzel, Rob O Callahan and Nikhil Swamy VEE Workshop September 2004 2002 IBM Corporation What is Parley? Motivation Virtual

More information

Shigeru Chiba Michiaki Tatsubori. University of Tsukuba. The Java language already has the ability for reection [2, 4]. java.lang.

Shigeru Chiba Michiaki Tatsubori. University of Tsukuba. The Java language already has the ability for reection [2, 4]. java.lang. A Yet Another java.lang.class Shigeru Chiba Michiaki Tatsubori Institute of Information Science and Electronics University of Tsukuba 1-1-1 Tennodai, Tsukuba, Ibaraki 305-8573, Japan. Phone: +81-298-53-5349

More information

Certification In Java Language Course Course Content

Certification In Java Language Course Course Content Introduction Of Java * What Is Java? * How To Get Java * A First Java Program * Compiling And Interpreting Applications * The JDK Directory Structure Certification In Java Language Course Course Content

More information

Early computers (1940s) cost millions of dollars and were programmed in machine language. less error-prone method needed

Early computers (1940s) cost millions of dollars and were programmed in machine language. less error-prone method needed Chapter 1 :: Programming Language Pragmatics Michael L. Scott Early computers (1940s) cost millions of dollars and were programmed in machine language machine s time more valuable than programmer s machine

More information

metaxa and the Future of Reflection

metaxa and the Future of Reflection metaxa and the Future of Reflection Michael Golm, Jürgen Kleinöder University of Erlangen-Nürnberg Dept. of Computer Science 4 (Operating Systems) Martensstr. 1, D-91058 Erlangen, Germany {golm, kleinoeder}@informatik.uni-erlangen.de

More information

Lecture 5: Methods CS2301

Lecture 5: Methods CS2301 Lecture 5: Methods NADA ALZAHRANI CS2301 1 Opening Problem Find the sum of integers from 1 to 10, from 20 to 30, and from 35 to 45, respectively. 2 Solution public static int sum(int i1, int i2) { int

More information

What do Compilers Produce?

What do Compilers Produce? What do Compilers Produce? Pure Machine Code Compilers may generate code for a particular machine, not assuming any operating system or library routines. This is pure code because it includes nothing beyond

More information

Programming Language Concepts: Lecture 10

Programming Language Concepts: Lecture 10 Programming Language Concepts: Lecture 10 Madhavan Mukund Chennai Mathematical Institute madhavan@cmi.ac.in http://www.cmi.ac.in/~madhavan/courses/pl2009 PLC 2009, Lecture 10, 16 February 2009 Reflection

More information

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline ::

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline :: Module Title Duration : Intro to JAVA SE7 and Programming using JAVA SE7 : 9 days Course Description The Java SE 7 Fundamentals course was designed to enable students with little or no programming experience

More information

Dynamic Object-Oriented Programming with Smalltalk 1. Introduction

Dynamic Object-Oriented Programming with Smalltalk 1. Introduction Dynamic Object-Oriented Programming with Smalltalk 1. Introduction Prof. O. Nierstrasz Autumn Semester 2009 LECTURE TITLE What is surprising about Smalltalk > Everything is an object > Everything happens

More information

SOFTWARE ARCHITECTURE 7. JAVA VIRTUAL MACHINE

SOFTWARE ARCHITECTURE 7. JAVA VIRTUAL MACHINE 1 SOFTWARE ARCHITECTURE 7. JAVA VIRTUAL MACHINE Tatsuya Hagino hagino@sfc.keio.ac.jp slides URL https://vu5.sfc.keio.ac.jp/sa/ Java Programming Language Java Introduced in 1995 Object-oriented programming

More information

COMPILER DESIGN. For COMPUTER SCIENCE

COMPILER DESIGN. For COMPUTER SCIENCE COMPILER DESIGN For COMPUTER SCIENCE . COMPILER DESIGN SYLLABUS Lexical analysis, parsing, syntax-directed translation. Runtime environments. Intermediate code generation. ANALYSIS OF GATE PAPERS Exam

More information

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG) SKILL AREA 304: Review Programming Language Concept Computer Programming (YPG) 304.1 Demonstrate an Understanding of Basic of Programming Language 304.1.1 Explain the purpose of computer program 304.1.2

More information

An Introduction to Patterns

An Introduction to Patterns An Introduction to Patterns Robert B. France Colorado State University Robert B. France 1 What is a Pattern? - 1 Work on software development patterns stemmed from work on patterns from building architecture

More information

Why Study Assembly Language?

Why Study Assembly Language? Why Study Assembly Language? This depends on the decade in which you studied assembly language. 1940 s You cannot study assembly language. It does not exist yet. 1950 s You study assembly language because,

More information

CSE 307: Principles of Programming Languages

CSE 307: Principles of Programming Languages CSE 307: Principles of Programming Languages Classes and Inheritance R. Sekar 1 / 52 Topics 1. OOP Introduction 2. Type & Subtype 3. Inheritance 4. Overloading and Overriding 2 / 52 Section 1 OOP Introduction

More information

BCS THE CHARTERED INSTITUTE FOR IT. BCS Higher Education Qualifications BCS Level 6 Professional Graduate Diploma in IT EXAMINERS' REPORT

BCS THE CHARTERED INSTITUTE FOR IT. BCS Higher Education Qualifications BCS Level 6 Professional Graduate Diploma in IT EXAMINERS' REPORT BCS THE CHARTERED INSTITUTE FOR IT BCS Higher Education Qualifications BCS Level 6 Professional Graduate Diploma in IT March 2015 EXAMINERS' REPORT Programming Paradigms General comments on candidates'

More information

Discover how to get up and running with the Java Development Environment and with the Eclipse IDE to create Java programs.

Discover how to get up and running with the Java Development Environment and with the Eclipse IDE to create Java programs. Java SE11 Development Java is the most widely-used development language in the world today. It allows programmers to create objects that can interact with other objects to solve a problem. Explore Java

More information

xtc Robert Grimm Making C Safely Extensible New York University

xtc Robert Grimm Making C Safely Extensible New York University xtc Making C Safely Extensible Robert Grimm New York University The Problem Complexity of modern systems is staggering Increasingly, a seamless, global computing environment System builders continue to

More information

Advanced Programming & C++ Language

Advanced Programming & C++ Language Advanced Programming & C++ Language ~6~ Introduction to Memory Management Ariel University 2018 Dr. Miri (Kopel) Ben-Nissan Stack & Heap 2 The memory a program uses is typically divided into four different

More information

Contents. I. Classes, Superclasses, and Subclasses. Topic 04 - Inheritance

Contents. I. Classes, Superclasses, and Subclasses. Topic 04 - Inheritance Contents Topic 04 - Inheritance I. Classes, Superclasses, and Subclasses - Inheritance Hierarchies Controlling Access to Members (public, no modifier, private, protected) Calling constructors of superclass

More information

COMP6700/2140 Methods

COMP6700/2140 Methods COMP6700/2140 Methods Alexei B Khorev and Josh Milthorpe Research School of Computer Science, ANU 9 March 2017 Alexei B Khorev and Josh Milthorpe (RSCS, ANU) COMP6700/2140 Methods 9 March 2017 1 / 19 Methods

More information

Chapter 3:: Names, Scopes, and Bindings (cont.)

Chapter 3:: Names, Scopes, and Bindings (cont.) Chapter 3:: Names, Scopes, and Bindings (cont.) Programming Language Pragmatics Michael L. Scott Review What is a regular expression? What is a context-free grammar? What is BNF? What is a derivation?

More information

Eclipse as a Web 2.0 Application Position Paper

Eclipse as a Web 2.0 Application Position Paper Eclipse Summit Europe Server-side Eclipse 11 12 October 2006 Eclipse as a Web 2.0 Application Position Paper Automatic Web 2.0 - enabling of any RCP-application with Xplosion Introduction If todays Web

More information

Compiler Design Spring 2018

Compiler Design Spring 2018 Compiler Design Spring 2018 Thomas R. Gross Computer Science Department ETH Zurich, Switzerland 1 Logistics Lecture Tuesdays: 10:15 11:55 Thursdays: 10:15 -- 11:55 In ETF E1 Recitation Announced later

More information

Operating- System Structures

Operating- System Structures Operating- System Structures 2 CHAPTER Practice Exercises 2.1 What is the purpose of system calls? Answer: System calls allow user-level processes to request services of the operating system. 2.2 What

More information

Lecture 2 summary of Java SE section 1

Lecture 2 summary of Java SE section 1 Lecture 2 summary of Java SE section 1 presentation DAD Distributed Applications Development Cristian Toma D.I.C.E/D.E.I.C Department of Economic Informatics & Cybernetics www.dice.ase.ro Cristian Toma

More information

Chair of Software Engineering. Java and C# in depth. Carlo A. Furia, Marco Piccioni, Bertrand Meyer. Java: reflection

Chair of Software Engineering. Java and C# in depth. Carlo A. Furia, Marco Piccioni, Bertrand Meyer. Java: reflection Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Java: reflection Outline Introductory detour: quines Basic reflection Built-in features Introspection Reflective method invocation

More information

Concepts of Programming Languages

Concepts of Programming Languages Concepts of Programming Languages Lecture 1 - Introduction Patrick Donnelly Montana State University Spring 2014 Patrick Donnelly (Montana State University) Concepts of Programming Languages Spring 2014

More information

CSE 504: Compiler Design. Runtime Environments

CSE 504: Compiler Design. Runtime Environments Runtime Environments Pradipta De pradipta.de@sunykorea.ac.kr Current Topic Procedure Abstractions Mechanisms to manage procedures and procedure calls from compiler s perspective Runtime Environment Choices

More information

General Concepts. Abstraction Computational Paradigms Implementation Application Domains Influence on Success Influences on Design

General Concepts. Abstraction Computational Paradigms Implementation Application Domains Influence on Success Influences on Design General Concepts Abstraction Computational Paradigms Implementation Application Domains Influence on Success Influences on Design 1 Abstractions in Programming Languages Abstractions hide details that

More information

Object- Oriented Design with UML and Java Part I: Fundamentals

Object- Oriented Design with UML and Java Part I: Fundamentals Object- Oriented Design with UML and Java Part I: Fundamentals University of Colorado 1999-2002 CSCI-4448 - Object-Oriented Programming and Design These notes as free PDF files: http://www.softwarefederation.com/cs4448.html

More information

Seminar report Java Submitted in partial fulfillment of the requirement for the award of degree Of CSE

Seminar report Java Submitted in partial fulfillment of the requirement for the award of degree Of CSE A Seminar report On Java Submitted in partial fulfillment of the requirement for the award of degree Of CSE SUBMITTED TO: www.studymafia.org SUBMITTED BY: www.studymafia.org 1 Acknowledgement I would like

More information

Cross-compiling C++ to JavaScript. Challenges in porting the join.me common library to HTML5

Cross-compiling C++ to JavaScript. Challenges in porting the join.me common library to HTML5 Cross-compiling C++ to JavaScript Challenges in porting the join.me common library to HTML5 JUNE 24, 2015 LEVENTE HUNYADI join.me at a glance 2 join.me at a glance 3 join.me characteristics Application

More information

Introduction to Embedded Systems. Lab Logistics

Introduction to Embedded Systems. Lab Logistics Introduction to Embedded Systems CS/ECE 6780/5780 Al Davis Today s topics: lab logistics interrupt synchronization reentrant code 1 CS 5780 Lab Logistics Lab2 Status Wed: 3/11 teams have completed their

More information

Mirror-based Reflection in AmbientTalk

Mirror-based Reflection in AmbientTalk SOFTWARE PRACTICE AND EXPERIENCE Softw. Pract. Exper. 2008; 0:01 37 [Version: 2002/09/23 v2.2] Mirror-based Reflection in AmbientTalk Stijn Mostinckx 1, Tom Van Cutsem 1, Stijn Timbermont 1, Elisa Gonzalez

More information

CSE P 501 Compilers. Static Semantics Hal Perkins Winter /22/ Hal Perkins & UW CSE I-1

CSE P 501 Compilers. Static Semantics Hal Perkins Winter /22/ Hal Perkins & UW CSE I-1 CSE P 501 Compilers Static Semantics Hal Perkins Winter 2008 1/22/2008 2002-08 Hal Perkins & UW CSE I-1 Agenda Static semantics Types Attribute grammars Representing types Symbol tables Note: this covers

More information

CMSC 430 Introduction to Compilers. Fall Language Virtual Machines

CMSC 430 Introduction to Compilers. Fall Language Virtual Machines CMSC 430 Introduction to Compilers Fall 2018 Language Virtual Machines Introduction So far, we ve focused on the compiler front end Syntax (lexing/parsing) High-level language semantics Ultimately, we

More information

Appendix A - Glossary(of OO software term s)

Appendix A - Glossary(of OO software term s) Appendix A - Glossary(of OO software term s) Abstract Class A class that does not supply an implementation for its entire interface, and so consequently, cannot be instantiated. ActiveX Microsoft s component

More information

Programming Paradigms

Programming Paradigms PP 2017/18 Unit 18 Summary of Basic Concepts 1/13 Programming Paradigms Unit 18 Summary of Basic Concepts J. Gamper Free University of Bozen-Bolzano Faculty of Computer Science IDSE PP 2017/18 Unit 18

More information

Chapter 3: Operating-System Structures

Chapter 3: Operating-System Structures Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System Design and Implementation System Generation 3.1

More information

Some instance messages and methods

Some instance messages and methods Some instance messages and methods x ^x y ^y movedx: dx Dy: dy x

More information

Language Translation. Compilation vs. interpretation. Compilation diagram. Step 1: compile. Step 2: run. compiler. Compiled program. program.

Language Translation. Compilation vs. interpretation. Compilation diagram. Step 1: compile. Step 2: run. compiler. Compiled program. program. Language Translation Compilation vs. interpretation Compilation diagram Step 1: compile program compiler Compiled program Step 2: run input Compiled program output Language Translation compilation is translation

More information

The Java Programming Language

The Java Programming Language The Java Programming Language Slide by John Mitchell (http://www.stanford.edu/class/cs242/slides/) Outline Language Overview History and design goals Classes and Inheritance Object features Encapsulation

More information

Evaluation Guide for ASP.NET Web CMS and Experience Platforms

Evaluation Guide for ASP.NET Web CMS and Experience Platforms Evaluation Guide for ASP.NET Web CMS and Experience Platforms CONTENTS Introduction....................... 1 4 Key Differences...2 Architecture:...2 Development Model...3 Content:...4 Database:...4 Bonus:

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecture 14: Design Workflow Department of Computer Engineering Sharif University of Technology 1 UP iterations and workflow Workflows Requirements Analysis Phases Inception Elaboration

More information