Advanced Programming
Overview & Introduction
● Nice to Meet You!
● Plan of the Course
● What is expected of you?
● Focus: Meta-programming
Advanced Programming: Overview 1
Nice to Meet You!
● My background
● Your background
● Name
● Some personal background
● What is your experience with programming?
– Languages
– Projects
● What do you expect to learn in this course?
Advanced Programming: Overview 2
My background
● Paul Klint (see [Link]/~paulk)
● Professor in Software Engineering, UvA
● Former Head of Software Engineering,
Centrum Wiskunde & Informatica (CWI);
Now: research fellow
● Director Master Software Engineering, UvA
● Visiting professor Univ. of London (Royal
Holloway)
● Project leader ATEAMS, INRIA, France
I am interested in
● Meta-programming
● Generic language technology
● Domain specific languages (DSLs)
● Analysis/transformation/renovation of software
● Interactive learning
● Patents
● Innovation (created 3 companies, most succesful:
Software Improvement Group, [Link])
[Link]
Advanced Programming: Overview 5
Advanced Programming: Overview 6
Advanced Programming: Overview 7
[Link]
Advanced Programming: Overview 8
Advanced Programming: Overview 9
Advanced Programming: Overview 10
Your Background
● Name
● Some personal background.
● What is your experience with programming?
● Languages
● Projects
● What do you expect to learn in this course?
Advanced Programming: Overview 11
Plan for this Course
“Better Software via Meta-Programming”
Advanced Programming: Overview 12
Programme (1/2)
● Overview
● Quick intro to Rascal
● Quick intro to Visualization
● Lists
● Sets
● Relations
● Datatypes: Trees and Algebraic Datatypes
Advanced Programming: Overview 13
Programme (2/2)
● Syntax and Parsing
● A simple expression language
● A Lisp interpreter
● Type checking
● Compilation
● A software engineering perspective on meta-
programming
Advanced Programming: Overview 14
Tools and Background Material
● Rascal website: [Link]
● Downloading and installing:
[Link]
● All Tutor courses: [Link]
● The concepts discussed in this course:
[Link]
html
● Ask all your questions about Rascal:
[Link]
● The blackboard site: [Link] course
20112012Advanced Programming
Advanced Programming: Overview 15
What is expected of You?
● Attend and actively participate in classes
● Ask questions
● Participate in discussions
● Present your results
● Install Rascal
● Turn in home work
● Participate in “photo wall”
Advanced Programming: Overview 16
Computational Thinking
● See Jeannette Wing's paper:
[Link]
● Key Idea: relate computer science ideas to daily
life.
● Objective: experiment to explore whether this
helps us to understand concepts.
Advanced Programming: Overview 17
List
Advanced Programming: Overview 18
Tree
Advanced Programming: Overview 19
Set
Advanced Programming: Overview 20
Credit: Tudor Girba
Advanced Programming: Overview 21
Queue
Advanced Programming: Overview 22
Credit: Tudor Girba
Advanced Programming: Overview 23
Questions about using
computational thinking
● Do you find this an interesting approach?
● Do you want to try it?
● How can we organize it?
● In some exercises you are asked to find pictures
that illustrate a concept.
● You are at the constant lookout for related pictures.
● We maintain a photo wall somewhere (Facebook? A
Volunteer?)
Advanced Programming: Overview 24
Problem: The Software Volcano
Mt. Etna, Sicily, Italy
The Software Volcano: Languages
Distribution of languages in use, worldwide
Language Used in % of total
COBOL 30
Assembler 10
C 10
C++ 10
550 other languages 40
● For mainframe applications 80% is COBOL!
● Figures taken from Capers Jones (Software
Productivity Research)
Software Volcano: Volume
● The total volume of software is estimated at
7 * 109 function points
● 1 FP = 128 lines of C or 107 lines of COBOL
● The volume of the volcano is
● 750 Giga-lines of COBOL code, or
● 900 Giga-lines of C code
Printed on paper we can wrap planet Earth
9 times!
Software Volcano: Defects
● Observation:
● on average 5 errors (bugs) per function point
● includes errors in requirements, design, coding,
documentation and bad fixes
● The software volcano, world-wide, contains
5 * 7 * 109 Bugs = 35 Giga Bugs
This means 6 bugs per human being on
planet Earth!
Work distribution of programmers
Year New projects Enhancements Repairs Total
1950 90 3 7 100
1960 8,500 500 1,000 10,000
1970 65,000 15,000 20,000 100,000
1980 1,200,000 600,000 200,000 2,000,000
1990 3,000,000 3,000,000 1,000,000 7,000,000
2000 4,000,000 4,500,000 1,500,000 10,000,000
2010 5,000,000 7,000,000 2,000,000 14,000,000
2020 7,000,000 11,000,000 3,000,000 21,000,000
Now: 60% of the programmers work on enhancement and
repair
In 2020: only 30% of all programmers will work on new
software
A “real” system
Message
● When an industry approaches 50 years of
age it takes more workers to perform
maintenance than to build new products (ex:
automobile industry)
● Maintenance and renovation of existing
software become more and more important:
avoid that the software volcano explodes
● Meta-programming is the technique of choice
to improve upon this situation.
Solution: Meta-Programming
● Normal programs:
● Read data
● Produce data
● Meta-programs:
● Read programs (and other info related to programs
such as version repositories, test data, ...)
● Produce other programs (refactoring) or data about
those programs (metrics, bug locations,
visualizations)
Assignments Week 1
due Friday 7, 16:00 via Blackboard
● Install Eclipse and Rascal
● Search for different definitions of “meta-
programming”; argue which one is best.
● Search for at least 3 different applications of meta-
programming; summarize each and relate to your
favorite definition.
● Explain advantages and disadvantages of meta-
programming
● Search for pictures that illustrate meta-programming.
● We will discuss your solutions in class