35
1 Muhammed Al-Mulhem Visual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

Embed Size (px)

Citation preview

Page 1: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

1Muhammed Al-Mulhem Visual Languages

Visual Programming Languages

ICS 539Introduction &Classification

ICS Department

KFUPM

Sept. 1, 2007

Page 2: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

2Muhammed Al-Mulhem Visual Languages

• Learning programming is a difficult task.

• Writing and testing a program is a difficult and time consuming task.

• The majority of computer users are non programmers.

• Programming languages are designed for professional programmers and computer scientists.

1Introduction

Page 3: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

3Muhammed Al-Mulhem Visual Languages

• Some of the historical reasons for this lack of emphasis on human convenience in programming languages are (Shu, 1988):

– The computer scientists have concentrated on machine efficiency.

– Computing costs were high and human costs were relatively low.

– In the early years of computing, it was justifiable that efficiency took precedence over ease of programming.

Page 4: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

4Muhammed Al-Mulhem Visual Languages

• With the decline in computing costs it is realized that it is the human resource that must be optimized.

• The challenge is to bring computer capabilities to people without special computer training.

• To meet the challenge a number of facilities have been introduced to ease the pain of programming and remembering commands.

• These facilities include icons, pointing devices, and menus.

Page 5: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

5Muhammed Al-Mulhem Visual Languages

• Programming languages have evolved over the years from first generation programming languages to fourth generation programming languages.

• One characteristic of most of these languages is that they use one-dimensional and textual formats to represent programs.

• These formats are suitable for sequential machines but not for the multi-dimensional and visual human mind (Chang, 1986).

Page 6: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

6Muhammed Al-Mulhem Visual Languages

• Visual programming is an attempt to simplify programming and to make better use of the human mind's capabilities

• George Raeder states "... human mind is strongly visually oriented and that people acquire information at a significantly higher rate by discovering graphical relationships in complex pictures than by reading text. ... When we scan paragraph, headlines, and material in bold type to speed up text search, we are really acting in the pictorial mode to overcome this limitation" (Raeder, 1985).

Page 7: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

7Muhammed Al-Mulhem Visual Languages

• Visual programming represents a conceptually revolutionary departure from the traditional one-dimensional and textual programming languages.

It is stimulated by the following premises:

1) Pictures are more powerful than words as a means of communication. They can convey more meaning in a more concise unit of expression.

2) Pictures aid understanding and remembering.

3) Pictures may provide an incentives for learning program.

Page 8: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

8Muhammed Al-Mulhem Visual Languages

4) Pictures do not have language barriers. When properly designed, they are understood by people regardless of what language they speak.

Page 9: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

9Muhammed Al-Mulhem Visual Languages

• Visual programming has gained momentum in recent years.

• The falling costs of graphics-related hardware and software has made it feasible to use pictures as a mean of communicating with the computers.

• Visual programming is a very young but growing field.

• There is no common agreement on the definition of visual programming.

Page 10: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

10Muhammed Al-Mulhem Visual Languages

2Definitions

• Visual programming languages is a new paradigm.

• There is no single formal definition for VPL. For this reason we will present a number of definitions that appear in the literature.

Page 11: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

11Muhammed Al-Mulhem Visual Languages

1) Chang, 1987

• Visual programming languages, usually deals with objects that do not have an inherent visual representation. This includes traditional data types such as arrays, stacks, and queues and application data types such as forms, documents, and databases. Presenting these objects visually is helpful to the user.

• For the same reason, the languages themselves should be represented visually.

• In other words, both programming constructs and the rules to combine these constructs should be presented visually.

Page 12: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

12Muhammed Al-Mulhem Visual Languages

2) Shu, 1988

• A visual programming language can be informally defined as a language which uses some visual representations ( in addition to or in place of words and numbers) to accomplish what would otherwise have to be written in a traditional one-dimensional programming language.

