Powerful DSL engineering with Smalltalk

Size: px
Start display at page:

Download "Powerful DSL engineering with Smalltalk"

Transcription

1 Powerful DSL engineering with Smalltalk Stéphane Ducasse Stéphane Ducasse 1

2 A word of introduction Reflective, metamodeler and happy programmer Wrote several books on Smalltalk Pharo by example, Squeak by Example,... Pushed Moose Building Pharo Maintained Squeak 2

3 RMOD INRIA Team Software evolution and software composition Axis 1: Maintaining large software systems Moose: a platform for reengineering, Axis 2: Modular and Secure Reflective languages Revisiting fundamental aspects of OO languages Traits (SUN Microsystems...), Classboxes Pharo open-source Smalltalk Starting to work on a secure reflective languages 3

4 Roadmap A word about design Smalltalk an executable modeling language Internal DSLs industrial examples Mondrian Glamour Seaside Helvetia: mastering embedded languages Tools: PetitParser Conclusion 4

5 About design and DSL 5

6 Good OOP design makes implicit explicit 6

7 Classes structure our vocabulary 7

8 Classes are recipients of message reaction 8

9 Boolean xor: eqv: storeon: and: or: iftrue:iffalse: & not iftrue: truealternativeblock iffalse: falsealternativeblock self subclassresponsibility False and: or: iftrue:iffalse: & not True and: or: iftrue:iffalse: & not iftrue: truealternativeblock iffalse: falsealternativeblock ^ truealternativeblock value iftrue: truealternativeblock iffalse: falsealternativeblock ^ falsealternativeblock value 9

10 Ternary logic Boolean: true, false, unknown 10

11 Focus on **your** domain Define domain elements as first class objects Long tradition in Smalltalk 11

12 Exploratory modeling Extreme/agile modeling One domain expert One developer Pair-programming with the domain expert Using the domain expert vocabulary 2007 SAP Experience with Smalltalk 12

13 Requirements for a real DSL Adequate syntax Capture intent/domain EXECUTABLE! Tools TestRunner Browsers Semantics versioning Debuggers! 13

14 Smalltalk is a modeling executable language Quite close from xactium 14

15 Smalltalk Modeling the world Simple syntax Trivial OO model Executable Full set of powerful tools 15

16 A Simple and Pure Model Everything is an object (no primitive) Only message passing (virtual) Public methods/private attributes Single inheritance Class extension (Program slices) Closures 16

17 Date today is a unary message 17

18 1000 factorial is a unary message 18

19 1 / 3 is a binary message 19

20 1000 factorial / 999 factorial is a unary/binary messages 20

21 Color gray - Color white = Color black 21

22 Color r: 0 g: 0 b: 1 is a keyword-based message 22

23 From Java to Smalltalk postman.send(mail,recipient); 23

24 Removing postman.send(mail,recipient); 24

25 Removing unnecessary postman send mail recipient 25

26 But without losing information postman send mail to recipient 26

27 postman send: mail to: recipient postman.send(mail,recipient); 27

28 Tamagotchi Small entity Its own night and day cycle Eating, sleeping, been hungry, been satisfied Changing color to indicate its mood 28

29 Class Object subclass: #Tamagotchi instancevariablenames: tummy hunger daycount isnight' classvariablenames: '' pooldictionaries: '' category: TOMA' 29

30 initialize Initialize the internal state of a newly created tomagoshi super initialize. tummy := 0. hunger := 2 atrandom + 1. self daystart. self wakeup daystart night := false. daycount := 10 30

31 timepass "Manage the night and day alternance and digestion" Beeper beep. daycount := daycount -1. daycount iszero iftrue:[ self nightordayend. daycount := 10]. self digest digest "Digest slowly: every two cycle, remove one from the tummy (daycount isdivisibleby: 2) iftrue: [ tummy := tummy -1] 31

32 Self-described 32

33 Implemented totally in itself extensible... 33

34 Vocabulary points 34

35 External Languages Tools: make, flex, yacc Data: awk, sed, XPath, Regular Expressions, SQL + expressive, full control - expensive to implement, no tools, hard to pass data around 35

36 Internal Languages Ruby: rspec, rake JavaScript: jquery Smalltalk: Mondrian, Seaside, PetitParser + easy to implement, tool support, easily mixable 36

37 Embedded Languages Language Workbenches: JetBrains MPS, Intentional Software + common infrastructure for different languages - new language, new tools, non-standard host language, targeted at domain experts (no programmers) 37

38 Mondrian metaphor: painting a view Composition with Red, Yellow and Blue Piet Mondrian (1921) 38

39 Mondrian a scriptable visualization language fast brainstorming of ideas interactive developed by Girba/Meer (SCG, Bern), maintained, optimized by Bergel (Pleaid, Santiago, Chile) heavily used by researchers in reengineering part of Moose 39

40 The view consists of nodes and edges view := ViewRenderer new. view nodes: classes. view edges: classes from: [:each each superclass] to: [:each each]. view treelayout. view open. 40

41 Visual representation is given by the shape view := ViewRenderer new. view borderedrectangleshape height: [:each each numberofmethods]. view nodes: classes. view edges: classes from: [:each each superclass] to: [:each each]. view treelayout. view open. 41

42 Blocks can be replaced by symbols view := ViewRenderer new. view borderedrectangleshape height: #numberofmethods. view nodes: classes. view edgesfrom: #superclass. view treelayout. view open. 42

