1 / 25

Natural Object-Oriented Programming: The Evolution Metaphor In Elica

ISSEP 2006 Nov 7-11 Vilnius Lithuania. Natural Object-Oriented Programming: The Evolution Metaphor In Elica. Pavel Boytchev Dept. of Information Technologies Faculty of Mathematics & Informatics University of Sofia elica@fmi.uni-sofia.bg. Topics. What is Elica? What is Natural OOP?

tan
Download Presentation

Natural Object-Oriented Programming: The Evolution Metaphor In Elica

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. ISSEP 2006 Nov 7-11 Vilnius Lithuania Natural Object-Oriented Programming:The Evolution Metaphor In Elica

  2. Pavel Boytchev Dept. of Information Technologies Faculty of Mathematics & Informatics University of Sofia elica@fmi.uni-sofia.bg

  3. Topics • What is Elica?What is Natural OOP? • Evolution Metaphors in Elica • Examples of Natural OOP applications

  4. What is Elica?What is Natural OOP? Concepts and features of NOOP Comparison with traditional OOP

  5. Elica • One of the 160+ Logo dialects • Flexibility to the extreme • Composing names and code at run-time • Dynamic modification of objects • Experimenting with different programming styles • 3D graphics, animation, modeling • Natural OOP

  6. OOP and Natural OOP • OOP • collection of concepts, tools and styles • requires changes in language syntax (C, Pascal, Logo) • complex terminology (class, instance, inherit, method…) • Natural OOP • extended collection of concepts, tools and styles • no changes in language syntax • no special data structures for OOP elements • no special procedures and functions to manage OOP • no new terminology

  7. type TPoint = class fx : integer; fy : integer; public constructor Create(x,y:integer); function Distance:real; end; constructor TPoint.Create(x,y:integer); begin fx:=x; fy:=y; end; function TPoint.Distance:real; begin Result:=Sqrt(fx*fx+fy*fy); end; OOP vs NOOP Example Problem: Make class POINT with fields X and Y and method Distance. • using Delphi OOP • using Elica NOOP to point :x :yto distanceoutput sqrt :x*:x+:y*:y end end

  8. Evolution Metaphors in Elica Emergent evolutions

  9. NOOP • NOOP itself is like an evolution: Classes  species Instances individual creatures Fields  characteristics Methods  behaviour Inheritance genealogical relations

  10. Object Creation • Creating an object is like giving birth to a creature • This is a common metaphor in all OOPs • An creature in Nature can be born in many ways – agamic reproduction, sexual reproduction, cloning, etc • Most OOP support only one way of creation

  11. Creating by Assignment • The most primitive creatures on Earth reproduce themselves by fission (agamic reproduction). Technically, this means creating a creature as an exact copy of another one. MAKE "PETER :TOM

  12. Creating Field by Field • Explicit creating of an object field by field is like playing God. The user has a total control over her Elica-based microworld and can create creatures by enumerating their properties and behaviours. MAKE "JERRY.AGE 55 MAKE "JERRY.HEIGHT 180

  13. Creating by Modification • This creation corresponds to mutation. Mutations could change the appearance and the behaviour of a creature to the extend that it looks as a different specie. Some mutations are fatal or even lethal. MAKE "JANE :TOM MAKE "JANE.EYES "BLUE

  14. Creating from Classes • Using classes is like giving a birth to a new creature. Its specie determines its features. TO HUMAN :AGE :HEIGHT defining human properties END MAKE "PAUL HUMAN 15 160MAKE "MARIA HUMAN 21 175

  15. Interpretations • In an atheistic context:Mammal’s pregnancy – embryos are being developed inside the parent, and delivery is when the new body is taken out. • In a religious context:Creating is close to incarnation. The result of executing a class is the spirit incarnated into a variable-receptionist. • In a Hollywood context:Dead procedures are brought back to life. An appropriate name for these beings is procedure-zombies.

  16. Identification of Objects Two methods for identification of objects: (lack of instanceOf( ), className( ), etc…) • A local variable containing the name of the class corresponds to creatures that know what they are, like dolphins and maybe … humans. • Recognition by properties is related to more primitive creatures that recognize themselves by the smell and other senses.

  17. Inheritance • Supported are single inheritance (for partheno-genesis species), and inheritance from two parents. There is also multiple inheritance (adoption) and conditional inheritance (guardianship). TO MAN :AGE :HEIGHT TO WOMAN :AGE :HEIGHT RUN :HUMAN RUN :HUMAN LOCAL "SEX LOCAL "SEX MAKE "SEX "MALE MAKE "SEX "FEMALE END END

  18. Demonstrations

  19. Five Flying Turtles Start

  20. Pythagorean Theorem Start

  21. Initial condition Proof Pythagorean Theorem

  22. Pythagorean Theorem Initial condition & Proof Initial condition & Proof

  23. The Day Before Yesterday • I woke up at 3 am… • willing to go to a special place • but it was too early to go by car • and it was too far to go by foot, • so I went there by … Logo. • Could you guess the name of this place? Start

  24. The Island Castle In Trakai

  25. The End

More Related