• Note that this definition imposes no restrictions on the type of data or information.

– It is immaterial whether the object being operated on or being displayed to a user by a visual language is textual, numeric, pictorial, or even audio.

– What is important is that the language itself must employ some meaningful visual expressions as a means of programming.

Page 13: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

13Muhammed Al-Mulhem Visual Languages

3) Tortora, 1990

• A visual language models an icon system. In the icon system, a program consists of a spatial arrangement of pictorial symbols ( elementary icons ).

• Note that, the spatial arrangement is the two-dimensional counterpart of the sequential statements in the traditional programming languages.

– In these languages, a program consists of a string in which terminals are concatenated.

– Concatenation is the only construction rule, therefore it doesn’t appear in the language grammar.

Page 14: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

14Muhammed Al-Mulhem Visual Languages

• In the case of visual languages, three construction rules are used to spatially arrange icons:

– Horizontal concatenation.

– Vertical concatenation.

– Spatial overlay.

• For this reason, there is a need to include both spatial operators and elementary icons in the vocabulary of terminal symbols of the visual language grammar.

• Elementary icons are partitioned into two categories:

– Object icons which identify objects.

– Process icons which express computation.

Page 15: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

15Muhammed Al-Mulhem Visual Languages

4) Al-Mulhem, 1993

• Visual programming languages is a language which uses a combination of text and meaningful graphical symbols to write programs. These graphical/textual symbols represent the following:

a) Data types such as numbers, characters, pictures, and sound.

b) Data structures such as arrays, records, and pointers.

c) Programming constructs such as iteration, selection, and conditional looping.

d) Rules to combine the programming constructs.

Page 16: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

16Muhammed Al-Mulhem Visual Languages

5) Burnett (1999)

• Visual programming is programming in which more than one dimension is used to convey semantics.

• Examples of such additional dimensions are the use of multi-dimensional objects, the use of spatial relationships, or the use of the time dimension to specify “before-after” semantic relationships.

• Each potentially-significant multi-dimensional object or relationship is a token (just as in traditional textual programming languages each word is a token) and the collection of one or more such tokens is a visual expression.

Page 17: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

17Muhammed Al-Mulhem Visual Languages

• Examples of visual expressions used in visual programming include diagrams, free-hand sketches, icons, or demonstrations of actions performed by graphical objects.

• When a programming language’s syntax includes visual expressions, the programming language is a visual programming language (VPL).

Page 18: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

18Muhammed Al-Mulhem Visual Languages

Approaches

• Approaches of research are (Burnett 1999) :

1. Visual approaches to traditional programming languages (executable flowchart).

2. Visual approaches that deviated from traditional programming (programming by demonstration).

Page 19: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

19Muhammed Al-Mulhem Visual Languages

How good are they?

• Good for toy programs.

• Bad for realistically-sized programs.

Page 20: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

20Muhammed Al-Mulhem Visual Languages

More approaches

3. Use VP for selected parts of software development such as:– Incorporating visual techniques into programming

environments:

– To support textual specification of GUI layout

– To support electronic forms of software engineering diagrams.

– To create/visualize relationships among data structures.

– To visually combine textually-programmed units to build new programs.

Page 21: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

21Muhammed Al-Mulhem Visual Languages

Examples

• Visual Basic (for BASIC)

• VisualWork (for SmallTalk)

• CASE tools that support visual specification of relationships among program modules, automatic code generation, …etc.

Page 22: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

22Muhammed Al-Mulhem Visual Languages

More approaches

4. Domain-specific visual programming systems

• Examples:• LabVIEW – programming laboratory data acquestion.

• AVS – programming Scientific Visualization

• PhonePro – programming telephone and voice-mail behavior.

• Cocoa – programming graphical simulations and games.

Page 23: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

23Muhammed Al-Mulhem Visual Languages

What is next?

• VPLs for general-purpose programming.

• This can be reached by:1. Improving the ways VP can be used.