43 Nesting is done through blocks view := ViewRenderer new. view borderedrectangleshape. view nodes: classes foreach: [:each view nodes: each methods. view gridlayout]. view edgesfrom: #superclass. view treelayout. view open. 43

44 What about interaction? 44

45 Interaction is scriptable, too view := ViewRenderer new. view2 := ViewRenderer new. view interaction onselect: [:each each viewon: view2]. view interaction popupview: [:each :aview each viewon: aview]. view nodes:... 45

46 Glamour Internal language to build data explorer/browser Component-based 46

47 47

48

49 49

50 browser := GLMTabulator new. browser column: #one; column: #two. browser showon: #one; using: [ browser table column: 'Character' evaluated: [ :each each asstring ]; column: 'ASCII' evaluated: [ :each each asinteger printstring ]; act: [:tree tree inspect ] on: $i entitled: 'Inspect'; icon: [:x MenuIcons helpicon ]]. browser showon: #two; from: #one; using: [ browser text ]. 50

51 Seaside To build dynamic applications Applications in production since 2002 Natural Flow Reusable statefull components Secure by default Web

52

53 53

54 value1 := self request: first number. value2 := self request: second number. self inform: value1 asnumber + value2 asnumber 54

55 Not concerned about HTTP No manual request parsing No XML configuration files 55

56 56 Source: stock.xchng, Al Nakib

57 html div id: list ; with: [ html span class: item ; with: Item 1. html span class: item ; with: Item 2 ] generates... <div id= list > <span class= item >Item 1</span> <span class= item >Item 2</span> </div> 57

58 html anchor callback: [ self inform: Hello World ]; with: Show Message Generates... <a href= /seaside/example1?_s=ru8zkgqjy0udx3kf &_k=k5eqyqke &32 >Show Message</a> 58

59 59

60 WAComponent subclass: #Example2 instancevariablenames: 'english' classvariablenames: '' pooldictionaries: '' category: 'SeaExample' 60

61 rendercontenton: html html form: [ html button callback: [english := true]; text: 'english'. html button callback: [self infrench]; text: 'french'. html submitbutton callback: [ english iffalse: [self inform: 'Bonjour'] iftrue: [self inform: 'Hello'] ] ; text: 'Say Hello' ] 61

62 Full hot on the fly debug Full integration with javascript Handling of the back button... 62

63 Slime Rule for checking validation of Seaside internal language 63

64 Mastering Embedded Languages!" #"$%& 64

65 65

66 change semantics Adopt, Extend, Overload introduce new syntax change syntax & semantics 66

67 x = 1 x = 2 y = 1 Package Name (2, 1) y = 2 (1, 2) (2, 2)

