Title: Programming%20in%20Several%20Dimensions
1(No Transcript)
2Programming in Several Dimensions
- Paul Lyons
- Massey University
3Textual Languages are One-dimensional
How about programs?
Computers are sequential.
Input devices Output devices Memory
addresses Accumulator Buses Parsers
Flow of control Sequential syntax Tree-structured
semantics Declarations Tree-structured Inverted
w.r.t. procedures I/O Asynchronous
4Computers Support Multi-dimensionality
Power Easy 2-D input High-res 2-D and 3-D
graphic output Multiple window support
Synchronous updating Hyperlinks
5A Multi-dimensional Language
Desiderata
High-level
Multiple views Non-sequential access Easy
editing Efficient space use
Mid-level
Control relationships Text where
appropriate Graphics where appropriate
Low-level
Group related concepts Purge brackets
6HyperPascal
Visualisations
hyperlinks
Action Tree
Scope Tree
7HyperPascal
Visualisations
hyperlinks
Action Tree
Scope Tree
8HyperPascal
Visualisations
hyperlinks
Scope Tree
Action Tree
9HyperPascal
Visualisations
hyperlinks
Scope Tree
Action Tree
10HyperPascal
Structure Template Visualisation
Dot-and-caret notation
Pictorial notation
new(newNode) newNode.data x if L nil
then begin L newNode.next L
newNode end else begin parent nil
thisNode L status running while
status running do begin if
(thisNode.data gt x) or (thisNode nil)_then
begin newNode.next thisNode if
parent nil then L newNode else
parent.next newNode status
finished end then clause else begin
parent thisNode thisNode
thisNode.next end if end end
11 new(newNode) newNode.data x if L nil
then begin newNode.next L L
newNode end else begin L isnt nil parent
nil thisNode L status running
while status running do begin if
(thisNode.data gt x) or (thisNode nil)_then
begin newNode.next thisNode if
parent nil then L newNode else
parent.next newNode status
finished end then clause else begin the
node goes somewhere else parent
thisNode thisNode thisNode.next end
if end end
HyperPascal
Structure Template Visualisation
Dot-and-caret notation
Pictorial notation
new(newNode) newNode.data x if L nil
then begin L newNode.next L
newNode end else begin parent nil
thisNode L status running while
status running do begin if
(thisNode.data gt x) or (thisNode nil)_then
begin newNode.next thisNode if
parent nil then L newNode else
parent.next newNode status
finished end then clause else begin
parent thisNode thisNode
thisNode.next end if end end
12 new(newNode) newNode.data x if L nil
then begin newNode.next L L
newNode end else begin L isnt nil parent
nil thisNode L status running
while status running do begin if
(thisNode.data gt x) or (thisNode nil)_then
begin newNode.next thisNode if
parent nil then L newNode else
parent.next newNode status
finished end then clause else begin the
node goes somewhere else parent
thisNode thisNode thisNode.next end
if end end
parent thisNode thisNode
thisNode.next
13HyperPascal
Structure Template Visualisation
Dot-and-caret notation
Pictorial notation
new(newNode) newNode.data x if L nil
then begin L newNode.next L
newNode end else begin parent nil
thisNode L status running while
status running do begin if
(thisNode.data gt x) or (thisNode nil) then
begin newNode.next thisNode if
parent nil then L newNode else
parent.next newNode status
finished end then clause else begin
parent thisNode thisNode
thisNode.next end if end end
14HyperPascal
Pictorial declarations
15HyperPascal
16HyperPascal
Easy-to-draw pictures
17HyperPascal
Easy-to-draw pictures
18HyperPascal
Easy-to-draw pictures
19HyperPascal
Easy-to-draw pictures
gtx
20HyperPascal
Easy-to-draw pictures
gtx
21HyperPascal
Easy-to-draw pictures
gtx
22HyperPascal
Easy-to-draw pictures
gtx
23HyperPascal
Easy-to-draw pictures
x
gtx
24HyperPascal
Easy-to-draw pictures
if thisNode ltgt nil then if thisNode.data gt x
then generate after-picture1
else thisNode ltgt nil and thisNode.data ltx
generate after-picture 2
else thisNode nil
generate after-picture 3
25HyperPascal
Three-layer architecture
Draw commands
User actions
(undistorted coordinates)
(undistorted coordinates)
Object association information
Redraw messages
(coordinate-free)
(coordinate-free)
26HyperPascal
FIN
27(No Transcript)
28HyperPascal
Easy-to-draw pictures
if thisNode ltgt nil then if thisNode.data gt x
then generate after-picture1 else
thisNode.data ltx generate after-picture
2 else thisNode nil generate after-picture
3
if L ltgt nil then if L.data gt x then generate
after-picture1 else L.data ltx generate
after-picture 2 else L nil
if L ltgt nil then if L.data gt x then generate
after-picture1 else L.data ltx generate
after-picture 2