2. Improving domain-specific programming.

Page 24: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

24Muhammed Al-Mulhem Visual Languages

Design Strategies used in VPLs

• Concrete: specify some aspect of semantics on a specific visual object or value.

• Direct: manipulate a specific visual object or value directly to specify semantics.

• Explicit: describe dataflow relationships by drawing directed edges among related variables.

• Immediate visual feedback: automatic display of effects of program edits.

Page 25: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

25Muhammed Al-Mulhem Visual Languages

Classes

There are three classes of VPLs:

• Diagrammatic

• Iconic

• Form-based

Page 26: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

26Muhammed Al-Mulhem Visual Languages

Diagrammatic

• It is based on object-relationship abstractions, for example using nodes and edges.

• Examples:– Entity-Relationship database design languages.

– Data-flow programming languages, e.g. Petri nets.

– Control flow programming languages

– State transition specifications.

Page 27: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

27Muhammed Al-Mulhem Visual Languages

Iconic

• It is based on iconic theory of Chang, 1987.

• Icon is an object with the dual representation of:

– logical part (the meaning)

– Physical part (the image)

• iconic system is a structured set of related icons.

• iconic sentence (visual sentence) is a spatial arrangement of icons from iconic system.

• visual language is a set of iconic sentences constructed with given syntax and semantics.

Page 28: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

28Muhammed Al-Mulhem Visual Languages

Form-based programming

• Borrowed their visualizations and programming metaphors from a spreadsheets.

• Represent programming as altering a group of interconnected cells over time and often allow the programmer to visualize the execution of a program as a sequence of different cell states which progress through time.

• Example: Forms/3

Page 29: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

29Muhammed Al-Mulhem Visual Languages

Types of VPLs

1. Pure visual programming

2. Hybrid (textual / visual) programming

3. Programming-by-example

4. Constraint-based programming

Page 30: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

30Muhammed Al-Mulhem Visual Languages

Pure visual programming

• Programmer manipulate icons to create a program.

• A program is debugged and executed in the same visual environment.

• A program is compiled directly from its visual representation.

• A program is never translated into intermediate text-based language.

• Examples: Prograph, VIPR, and PICT.

Page 31: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

31Muhammed Al-Mulhem Visual Languages

Hybrid (textual / visual) programming

Two forms:

1. Systems in which programs are created visually and then translated into an underlying high-level textual languages.

• Example: Rehearsal World – the user trains the system to solve a particular problem by manipulating graphical actors (icons) and then the system generates a Smalltalk program to implement the solution.

Page 32: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

32Muhammed Al-Mulhem Visual Languages

Hybrid (continue)

2. Systems which involve the use of graphical elements in a textual language.

• Example: Work of Erwig et. al. – developing extensions to languages like C and C++ which allow programmers to mix their text code with diagrams.

• For instance, one can define a linked list data structure textually and then perform an operation like deletion of a node by drawing the steps in the process.

Page 33: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

33Muhammed Al-Mulhem Visual Languages

Programming by example

• Allowing the user to create and manipulate graphical objects with which to teach the system how to perform a particular task.

• Examples: Rehearsal World and Pygmalion

Page 34: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

34Muhammed Al-Mulhem Visual Languages

Constraint-oriented programming

• A programmer models physical objects as objects in the visual environment which are subject to constraints designed to mimic the behavior of natural laws, like gravity.

• Popular for simulation design.

• Examples: ThingLab, ARK

Page 35: 1 Muhammed Al-MulhemVisual Languages Visual Programming Languages ICS 539 Introduction & Classification ICS Department KFUPM Sept. 1, 2007

35Muhammed Al-Mulhem Visual Languages

VPL Orphans

• Algorithm animation systems– Provides interactive graphical displays of executing

programs

– Example: BALSA

• user-interface design systems– Provided with many modern compilers.

– Example: Visual Basic, Visual C++