1 / 23

Visual Programming Languages ICS 519 Paradigms

Visual Programming Languages ICS 519 Paradigms. ICS Department KFUPM Feb. 1, 2005. Paradigms. Imperative Languages: The features (Von Neumann architecture) are: Variables

conan
Download Presentation

Visual Programming Languages ICS 519 Paradigms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Visual Programming LanguagesICS 519Paradigms ICS Department KFUPM Feb. 1, 2005

  2. Paradigms • Imperative Languages: • The features (Von Neumann architecture) are: • Variables • Assignment • Control Structures

  3. Textual Example main() { int i; for ( i=0 ; i<10 ; ++i) printf(" %d\n " , i); }

  4. Pascal-BLOX Language Visual Example

  5. 2) Functional (Applicative) Languages • Function • Atom • List • Recursion

  6. Textual Example (DEFINE (equal list1 list2) (COND ((ATOM? list1) (EQ? list1 list2)) ((ATOM? List2) NIL) ((equal (CAR list1) (CAR list2)) (equal (CDR list1) (CDR list2))) (ELSE NIL) ))

  7. Visual Example • Clarity Language

  8. 3) Object Oriented • Class • Object • Message passing

  9. Textual Example 5 - 3 2 (3<5) ifTrue: [17] 17 i ← 2 [i<=9]whileTrue:[i print. i ← i + 3] 2 5 8

  10. Visual Example • Prograph is an example of a visual OOLs. • It has a visual representation for the following OOP concepts: • Classes • Methods • Parallelism • Sequencing • Iteration • Conditional • Look at the next figure.

  11. Prograph Language

  12. 4) Logic languages • list • predicate • rule • goal

  13. Example • parent(X, Y) :- mother(X, Y). • parent(X, Y) :- father(X, Y). • grandparent(X, Z) :- parent(X, Y),parent(Y, Z). • parent(ali, ahmd). • parent(mohmd, ali). • grandparent(ahmd)

  14. Visual Example Logic Languages • Variable • Constant

  15. Predicate q() q(x) q(a,b) q q q a b

  16. person • Rule • person(x):-mother(x,y),father(x,y) mother father

  17. person person ali person • program Mother Father

  18. 5) Dataflow Languages • Programs are represented by a directed graph. • Nodes • Arcs • Johnston, Hanna, and Millar, “Advances in Dataflow Programming Language”, ACM Computing Survey, Vol. 36, No. 1, March 2004, pp.1-34.

  19. Pure Dataflow Model • Programs are represented by a directed graph. • Nodes are primitive instructions such as arithmetic and comparison operations. • Arcs represent the data dependencies between the instructions. • Conceptually, data flows as tokens along the arcs which behave like unbounded first-in, first-out (FIFO) queues. • Arcs that flow toward a node are said to be input arcs to that node, while those that flow away are said to be output arcs from that node.

  20. Pure Dataflow Model (Continue) • When the program begins, special activation nodes place data onto certain key input arcs, triggering the rest of the program. • Whenever a specific set of input arcs of a node (called a firing set) has data on it, the node is said to be fireable. • A fireable node is executed at some undefined time after it becomes fireable. The result is that it removes a data token from each node in the firing set, performs its operation, and places a new data token on some or all of its output arcs. • It then ceases execution and waits to become fireable again.

  21. Pure Dataflow Model (Continue) • By this method, instructions are scheduled for execution as soon as their operands become available. • This stands in contrast to the von Neumann execution model, in which an instruction is only executed when the program counter reaches it, regardless of whether or not it can be executed earlier than this. • The key advantage is that, in dataflow, more than one instruction can be executed in parallel.

  22. Example

  23. Under the von Neumann execution model, the program in Figure 1(a) would execute sequentially in three time units. • Under the dataflow execution model, the program in Figure 1(b) would execute sequentially in two time units. • It is clear that dataflow provides the potential to provide a substantial speed improvement by utilizing data dependencies to locate parallelism.

More Related