University of British Columbia Software Practices Lab Expressive Programs Through Presentation Extension Andrew D. Eisenberg and Gregor Kiczales.

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

University of British Columbia Software Practices Lab Experiences Building Research Tools Andrew Eisenberg & Terry Hon.
Programming Paradigms and languages
Chapter 1: Computer Systems
University of British Columbia Software Practices Lab Fluid AOP Join Point Models Terry Hon Gregor Kiczales.
1 The JQuery Tool A Generic Query-Based Code browser for Eclipse Project leaders: Kris De Volder, Gregor Kiczales Students: Doug Janzen, Rajeswari Rajagopalan,
Software Practices Lab. -- The University of British Columbia 1 The JQuery Tool A Generic Query-Based Code browser for Eclipse Project leaders: Kris De.
University of British Columbia Software Practices Lab 2005 CASCON A Fluid AOP Editor Terry Hon Gregor Kiczales.
The Java Programming Language
University of British Columbia Software Practices Lab CAS Seminar 06 Fluid AJ - A Simple Fluid AOP Tool Terry Hon Gregor Kiczales.
Outline Java program structure Basic program elements
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
) y + 1 * => square ( January 31, 2005MacrosClaus Brabrand y + 1 Widespread … ……… … ……... Dylan Dylan Macro Mechamism M4 Unix Macro Preprocessor L A T.
Programming Languages Structure
University of British Columbia Software Practices Lab Presentation Techniques for more Expressive Programs Andrew Eisenberg PhD Oral Defense.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Building An Interpreter After having done all of the analysis, it’s possible to run the program directly rather than compile it … and it may be worth it.
The Basic Tools Presented by: Robert E., & Jonathan Chase.
1 Designing an XML-based Exchange Format for Harmonia Marat Boshernitsan Susan L. Graham University of California, Berkeley, USA Exchange Formats Workshop.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
ANTLR.
Prepared by Uzma Hashmi Instructor Information Uzma Hashmi Office: B# 7/ R# address: Group Addresses Post message:
CS 355 – Programming Languages
1 Identifiers  Identifiers are the words a programmer uses in a program  An identifier can be made up of letters, digits, the underscore character (
© 2006 Pearson Education Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science A 2nd Edition.
Java: Chapter 1 Computer Systems Computer Programming II.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
Tools for Diagrammatic Specifications Stian Skjerveggen Supervisors: Yngve Lamo, Adrian Rutle, Uwe Egbert Wolter.
ECE 452 / CS 446 / SE464 Design Patterns: Part 2 - Answers A Tutorial By Peter Kim Partially based on the tutorial by Michał Antkiewicz.
© 2006 Pearson Education 1 Obj: cont 1.3 and 1.4, to become familiar with identifiers and to understand how programming languages work HW: p.51 #1.8 –
Graph Visualization Plug-in for Eclipse Gong Jun CCIS Northeastern Univ 10/2003 How To Finish your Project within Four Weeks.
1 Beyond Annotations: A Proposal for Extensible Java (XJ) Tony Clark, Thames Valley University Paul Sammut, HSBC James Willans, Ceteva
The Java Programming Language
Reviewing Recent ICSE Proceedings For:.  Defining and Continuous Checking of Structural Program Dependencies  Automatic Inference of Structural Changes.
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
CST320 - Lec 11 Why study compilers? n n Ties lots of things you know together: –Theory (finite automata, grammars) –Data structures –Modularization –Utilization.
Intro and Review Welcome to Java. Introduction Java application programming Use tools from the JDK to compile and run programs. Videos at
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
Parse & Syntax Trees Syntax & Semantic Errors Mini-Lecture.
Compressed Abstract Syntax Trees as Mobile Code Christian H. Stork Vivek Haldar University of California, Irvine.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Introduction to Compilers. Related Area Programming languages Machine architecture Language theory Algorithms Data structures Operating systems Software.
Overview of Previous Lesson(s) Over View  A program must be translated into a form in which it can be executed by a computer.  The software systems.
Contextual Analysis (Chapter 5) 1 Course Overview PART I: overview material 1Introduction 2Language processors (tombstone diagrams, bootstrapping) 3Architecture.
Celluloid An interactive media sequencing language.
Weaving a Debugging Aspect into Domain-Specific Language Grammars SAC ’05 PSC Track Santa Fe, New Mexico USA March 17, 2005 Hui Wu, Jeff Gray, Marjan Mernik,
Programming Languages
1 JTransformer Framework Tobias Windeln Institut für Informatik III Rheinische Friedrich-Wilhelms-Universität Bonn.
Trip Report: DSL ‘97 October 15-17, 1997 Santa Barbara CA.
Alloy-based Lightweight Verification for Aspect-oriented Architecture Naoyasu Ubayashi(Kyushu Institute of Technology) Yuki Sato(Kyushu Institute of Technology)
The Spoofax Language Workbench Rules for Declarative specification of language and IDEs Lennart C. L. Kats and Eelco Visser Delft University of Technology.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
Dr. Mohamed Ramadan Saady 314ALL CH1.1 Chapter 1: Introduction to Compiling.
Language Implementation Overview John Keyser Spring 2016.
Chapter – 8 Software Tools.
FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
1 Budapest University of Technology and Economics Department of Measurement and Information Systems Budapest University of Technology and Economics Fault.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 1: Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science.
Programming Languages Concepts Chapter 1: Programming Languages Concepts Lecture # 4.
1 Problem Solving  The purpose of writing a program is to solve a problem  The general steps in problem solving are: Understand the problem Dissect the.
Concepts of Programming Languages Lecturer: Dr. Emad Nabil Lecture # 2.
Software Engineering Lecture 7
Working with Java.
PROGRAMMING LANGUAGES
Introduction to Java Programming
Chapter 1: Computer Systems
Focus of the Course Object-Oriented Software Development
Presentation transcript:

University of British Columbia Software Practices Lab Expressive Programs Through Presentation Extension Andrew D. Eisenberg and Gregor Kiczales

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 2 Code that Looks Like the Design

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 3 Code that Looks Like the Design

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 4 Familiar goals, many approaches – Languages abstraction level, domain specificity, extensibility… – Editors language aware, highlighting, formatting… Contributions – New editor/compiler architecture synergistic presentation and semantic extensibility compatible with existing code, tools, practice – Eclipse-based implementation – Examples how light-touch uses of idea can be powerful Code that Looks Like the Design

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 5 Desirable Properties Extensibility –presentation more than colors, fonts—substantial difference from concrete syntax free-form editing –semantic like syntax macros –(abstract syntax graph, not tree) Compatibility –with existing code, tools –incremental adoption Traceability –of errors –for other tools

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 6 Tool chains Raw Text (Byte) Code Other Tools Display/ Edit Compiler/ Interpreter Editor Gnu/Linux Language extensibility code formatting (colors, bold, italics, etc) text pre-processors Communication is line number and character-based

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 7 semantic extensibility Syntax Macros AST Expanded AST Other Tools Display/ Edit Lisp/Scheme Raw Text (Byte) Code Language extensibility code formatting macros Communication is line number and character-based

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 8 (Byte) Code Expanded AST Structure (Syntax-Directed) Editors AST Interlisp Cornell Program Synthesizer Other Tools Display/ Edit Raw Text Language extensibility code formatting pretty-printing (line breaks, white space, etc) macros Communication between display and byte code can be AST-based semantic extensibility

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 9 State of the Practice IDEs AST easy to create from raw text cheap, reliable, and fast incremental simultaneous maintenance of raw text & AST Communication is line-number or AST-based Restricted extensibility Eclipse, IntelliJ, Visual Studio, … Other Tools AST Display/ Edit Raw Text (Byte) Code semantic extensibility

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 10 Raw Text Display-Driven AST AST*—Abstract Syntax Graph more freedom in displaying code Program store is determined by editor communication is AST-based only cannot use text-based tools Language extensibility presentation macros (DrScheme) and AST expansion (Intentional Programming) DrScheme Intentional Programming Subtext Other Tools Display (AST*) (Byte) Code Store AST Expanded AST semantic extensibility presentation extensibility

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 11 (Byte) Code Expanded AST Other Tools Display/ Edit Raw Text Presentation Extension of Plain Text Language extensibility presentation syntactic Compatible with modern IDEs Tool infrastructure Raw text is accessible (with syntactic extension) AST* semantic extensibility presentation extensibility

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 12 Expanded AST Architecture Legacy Tools Display AST Byte Code Raw Text

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 13 Expanded AST Architecture Display AST Byte Code Legacy Tools Raw Text

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 14 Expanded AST Architecture Display AST Byte Code Raw Text

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 15 Raw Text Expanded AST Architecture Display Byte Code AST Pair of disjoint, but communicating metaobject protocols

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 16 Implementation Display Byte Code AST Expanded AST AST+ Edit MOs AST+ Compile MOs Boxes Controllers M V C Error Propagation CTMOP ETMOP Pair of disjoint, but communicating metaobject protocols Raw Text Edit-Time Metaobject Protocol Compile-Time Metaobject Protocol

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 17 Traceability Display Byte Code AST Expanded AST AST+ EMOs AST+ CMOs Boxes Controllers CTMOP ETMOP Pair of disjoint, but communicating metaobject protocols Pair of disjoint, but communicating metaobject protocols Raw Text Edit-Time Metaobject Protocol Compile-Time Metaobject Protocol

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 18 Traceability Allows Error Propagation

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 19 Traceability Allows Code Completion

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 20 Can be used to create graph edges Annotations are familiar Annotations work with existing tools Valid Java syntax Attached to private int private int y; Metaobjects Serialize to Annotations

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 21 AspectJ Code Style↔Annotation class void advice$aj$0(Point p){ Screen.notify(); "this(p) && execution(void Point.set*(int))") void changes(Point p){} }

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 22 type=BufferedReader.class, name="file", init="new BufferedReader(new FileReader(fName))") public String getFileContents(String fName) {... }

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 23 Only presentation extensibility, no semantic Backquote—Code Generation return makeMethod( makeModifiers(PUBLIC), makeVoid(), makeName(makeSetterName(varName)), makeParameters( makeParameter(makeType(typeName), makeName(varName))), makeBlock(makeExpressionStatement( makeAssignment(makeFieldAccess( makeThis(), makeName(varName)), makeName(varName)))));

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 24 Equations public static double mean( final List x) int MOP_ANNOTATION_HOLDER$0; return Equ.div( new Summer() { public int body(int i) { return x.get(i); } }.sum(0, x.size() - 1), x.size()); }

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 25 Equation Video

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 26 Stream Processing Automaton

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 27 Presentation Extensions (Byte) Code Expanded AST Other Tools Display/ Edit Raw Text Display Byte Code AST Expanded AST AST+ EMOs AST+ CMOs Boxes Controllers CTMOP ETMOP Error Propagation

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 28 Questions? (Byte) Code Expanded AST Other Tools Display/ Edit Raw Text Display Byte Code AST Expanded AST AST+ EMOs AST+ CMOs Boxes Controllers CTMOP ETMOP Error Propagation

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 29 Talk about indexicality I am probably not going to talk about this due to time constraints How do we bridge between examples and this? Show the different variations of getter Explain benefits and disadvantages

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 30 From AST to Display AST EMOs Boxes Display... DefaultREMO CombineRightREM GetterREM O SetterREMO DefaultREMO

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 31 From AST to Byte Code... AST DefaultCMO CombineRightCMO GetterCMO SetterCMO DefaultCMO CMOs Transform Traceability ETMOP Editor Compile *.class... Modified AST

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 32 Stream Processing Automaton

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 33 DrScheme Display Program not stored as text AST created from display Communication is AST-based only Store is serialized form of the display Easy to go from store to display Requires display infrastructure to interpret Textual form is not readable Point of openness Raw Text Other Tools Store AST Expanded AST (Byte) Code

Andrew Eisenberg and Gregor Kiczales — University of British Columbia 34 Presentation Extensions mean what?