68 abuilder row grow. abuilder row fill. abuilder column grow. abuilder column fill. x = 1 x = 2 y = 1 Package Name (2, 1) y = 2 (1, 2) (2, 2) abuilder x: 1 y: 1 add: (LabelShape new text: [ :each each name ]; bordercolor: #black; borderwidth: 1; yourself). abuilder x: 1 y: 2 w: 2 h: 1 add: (RectangleShape new bordercolor: #black; borderwidth: 1; width: 200; 68

69 row = grow. row = fill. x = 1 x = 2 y = 1 Package Name (2, 1) column = grow. column = fill. y = 2 (1, 2) (2, 2) (1, 1) = label text: [ :each each name ]; bordercolor: #black; borderwidth: 1. (1, 2) - (2, 1) = rectangle bordercolor: #black; borderwidth: 1; width: 200; height:

70 shape { } label { } rectangle { cols: #grow, #fill; rows: #grow, #fill; position: 1, 1; text: [ :each each name ]; bordercolor: #black; borderwidth: 1; position: 1, 2; colspan: 2; bordercolor: #black; borderwidth: 1; width: 200; x = 1 x = 2 y = 1 Package Name (2, 1) y = 2 (1, 2) (2, 2) 70

71 Homogeneous Tools 71

72 Domain-Specific 72

73 Source Smalltalk Semantic Bytecode Executable Code Parser Analysis Generation Code Traditional Smalltalk Compiler

74 Rules <parse> <transform> <attribute> <bytecode> Source Smalltalk Semantic Bytecode Executable Code Parser Analysis Generation Code Traditional Smalltalk Compiler

75 ... <complete> <highlight>... Rules <parse> <transform> <attribute> <bytecode> Source Smalltalk Semantic Bytecode Executable Code Parser Analysis Generation Code Traditional Smalltalk Compiler

76 ... <complete> <highlight>... Creole path Pidgin path Rules <parse> <transform> <attribute> <bytecode> Source Smalltalk Semantic Bytecode Executable Code Parser Analysis Generation Code Traditional Smalltalk Compiler

77 Scannerless Parsers combine what is usually done by two independent tools (scanner and parser) into one. This makes writing a grammar much simpler and avoids common problems when grammars are composed. Parser Combinators are building blocks for parsers modeled as a graph of composable objects; they are modular and maintainable, and can be changed, recomposed, transformed and reflected upon. Parsing Expression Grammars (PEGs) provide ordered choice. Unlike in parser combinators, the ordered choice of PEGs always follows the first matching alternative and ignores other alternatives. Valid input always results in exactly one parse-tree, the result of a parse is never ambiguous. Packrat Parsers give linear parse time guarantees and avoid common problems with left-recursion in PEGs. 77

78 BNF ID ::= letter { letter digit } ; Ometa2 id = letter (letter digit)* PetitParser id := #letter asparser,! (#letter asparser / #digit asparser) star 78

79 Smalltalk is a serious player in DSL Trivial model Trivial syntax Internal DSLs Embedded DSLs Full tool support Extensible (build your own) Executable 79

80 80

Seaside: An Innovative Web Application Framework

Seaside: An Innovative Web Application Framework Seaside: An Innovative Web Application Framework Damien Cassou, Stéphane Ducasse and Luc Fabresse W4S08 http://www.pharo.org W4S08 2 / 24 Seaside A powerful, innovative and flexible framework Dedicated

More information

Pharo Syntax in a Nutshell

Pharo Syntax in a Nutshell Pharo Syntax in a Nutshell Damien Cassou, Stéphane Ducasse and Luc Fabresse W1S06, 2015 W1S06 2 / 28 Getting a Feel About Syntax In this lecture we want to give you the general feel to get started: Overview

More information

Querying,* visualizing models

Querying,* visualizing models Querying,* visualizing models Overview!FAMIX&metamodel!Access&models! Query! Select! Navigate! Visualize Moose an*extensible*toolbox for*software*and*data*analysis! Importers! Model! Visualizations! Rules

More information

Introduction to Seaside

Introduction to Seaside Introduction to Seaside Randal L. Schwartz, merlyn@stonehenge.com Version 2.01 on 20 July 2009 This document is copyright 2008, 2009 by Randal L. Schwartz, Stonehenge Consulting Services, Inc. This work

More information

Why using Smalltalk for Teaching Object- Oriented Design

Why using Smalltalk for Teaching Object- Oriented Design Why using Smalltalk for Teaching Object- Oriented Design N. Bouraqadi - Ecole des Mines de Douai S. Ducasse - University of Berne S. Stinckwich - University of Caen R. Wuyts - Université Libres de Bruxelles

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

To install Glamour on your Pharo image execute the following code:

To install Glamour on your Pharo image execute the following code: Glamour Chapter 1 Glamour with the participation of: Tudor Girba (tudor@tudorgirba.com) Browsers are a crucial instrument in understanding complex systems or models. A browser is a tool to navigate and

More information

Smalltalk FOOP. Smalltalk

Smalltalk FOOP. Smalltalk 2015-03-20 Smalltalk Smalltalk 2015-03-20 Smalltalk 1 First Examples hello Transcript show: Hi World hello5 1 to: 5 do: [:i (Transcript show: Hi World ) cr] hello: times 1 to: times do: [:i (Transcript

More information

Introduction to Smalltalk

Introduction to Smalltalk Introduction to Smalltalk Randal L. Schwartz, merlyn@stonehenge.com Version 1.01 on 20 July 2009 This document is copyright 2009 by Randal L. Schwartz, Stonehenge Consulting Services, Inc. This work is

More information

5-Sep-16 Copyright 2016 by GemTalk Systems LLC 1

5-Sep-16 Copyright 2016 by GemTalk Systems LLC 1 In this chapter we use the Flight Information application to learn about continuations, an often-cited but poorly understood feature of many Smalltalk dialects that allows Seaside applications to use subroutine

More information

3. A Simple Counter. Creating your own class

3. A Simple Counter. Creating your own class In this exercise, you will write your first complete program. The program is very simple, the goal of the exercise is to get used to the Pharo environment and the basics of the language. From the Pharo

More information

CS 403/503 Exam 4 Spring 2015 Solution

CS 403/503 Exam 4 Spring 2015 Solution CS 403/503 Exam 4 Spring 2015 Solution Each problem initially scored out of 10 points possible. CS 403 Best 5 answers doubled. (5*20 + 2*10 = 120 possible) CS 503 Best 4 answers doubled. (4*20 + 3*10 =

More information

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction Lecture 13: Object orientation Object oriented programming Introduction, types of OO languages Key concepts: Encapsulation, Inheritance, Dynamic binding & polymorphism Other design issues Smalltalk OO

More information

6. Exemplary Solutions: Seaside: Components

6. Exemplary Solutions: Seaside: Components 6. Exemplary Solutions: Seaside: Components Exercise 6.1 STBuyTicketTask class >> canberoot ˆtrue self inform: Hello World Exercise 6.2 WAComponent subclass: #STPlayChooser instancevariablenames: plays

More information

Metaprogramming and Reflection Refactoring

Metaprogramming and Reflection Refactoring Metaprogramming and Reflection Refactoring Universität Bern Marcus Denker Hasso-Plattner-Institut Potsdam Software Architecture Group Prof. Dr. Robert Hirschfeld http://www.swa.hpi.uni-potsdam.de WS 2006/2007

More information

Brainstorming Draft. Draft Stéphane Ducasse To

Brainstorming Draft. Draft Stéphane Ducasse To Brainstorming Draft Draft Stéphane Ducasse stephane.ducasse@free.fr -2006 To April 8, 2006 2 Contents I Joe the Miner 7 1 Bots, Inc. 11 1 Getting Started..................................... 11 2 The Robot

More information

Object Oriented Paradigm Languages

Object Oriented Paradigm Languages Object Oriented Paradigm Languages The central design goal is to build inherent abstraction into the system, moving all the abstract implementation details from the user level (ad-hoc) to the system level

More information

An Introduction to Squeak

An Introduction to Squeak An Introduction to Squeak Hello! Squeak is a language largely derived from Smalltalk. Now imagine what a coincidence it is to be do an assignment that uses the Smalltalk language after having just finished

More information

10. PEGs, Packrats and Parser Combinators

10. PEGs, Packrats and Parser Combinators 10. PEGs, Packrats and Parser Combinators Oscar Nierstrasz Thanks to Bryan Ford for his kind permission to reuse and adapt the slides of his POPL 2004 presentation on PEGs. http://www.brynosaurus.com/

More information

CERTIFICATE IN WEB PROGRAMMING

CERTIFICATE IN WEB PROGRAMMING COURSE DURATION: 6 MONTHS CONTENTS : CERTIFICATE IN WEB PROGRAMMING 1. PROGRAMMING IN C and C++ Language 2. HTML/CSS and JavaScript 3. PHP and MySQL 4. Project on Development of Web Application 1. PROGRAMMING

More information

A Lazy List Implementation in Squeak

A Lazy List Implementation in Squeak A Lazy List Implementation in Squeak Takashi Yamamiya This material is based upon work supported in part by the National Science Foundation under Grant No. 0639876. Any opinions, findings, and conclusions

More information

ABAP DSL Workbench SAP TechED 2016

ABAP DSL Workbench SAP TechED 2016 ABAP DSL Workbench SAP TechED 2016 Barcelona, November 2016-0 - Hello. Hello. Example Asia Diner Yes? Number 77. Take away? No. Hello. Hello. Hello. Hello. As always? Yes. As always? Yes. Where are the

More information

In this chapter we enhance the Los Boquitas application with a new component showing upcoming events in a table.

In this chapter we enhance the Los Boquitas application with a new component showing upcoming events in a table. In this chapter we enhance the Los Boquitas application with a new component showing upcoming events in a table. 1. First, we need to have some events to display. a. We will start by defining an event

More information

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language Categories of languages that support OOP: 1. OOP support is added to an existing language - C++ (also supports procedural and dataoriented programming) - Ada 95 (also supports procedural and dataoriented

More information

Using Scala for building DSL s

Using Scala for building DSL s Using Scala for building DSL s Abhijit Sharma Innovation Lab, BMC Software 1 What is a DSL? Domain Specific Language Appropriate abstraction level for domain - uses precise concepts and semantics of domain

More information

Implementing Programming Languages for Fun and Profit with OMeta. Alessandro Warth Viewpoints Research Institute & UCLA

Implementing Programming Languages for Fun and Profit with OMeta. Alessandro Warth Viewpoints Research Institute & UCLA Implementing Programming Languages for Fun and Profit with OMeta Alessandro Warth Viewpoints Research Institute & UCLA Who am I? NOT David Simmons NOT Billy Idol !!! programming languages STEPS... toward

More information

Scripting Browsers. Philipp Bunge, Tudor Gîrba, Lukas Renggli, Jorge Ressia, David Röthlisberger

Scripting Browsers. Philipp Bunge, Tudor Gîrba, Lukas Renggli, Jorge Ressia, David Röthlisberger Scripting Browsers Philipp Bunge, Tudor Gîrba, Lukas Renggli, Jorge Ressia, David Röthlisberger Software Composition Group, University of Bern, Switzerland 1 Glamour in a Nutshell Browsers are crucial

More information

10. PEGs, Packrats and Parser Combinators!

10. PEGs, Packrats and Parser Combinators! 10. PEGs, Packrats and Parser Combinators! Prof. O. Nierstrasz! Thanks to Bryan Ford for his kind permission to reuse and adapt the slides of his POPL 2004 presentation on PEGs.! http://www.brynosaurus.com/!

More information

Obtaining these Instructions and Software. GemStone/S 64 Bit Setup Options

Obtaining these Instructions and Software. GemStone/S 64 Bit Setup Options Obtaining these Instructions and Software 1. Copy instructions and software a. Open a web browser on http:// 192.168.1.13/ to see these instructions. b. Copy from DVD, USB flash drive, or web. GemStone/S

More information

Outline Smalltalk Overview Pragmatic Smalltalk Closing. Pragmatic Smalltalk. David Chisnall. February 7,

Outline Smalltalk Overview Pragmatic Smalltalk Closing. Pragmatic Smalltalk. David Chisnall. February 7, February 7, 2009 http://etoileos.com Outline Using The Smalltalk Family Smalltalk - first dynamic, object-oriented, language. Self - Smalltalk without classes. JavaScript - Self with Java syntax. A Quick

More information

A tutorial report for SENG Agent Based Software Engineering. Course Instructor: Dr. Behrouz H. Far. XML Tutorial.

A tutorial report for SENG Agent Based Software Engineering. Course Instructor: Dr. Behrouz H. Far. XML Tutorial. A tutorial report for SENG 609.22 Agent Based Software Engineering Course Instructor: Dr. Behrouz H. Far XML Tutorial Yanan Zhang Department of Electrical and Computer Engineering University of Calgary

More information

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0 WEB TECHNOLOGIES A COMPUTER SCIENCE PERSPECTIVE CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0 Modified by Ahmed Sallam Based on original slides by Jeffrey C. Jackson reserved. 0-13-185603-0 HTML HELLO WORLD! Document

More information

An Introduction to Smalltalk for Objective-C Programmers

An Introduction to Smalltalk for Objective-C Programmers An Introduction to Smalltalk for Objective-C Programmers O Reilly Mac OS X Conference October 25 28, 2004 Philippe Mougin - pmougin@acm.org http://www.fscript.org IT Management & Consulting What you will

More information

ST Introduction. Birds-eye view

ST Introduction. Birds-eye view 6. Debugging ST Introduction Birds-eye view It can be easier to talk to objects than to read classes The system is alive. Talk to it. The debugger can be your best friend. Donʼt be afraid of it. 1.2 Roadmap

More information

Modules, Structs, Hashes, and Operational Semantics

Modules, Structs, Hashes, and Operational Semantics CS 152: Programming Language Paradigms Modules, Structs, Hashes, and Operational Semantics Prof. Tom Austin San José State University Lab Review (in-class) Modules Review Modules from HW 1 (in-class) How

More information

Executable Grammars in Newspeak

Executable Grammars in Newspeak Executable Grammars in Newspeak Gilad Bracha Distinguished Engineer Cadence Design Systems Parser Combinators Long history in Functional Programming Operators of BNF are functions from (grammar) productions

More information

Newspeak: Not Just for English Socialists Anymore

Newspeak: Not Just for English Socialists Anymore Newspeak: Not Just for English Socialists Anymore Gilad Bracha Distinguished Engineer Cadence Design Systems 1 What is Newspeak? - Newspeak... had been devised to meet the ideological needs of Ingsoc,

More information

Smalltalk. Topics. History of Smalltalk. OOP and GUI. Steve Jobs, PARC, Dec Smalltalk 1. The best way to predict the future is to invent it.

Smalltalk. Topics. History of Smalltalk. OOP and GUI. Steve Jobs, PARC, Dec Smalltalk 1. The best way to predict the future is to invent it. Smalltalk The best way to predict the future is to invent it. Alan Kay, 1971 Topics History and significance of Smalltalk Object-oriented programming The Smalltalk language Smalltalk today Additional Examples

More information

2. Smalltalk a reflective language. Oscar Nierstrasz

2. Smalltalk a reflective language. Oscar Nierstrasz 2. Smalltalk a reflective language Oscar Nierstrasz Birds-eye view Smalltalk is still today one of the few fully reflective, fully dynamic, objectoriented development environments. We will see how a simple,

More information

XXXXXXXXXXXXXXXXXXXXXXX. Evolution of Software Languages

XXXXXXXXXXXXXXXXXXXXXXX. Evolution of Software Languages Section 8: Simula Smalltalk Evolution of Software Languages Theo D'Hondt Bachelor of Computer Science Faculty of Sciences and Bio-Engineering Sciences Vrije Universiteit Brussel Academic Year 2015-2016

More information

Scala, Your Next Programming Language

Scala, Your Next Programming Language Scala, Your Next Programming Language (or if it is good enough for Twitter, it is good enough for me) WORLDCOMP 2011 By Dr. Mark C. Lewis Trinity University Disclaimer I am writing a Scala textbook that

More information

Inheritance (Chapter 7)

Inheritance (Chapter 7) Inheritance (Chapter 7) Prof. Dr. Wolfgang Pree Department of Computer Science University of Salzburg cs.uni-salzburg.at Inheritance the soup of the day?! Inheritance combines three aspects: inheritance

More information

focus 1 dynamically typed languages Seaside: A Flexible Environment for Building Dynamic Web Applications

focus 1 dynamically typed languages Seaside: A Flexible Environment for Building Dynamic Web Applications focus 1 dynamically typed languages Seaside: A Flexible Environment for Building Dynamic Web Applications Stéphane Ducasse, Université de Savoie Adrian Lienhard and Lukas Renggli, University of Bern, Switzerland

More information

Concepts of Programming Languages

Concepts of Programming Languages Concepts of Programming Languages Lecture 10 - Object-Oriented Programming Patrick Donnelly Montana State University Spring 2014 Patrick Donnelly (Montana State University) Concepts of Programming Languages

More information

esug.org (European Smalltalker Users Group) Javascript

esug.org (European Smalltalker Users Group) Javascript Serge Amber Pharo ( ) esug.org (European Smalltalker Users Group) Amber Web Smalltalk Web Smtalltalk Javascript Javascript Web Transcript Workspace SUnit (JUnit Smalltalk ) System Browser halt JQuery UI

More information

Programming with Seaside

Programming with Seaside Programming with Seaside Alexandre.Bergel@cs.tcd.ie LERO & DSG Trinity College Dublin, Ireland 1 Part I: Seaside in a Nutshell Outline 1. What is Seaside? 2. Starting Seaside 3. Create new Seaside Component

More information

11. Working with Bytecode

11. Working with Bytecode 11. Working with Bytecode Roadmap > The Squeak compiler > Introduction to Squeak bytecode > Generating bytecode with IRBuilder > Parsing and Interpreting bytecode Original material b y Marcus Denker 11.2

More information

Lecture Notes on Programming Languages

Lecture Notes on Programming Languages Lecture Notes on Programming Languages 85 Lecture 09: Support for Object-Oriented Programming This lecture discusses how programming languages support object-oriented programming. Topics to be covered

More information

Programming Languages Third Edition. Chapter 7 Basic Semantics

Programming Languages Third Edition. Chapter 7 Basic Semantics Programming Languages Third Edition Chapter 7 Basic Semantics Objectives Understand attributes, binding, and semantic functions Understand declarations, blocks, and scope Learn how to construct a symbol

More information

Enabling Software Analysis using PetitParser and Moose

Enabling Software Analysis using PetitParser and Moose 1 Enabling Software Analysis using PetitParser and Moose Michael Rüfenacht Software Composition Group University of Bern, Switzerland m.ruefenacht@students.unibe.ch http://scg.unibe.ch Abstract Static

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

Programming Modeling Two Worlds? Programmierung Modellierung Zwei Welten? und. and. Markus Voelter Independent/itemis

Programming Modeling Two Worlds? Programmierung Modellierung Zwei Welten? und. and. Markus Voelter Independent/itemis und Programmierung Modellierung Zwei Welten? and Modeling Two Worlds? Markus Voelter Independent/itemis voelter@acm.org Markus Voelter Independent/itemis voelter@acm.org 1 Languages C# Erlang C++ Python

More information

Software Evolution from the Field: An Experience Report from the Squeak Maintainers

Software Evolution from the Field: An Experience Report from the Squeak Maintainers Software Evolution from the Field: An Experience Report from the Squeak Maintainers Marcus Denker SCG University of Berne Switzerland Stéphane Ducasse LISTIC Université de Savoie France Roadmap > A little

More information

Syntax/semantics. Program <> program execution Compiler/interpreter Syntax Grammars Syntax diagrams Automata/State Machines Scanning/Parsing

Syntax/semantics. Program <> program execution Compiler/interpreter Syntax Grammars Syntax diagrams Automata/State Machines Scanning/Parsing Syntax/semantics Program program execution Compiler/interpreter Syntax Grammars Syntax diagrams Automata/State Machines Scanning/Parsing Meta-models 8/27/10 1 Program program execution Syntax Semantics

More information

with openarchitectureware

with openarchitectureware Model-Driven Development with openarchitectureware Markus Völter voelter@acm.orgorg www.voelter.de Sven Efftinge sven@efftinge.de www.efftinge.de Bernd Kolb bernd@kolbware.de www.kolbware.de 2006-7 Völter,

More information

Language Boxes. Bending the Host Language with Modular Language Changes.

Language Boxes. Bending the Host Language with Modular Language Changes. Language Boxes Bending the Host Language with Modular Language Changes Lukas Renggli 1, Marcus Denker 2, and Oscar Nierstrasz 1 1 Software Composition Group, University of Bern, Switzerland {renggli,oscar}@iam.unibe.ch

More information

Sista: Improving Cog s JIT performance. Clément Béra

Sista: Improving Cog s JIT performance. Clément Béra Sista: Improving Cog s JIT performance Clément Béra Main people involved in Sista Eliot Miranda Over 30 years experience in Smalltalk VM Clément Béra 2 years engineer in the Pharo team Phd student starting

More information

1. Launch the Seaside One-Click Experience (see Chapter 1 for details) and open a web browser on

1. Launch the Seaside One-Click Experience (see Chapter 1 for details) and open a web browser on In this chapter we will explore some of the Seaside from the web browser s point of view, including examples available with the default installation of Seaside. 1. Launch the Seaside One-Click Experience

More information

Working with JavaScript

Working with JavaScript Working with JavaScript Creating a Programmable Web Page for North Pole Novelties 1 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page 2 Objectives

More information

First Programming Language in CS Education The Arguments for Scala

First Programming Language in CS Education The Arguments for Scala First Programming Language in CS Education The Arguments for Scala WORLDCOMP 2011 By Dr. Mark C. Lewis Trinity University Disclaimer I am writing a Scala textbook that is under contract with CRC Press.

More information

A simple syntax-directed

A simple syntax-directed Syntax-directed is a grammaroriented compiling technique Programming languages: Syntax: what its programs look like? Semantic: what its programs mean? 1 A simple syntax-directed Lexical Syntax Character

More information

CSE 5317 Midterm Examination 4 March Solutions

CSE 5317 Midterm Examination 4 March Solutions CSE 5317 Midterm Examination 4 March 2010 1. / [20 pts] Solutions (parts a j; -1 point for each wrong answer, 0 points for each blank answer, 2 point for each correct answer. Therefore, the score for this

More information

Domain-specific Languages

Domain-specific Languages Domain-specific Languages Course "Software Language Engineering" University of Koblenz-Landau Department of Computer Science Ralf Lämmel Software Languages Team 1 What s a DSL? 2 This slide has been extracted

More information

Syntax and Messages. Stéphane Ducasse 8.1

Syntax and Messages. Stéphane Ducasse 8.1 Syntax and Messages The syntax of Smalltalk is simple and uniform, but it can look strange at first sight! Literals: numbers, strings, arrays... Variable names Pseudo-variables Assignments, returns Message

More information

SPARK-PL: Introduction

SPARK-PL: Introduction Alexey Solovyev Abstract All basic elements of SPARK-PL are introduced. Table of Contents 1. Introduction to SPARK-PL... 1 2. Alphabet of SPARK-PL... 3 3. Types and variables... 3 4. SPARK-PL basic commands...

More information

CSI 3140 WWW Structures, Techniques and Standards. Markup Languages: XHTML 1.0

CSI 3140 WWW Structures, Techniques and Standards. Markup Languages: XHTML 1.0 CSI 3140 WWW Structures, Techniques and Standards Markup Languages: XHTML 1.0 HTML Hello World! Document Type Declaration Document Instance Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson

More information

CS 3360 Design and Implementation of Programming Languages. Exam 1

CS 3360 Design and Implementation of Programming Languages. Exam 1 1 Spring 2016 (Monday, March 21) Name: CS 3360 Design and Implementation of Programming Languages Exam 1 This test has 18 questions and pages numbered 1 through 6. Reminders This test is closed-notes and

More information

Java Programming Lecture 6

Java Programming Lecture 6 Java Programming Lecture 6 Alice E. Fischer Feb 15, 2013 Java Programming - L6... 1/32 Dialog Boxes Class Derivation The First Swing Programs: Snow and Moving The Second Swing Program: Smile Swing Components

More information

About Instance Initialization

About Instance Initialization Learning Object-Oriented Programming and Design with TDD About Instance Initialization Stéphane Ducasse http://stephane.ducasse.free.fr http://www.pharo.org W5S06 W5S06 2 / 26 How to ensure that an instance

More information

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 2: Review of Object Orientation

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 2: Review of Object Orientation Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 2: Review of Object Orientation 2.1 What is Object Orientation? Procedural paradigm: Software is organized

More information

Working with Bytecodes: IRBuilder and InstructionStream. Marcus Denker. Reasons for working with Bytecode

Working with Bytecodes: IRBuilder and InstructionStream. Marcus Denker. Reasons for working with Bytecode Working with Bytecodes: IRBuilder and InstructionStream Reasons for working with Bytecode Generating Bytecode Implementing compilers for other languages Experimentation with new language features Parsing

More information

Computer Science 4U Unit 1. Programming Concepts and Skills Modular Design

Computer Science 4U Unit 1. Programming Concepts and Skills Modular Design Computer Science 4U Unit 1 Programming Concepts and Skills Modular Design Modular Design Reusable Code Object-oriented programming (OOP) is a programming style that represents the concept of "objects"

More information

CSE 341, Autumn 2015, Ruby Introduction Summary

CSE 341, Autumn 2015, Ruby Introduction Summary CSE 341, Autumn 2015, Ruby Introduction Summary Disclaimer: This lecture summary is not necessarily a complete substitute for atting class, reading the associated code, etc. It is designed to be a useful

More information

Parser Design. Neil Mitchell. June 25, 2004

Parser Design. Neil Mitchell. June 25, 2004 Parser Design Neil Mitchell June 25, 2004 1 Introduction A parser is a tool used to split a text stream, typically in some human readable form, into a representation suitable for understanding by a computer.

More information

CS558 Programming Languages

CS558 Programming Languages CS558 Programming Languages Winter 2017 Lecture 10a Andrew Tolmach Portland State University 1994-2017 Object-oriented Programming Programs are structured in terms of objects: collections of variables

More information

UMBC CMSC 331 Final Exam

UMBC CMSC 331 Final Exam UMBC CMSC 331 Final Exam Name: UMBC Username: You have two hours to complete this closed book exam. We reserve the right to assign partial credit, and to deduct points for answers that are needlessly wordy

More information

COMP 202 Java in one week

COMP 202 Java in one week COMP 202 Java in one week... Continued CONTENTS: Return to material from previous lecture At-home programming exercises Please Do Ask Questions It's perfectly normal not to understand everything Most of

More information

+ Inheritance. Sometimes we need to create new more specialized types that are similar to types we have already created.

+ Inheritance. Sometimes we need to create new more specialized types that are similar to types we have already created. + Inheritance + Inheritance Classes that we design in Java can be used to model some concept in our program. For example: Pokemon a = new Pokemon(); Pokemon b = new Pokemon() Sometimes we need to create

More information

9. Understanding Classes and Metaclasses

9. Understanding Classes and Metaclasses 9. Understanding Classes and Metaclasses ST Introduction Birds-eye view Reify your metamodel A fully reflective system models its own metamodel. 1.2 Roadmap > Metaclasses in 7 points > Indexed Classes

More information

Syllabus- Java + Android. Java Fundamentals

Syllabus- Java + Android. Java Fundamentals Introducing the Java Technology Syllabus- Java + Android Java Fundamentals Key features of the technology and the advantages of using Java Using an Integrated Development Environment (IDE) Introducing

More information

programming languages need to be precise a regular expression is one of the following: tokens are the building blocks of programs

programming languages need to be precise a regular expression is one of the following: tokens are the building blocks of programs Chapter 2 :: Programming Language Syntax Programming Language Pragmatics Michael L. Scott Introduction programming languages need to be precise natural languages less so both form (syntax) and meaning

More information

Expressions & Assignment Statements

Expressions & Assignment Statements Expressions & Assignment Statements 1 Topics Introduction Arithmetic Expressions Overloaded Operators Type Conversions Relational and Boolean Expressions Short-Circuit Evaluation Assignment Statements

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

Object-Oriented Software Engineering. Chapter 2: Review of Object Orientation

Object-Oriented Software Engineering. Chapter 2: Review of Object Orientation Object-Oriented Software Engineering Chapter 2: Review of Object Orientation 2.1 What is Object Orientation? Procedural paradigm: Software is organized around the notion of procedures Procedural abstraction

More information

Uniform and Safe Metaclass Composition

Uniform and Safe Metaclass Composition Uniform and Safe Metaclass Composition Stéphane Ducasse a Nathanael Schärli a Roel Wuyts b a Software Composition Group, IAM-Universität Bern, Switzerland b Decomp Laboratory, Université Libre de Bruxelles,

More information

2 rd class Department of Programming. OOP with Java Programming

2 rd class Department of Programming. OOP with Java Programming 1. Structured Programming and Object-Oriented Programming During the 1970s and into the 80s, the primary software engineering methodology was structured programming. The structured programming approach

More information

Dynamic Language Embedding

Dynamic Language Embedding Dynamic Language Embedding With Homogeneous Tool Support Inauguraldissertation der Philosophisch-naturwissenschaftlichen Fakultät der Universität Bern vorgelegt von Lukas Renggli von Entlebuch Leiter der

More information

Professional Course in Web Designing & Development 5-6 Months

Professional Course in Web Designing & Development 5-6 Months Professional Course in Web Designing & Development 5-6 Months BASIC HTML Basic HTML Tags Hyperlink Images Form Table CSS 2 Basic use of css Formatting the page with CSS Understanding DIV Make a simple

More information

Chapter 3 Syntax, Errors, and Debugging. Fundamentals of Java

Chapter 3 Syntax, Errors, and Debugging. Fundamentals of Java Chapter 3 Syntax, Errors, and Debugging Objectives Construct and use numeric and string literals. Name and use variables and constants. Create arithmetic expressions. Understand the precedence of different

More information

WA1278 Introduction to Java Using Eclipse

WA1278 Introduction to Java Using Eclipse Lincoln Land Community College Capital City Training Center 130 West Mason Springfield, IL 62702 217-782-7436 www.llcc.edu/cctc WA1278 Introduction to Java Using Eclipse This course introduces the Java

More information

Extending Java TM TM And Developing DSLs With JetBrains MPS Open- Source Language Workbench

Extending Java TM TM And Developing DSLs With JetBrains MPS Open- Source Language Workbench Extending Java TM TM And Developing DSLs With JetBrains MPS Open- Source Language Workbench Konstantin Solomatov JetBrains Lead Developer for JetBrains MPS Project 1 Agenda > Extending languages. Why bother?

More information

Inheritance and Interfaces

Inheritance and Interfaces Inheritance and Interfaces Object Orientated Programming in Java Benjamin Kenwright Outline Review What is Inheritance? Why we need Inheritance? Syntax, Formatting,.. What is an Interface? Today s Practical

More information

Time : 3 hours. Full Marks : 75. Own words as far as practicable. The questions are of equal value. Answer any five questions.

Time : 3 hours. Full Marks : 75. Own words as far as practicable. The questions are of equal value. Answer any five questions. XEV (H-3) BCA (6) 2 0 1 0 Time : 3 hours Full Marks : 75 Candidates are required to give their answers in their Own words as far as practicable. The questions are of equal value. Answer any five questions.

More information

11. Working with Bytecode

11. Working with Bytecode 11. Working with Bytecode Roadmap > The Pharo compiler > Introduction to Pharo bytecode > Generating bytecode with IRBuilder > Parsing and Interpreting bytecode Original material by Marcus Denker 11.2

More information

Atelier Java - J1. Marwan Burelle. EPITA Première Année Cycle Ingénieur.

Atelier Java - J1. Marwan Burelle.  EPITA Première Année Cycle Ingénieur. marwan.burelle@lse.epita.fr http://wiki-prog.kh405.net Plan 1 2 Plan 3 4 Plan 1 2 3 4 A Bit of History JAVA was created in 1991 by James Gosling of SUN. The first public implementation (v1.0) in 1995.

More information

Domain-Specific. Languages. Martin Fowler. AAddison-Wesley. Sydney Tokyo. With Rebecca Parsons

Domain-Specific. Languages. Martin Fowler. AAddison-Wesley. Sydney Tokyo. With Rebecca Parsons Domain-Specific Languages Martin Fowler With Rebecca Parsons AAddison-Wesley Upper Saddle River, NJ Boston Indianapolis San Francisco New York Toronto Montreal London Munich Paris Madrid Sydney Tokyo Singapore

More information

Semantic Modularization Techniques in Practice: A TAPL case study

Semantic Modularization Techniques in Practice: A TAPL case study 1 Semantic Modularization Techniques in Practice: A TAPL case study Bruno C. d. S. Oliveira Joint work with Weixin Zhang, Haoyuan Zhang and Huang Li July 17, 2017 Text 2 EVF: An Extensible and Expressive

More information

Resolving cyclic dependencies between packages with Enriched Dependency Structural Matrix

Resolving cyclic dependencies between packages with Enriched Dependency Structural Matrix SOFTWARE PRACTICE AND EXPERIENCE Softw. Pract. Exper. 0000; 00: 4 Published online in Wiley InterScience (www.interscience.wiley.com). Resolving cyclic dependencies between packages with Enriched Dependency

More information

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc.

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc. Chapter 1 GETTING STARTED SYS-ED/ Computer Education Techniques, Inc. Objectives You will learn: Java platform. Applets and applications. Java programming language: facilities and foundation. Memory management

More information

22c:111 Programming Language Concepts. Fall Syntax III

22c:111 Programming Language Concepts. Fall Syntax III 22c:111 Programming Language Concepts Fall 2008 Syntax III Copyright 2007-08, The McGraw-Hill Company and Cesare Tinelli. These notes were originally developed by Allen Tucker, Robert Noonan and modified

More information