StepTalk Illusion of Cooperating Objects Environment Š tefan Urb á nek,  August   2003 [email_address]
Contents <ul><li>Motivation </li></ul><ul><li>Illusion </li></ul><ul><li>Framework </li></ul><ul><li>Tools </li></ul><ul><...
Motivation <ul><li>Current s tate </li></ul><ul><ul><li>selfish programs and applications </li></ul></ul><ul><ul><li>probl...
Motivation <ul><li>Needs </li></ul><ul><ul><li>glue </li></ul></ul><ul><ul><ul><li>applications, distributed objects and f...
Inspiration <ul><li>Smalltalk environment </li></ul><ul><ul><li>no applications or programs, just objects </li></ul></ul><...
The Illusion
The Illusion <ul><li>Environment </li></ul><ul><ul><li>Applications </li></ul></ul><ul><ul><ul><li>presented as objects </...
The Illusion <ul><li>How user sees it </li></ul>Mailer app. Chart app. Spreadsheet app.
<ul><li>How it is </li></ul>The Illusion StepTalk Framework Tools StepTalk Framework Mailer app. Chart app. Spreadsheet app.
Framework and Interfaces
Framework <ul><li>Purpose </li></ul><ul><ul><li>hide applications and programs </li></ul></ul><ul><ul><ul><li>by presentin...
Framework <ul><li>Objective C </li></ul><ul><ul><li>NeXTSTEP, OPENSTEP </li></ul></ul><ul><ul><ul><li>the past </li></ul><...
Framework <ul><li>Core </li></ul><ul><ul><li>Objective C </li></ul></ul><ul><ul><ul><li>C    Smalltalk </li></ul></ul></u...
Framework <ul><li>Where does it fit? </li></ul>Object ive C  Runtime StepTalk Framework Application
Framework <ul><li>Interfaces </li></ul>StepTalk Framework Engine Engine Object ive C  Runtime Application
Interfaces <ul><li>Interfaces for application </li></ul><ul><ul><li>application interface advertising </li></ul></ul><ul><...
Interfaces <ul><li>Application interface </li></ul><ul><ul><li>Named objects </li></ul></ul><ul><ul><li>Class descriptions...
Interfaces <ul><li>Script execution </li></ul><ul><ul><li>get the list of available languages </li></ul></ul><ul><ul><li>g...
Interfaces <ul><li>Environment </li></ul><ul><ul><li>object naming and searching </li></ul></ul><ul><ul><ul><li>with dicti...
How It Works <ul><li>Use </li></ul><ul><ul><li>user wants to accomplish a task </li></ul></ul><ul><ul><li>several applicat...
How It Works <ul><li>1. Application advertises </li></ul><ul><ul><li>objects </li></ul></ul><ul><ul><ul><li>user known obj...
How It Works <ul><li>2. Environment is provided </li></ul><ul><ul><li>Framework creates the environment </li></ul></ul><ul...
How It Works <ul><li>3. Script Passing </li></ul><ul><ul><li>user provides script </li></ul></ul><ul><ul><li>application p...
How It Works <ul><li>4. Script execution </li></ul>StepTalk Framework Engine execute script query objects Object Runtime s...
Smalltalk Engine <ul><li>Compilation </li></ul>StepTalk Framework Compiler + <ul><li>byte code array - temporary variables...
Smalltalk Engine <ul><li>Execution </li></ul>bridge StepTalk Framework Bytecode Interpreter Object Runtime + result enviro...
Smalltalk Engine <ul><li>Features </li></ul><ul><ul><li>literal objects </li></ul></ul><ul><ul><ul><li>mapped to Objective...
Tools
Tools <ul><li>Implemented </li></ul><ul><ul><li>Executor </li></ul></ul><ul><ul><ul><li>single script executor </li></ul><...
Tools <ul><li>Shell </li></ul><ul><ul><li>live interaction with object environment </li></ul></ul><ul><li>> mailbox := Mai...
Tools <ul><li>Session </li></ul><ul><ul><li>stand-alone process </li></ul></ul><ul><ul><ul><li>Distributed Objects server ...
Tools <ul><li>Application Scripting </li></ul><ul><ul><li>optional integration </li></ul></ul><ul><ul><li>automatic initia...
Tools <ul><li>Script Objects </li></ul><ul><ul><li>state </li></ul></ul><ul><ul><ul><li>instance variables </li></ul></ul>...
Other Tools <ul><li>Active Script Objects </li></ul><ul><ul><li>stand alone in session environment </li></ul></ul><ul><ul>...
Conclusion <ul><ul><li>applications as objects </li></ul></ul><ul><ul><li>reusability at higher level </li></ul></ul><ul><...
References <ul><li>StepTalk </li></ul><ul><ul><li>http://steptalk.host.sk </li></ul></ul><ul><ul><ul><li>Home Page </li></...
<ul><li>Thank you . </li></ul>
Discussion
Discussion <ul><li>Objective C </li></ul><ul><li>StepTalk/Smalltalk  </li></ul><ul><ul><li>Bytecodes </li></ul></ul><ul><u...
Discussion <ul><li>Objective C </li></ul><ul><ul><li>strict superset of C </li></ul></ul><ul><ul><li>Smalltalk object mode...
Discussion <ul><li>Objective C </li></ul><ul><ul><li>Messages </li></ul></ul><ul><ul><ul><li>[array insertObject:anObject ...
Discussion <ul><li>Smalltalk Bytecodes in StepTalk </li></ul><ul><ul><li>push </li></ul></ul><ul><ul><ul><li>receiver, rec...
Discussion <ul><li>StepTalk to  Objective C Bridge </li></ul><ul><ul><li>take arguments from stack </li></ul></ul><ul><ul>...
Discussion <ul><li>Smalltalk -   Objective C Bridge </li></ul><ul><ul><li>No magic involved </li></ul></ul><ul><ul><li>Emp...
Discussion <ul><li>Object Finders </li></ul><ul><ul><li>Find object referenced by name </li></ul></ul><ul><ul><li>Query na...
Tools <ul><li>Script Objects </li></ul><ul><li>| object method source engine |  </li></ul><ul><li>“  Prepare an object “ <...
About <ul><li>StepTalk </li></ul><ul><li>ESUG 2003 presentation </li></ul><ul><li>© Š tefan Urb á nek  <urbanek@host.sk> ,...
Upcoming SlideShare
Loading in...5
×

Step talk

514

Published on

(ESUG 2003, Bled)

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
514
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • I will not go too deep, I’ll leave techincal details to the discussion section where I will flip back to slides with images and explain moore details. I=ll be speaking about obvious things – for you obvious, but in different light and different use.
  • Many applications that can do everything – from text editing to vegetable refrigerating
  • I’m not talking about smalltalk as application, but as smalltalk environment. Mention squeak.
  • Frameworks or other DOs
  • Combined needs and inspiration, I have came up with an idea of gluing applications together in some environment with objective feeling. Presenting objects as simple tools with known behaviour Communication between user and the framework in scripts
  • Step talk

    1. 1. StepTalk Illusion of Cooperating Objects Environment Š tefan Urb á nek, August 2003 [email_address]
    2. 2. Contents <ul><li>Motivation </li></ul><ul><li>Illusion </li></ul><ul><li>Framework </li></ul><ul><li>Tools </li></ul><ul><li>Conclusion </li></ul>
    3. 3. Motivation <ul><li>Current s tate </li></ul><ul><ul><li>selfish programs and applications </li></ul></ul><ul><ul><li>problem to find the right tool </li></ul></ul>mail reading home page editing web browsing photo retouching vector graphics drawing chat word processing form filling coffee making
    4. 4. Motivation <ul><li>Needs </li></ul><ul><ul><li>glue </li></ul></ul><ul><ul><ul><li>applications, distributed objects and frameworks </li></ul></ul></ul><ul><ul><li>create common environment </li></ul></ul>
    5. 5. Inspiration <ul><li>Smalltalk environment </li></ul><ul><ul><li>no applications or programs, just objects </li></ul></ul><ul><ul><li>simple way of communication with objects </li></ul></ul><ul><ul><li>consistent feel of the environment </li></ul></ul>
    6. 6. The Illusion
    7. 7. The Illusion <ul><li>Environment </li></ul><ul><ul><li>Applications </li></ul></ul><ul><ul><ul><li>presented as objects </li></ul></ul></ul><ul><ul><li>Language(s) </li></ul></ul><ul><ul><ul><li>used for communication </li></ul></ul></ul><ul><ul><li>Script </li></ul></ul><ul><ul><ul><li>describing a task </li></ul></ul></ul>
    8. 8. The Illusion <ul><li>How user sees it </li></ul>Mailer app. Chart app. Spreadsheet app.
    9. 9. <ul><li>How it is </li></ul>The Illusion StepTalk Framework Tools StepTalk Framework Mailer app. Chart app. Spreadsheet app.
    10. 10. Framework and Interfaces
    11. 11. Framework <ul><li>Purpose </li></ul><ul><ul><li>hide applications and programs </li></ul></ul><ul><ul><ul><li>by presenting them as objects </li></ul></ul></ul><ul><ul><li>create common environment </li></ul></ul><ul><ul><li>offer a way for communication </li></ul></ul><ul><ul><ul><li>by using a language </li></ul></ul></ul>
    12. 12. Framework <ul><li>Objective C </li></ul><ul><ul><li>NeXTSTEP, OPENSTEP </li></ul></ul><ul><ul><ul><li>the past </li></ul></ul></ul><ul><ul><li>MacOS X, GNUstep </li></ul></ul><ul><ul><ul><li>the present </li></ul></ul></ul>
    13. 13. Framework <ul><li>Core </li></ul><ul><ul><li>Objective C </li></ul></ul><ul><ul><ul><li>C  Smalltalk </li></ul></ul></ul><ul><ul><li>abstraction layer </li></ul></ul><ul><ul><ul><li>over the Objective C object runtime </li></ul></ul></ul><ul><ul><li>language to runtime mapping </li></ul></ul><ul><ul><ul><li>by translating and executing scripts </li></ul></ul></ul>
    14. 14. Framework <ul><li>Where does it fit? </li></ul>Object ive C Runtime StepTalk Framework Application
    15. 15. Framework <ul><li>Interfaces </li></ul>StepTalk Framework Engine Engine Object ive C Runtime Application
    16. 16. Interfaces <ul><li>Interfaces for application </li></ul><ul><ul><li>application interface advertising </li></ul></ul><ul><ul><ul><li>provide information about application objects </li></ul></ul></ul><ul><ul><li>script execution </li></ul></ul><ul><ul><ul><li>methods for running scripts </li></ul></ul></ul><ul><li>Interfaces for execution </li></ul><ul><ul><li>environment </li></ul></ul><ul><ul><li>language engine </li></ul></ul>
    17. 17. Interfaces <ul><li>Application interface </li></ul><ul><ul><li>Named objects </li></ul></ul><ul><ul><li>Class descriptions </li></ul></ul>Mailer currentMailbox currentMessage mailboxes
    18. 18. Interfaces <ul><li>Script execution </li></ul><ul><ul><li>get the list of available languages </li></ul></ul><ul><ul><li>get engine for particular language </li></ul></ul><ul><ul><li>execute script with arguments </li></ul></ul>
    19. 19. Interfaces <ul><li>Environment </li></ul><ul><ul><li>object naming and searching </li></ul></ul><ul><ul><ul><li>with dictionary or Object Finders </li></ul></ul></ul><ul><ul><li>application connecting </li></ul></ul><ul><ul><li>importing framework classes </li></ul></ul><ul><ul><li>importing bundle objects </li></ul></ul><ul><ul><li>translating strings to selectors </li></ul></ul><ul><ul><ul><li>for given target object </li></ul></ul></ul>
    20. 20. How It Works <ul><li>Use </li></ul><ul><ul><li>user wants to accomplish a task </li></ul></ul><ul><ul><li>several applications are available </li></ul></ul><ul><ul><li>customisation of application behaivour might be needed </li></ul></ul>
    21. 21. How It Works <ul><li>1. Application advertises </li></ul><ul><ul><li>objects </li></ul></ul><ul><ul><ul><li>user known objects that application provides </li></ul></ul></ul><ul><ul><li>behaviour </li></ul></ul><ul><ul><ul><li>methods that application implements </li></ul></ul></ul><ul><ul><ul><li>*Application is a large object in the environment </li></ul></ul></ul>
    22. 22. How It Works <ul><li>2. Environment is provided </li></ul><ul><ul><li>Framework creates the environment </li></ul></ul><ul><ul><ul><li>from application description </li></ul></ul></ul><ul><ul><ul><li>or </li></ul></ul></ul><ul><ul><li>Application provides the environment </li></ul></ul><ul><ul><ul><li>customised for particular task </li></ul></ul></ul>
    23. 23. How It Works <ul><li>3. Script Passing </li></ul><ul><ul><li>user provides script </li></ul></ul><ul><ul><li>application passes to the framework </li></ul></ul><ul><ul><li>framework passes to the engine </li></ul></ul>StepTalk Framework Engine Engine Application
    24. 24. How It Works <ul><li>4. Script execution </li></ul>StepTalk Framework Engine execute script query objects Object Runtime send messages Scripting Environment
    25. 25. Smalltalk Engine <ul><li>Compilation </li></ul>StepTalk Framework Compiler + <ul><li>byte code array - temporary variables - external references - literal objects </li></ul>environment script compiled method
    26. 26. Smalltalk Engine <ul><li>Execution </li></ul>bridge StepTalk Framework Bytecode Interpreter Object Runtime + result environment compiled method
    27. 27. Smalltalk Engine <ul><li>Features </li></ul><ul><ul><li>literal objects </li></ul></ul><ul><ul><ul><li>mapped to Objective C classes </li></ul></ul></ul><ul><ul><li>blocks </li></ul></ul><ul><ul><li>exception handling </li></ul></ul><ul><ul><li>collection enumerating </li></ul></ul>
    28. 28. Tools
    29. 29. Tools <ul><li>Implemented </li></ul><ul><ul><li>Executor </li></ul></ul><ul><ul><ul><li>single script executor </li></ul></ul></ul><ul><ul><li>Shell </li></ul></ul><ul><ul><ul><li>interactive object “chat” </li></ul></ul></ul><ul><li>Future </li></ul><ul><ul><li>Session </li></ul></ul><ul><ul><ul><li>semi-persistent glue and environment </li></ul></ul></ul>
    30. 30. Tools <ul><li>Shell </li></ul><ul><ul><li>live interaction with object environment </li></ul></ul><ul><li>> mailbox := Mail currentMailbox </li></ul><ul><li>Mailbox </li></ul><ul><li>> mailbox messages count </li></ul><ul><li>50 </li></ul><ul><li>> mailbox select: [:message | ^message isRead ] </li></ul><ul><li>Array </li></ul><ul><li>0 Message </li></ul><ul><li>1 Message </li></ul><ul><li>2 Message … </li></ul>
    31. 31. Tools <ul><li>Session </li></ul><ul><ul><li>stand-alone process </li></ul></ul><ul><ul><ul><li>Distributed Objects server </li></ul></ul></ul><ul><ul><li>cooperative environment </li></ul></ul><ul><ul><ul><li>of Distributed Objects, Applications and Frameworks </li></ul></ul></ul><ul><ul><li>live connections to live objects </li></ul></ul><ul><ul><ul><li>by using DO </li></ul></ul></ul><ul><ul><li>semi-persistent </li></ul></ul><ul><ul><ul><li>with ability to partially archive environment state </li></ul></ul></ul>
    32. 32. Tools <ul><li>Application Scripting </li></ul><ul><ul><li>optional integration </li></ul></ul><ul><ul><li>automatic initialisation </li></ul></ul><ul><ul><li>provided user interface </li></ul></ul>
    33. 33. Tools <ul><li>Script Objects </li></ul><ul><ul><li>state </li></ul></ul><ul><ul><ul><li>instance variables </li></ul></ul></ul><ul><ul><li>dictionary of behaviour </li></ul></ul><ul><ul><ul><li>method dictionary </li></ul></ul></ul>
    34. 34. Other Tools <ul><li>Active Script Objects </li></ul><ul><ul><li>stand alone in session environment </li></ul></ul><ul><ul><li>illusion of incremental programming </li></ul></ul>
    35. 35. Conclusion <ul><ul><li>applications as objects </li></ul></ul><ul><ul><li>reusability at higher level </li></ul></ul><ul><ul><li>user orientation </li></ul></ul><ul><ul><li>Smalltalk approach to the object environment </li></ul></ul>
    36. 36. References <ul><li>StepTalk </li></ul><ul><ul><li>http://steptalk.host.sk </li></ul></ul><ul><ul><ul><li>Home Page </li></ul></ul></ul><ul><ul><li>http://wiki.gnustep.org/index.php/Scripting </li></ul></ul><ul><ul><ul><li>Scripting with StepTalk </li></ul></ul></ul><ul><li>GNUstep </li></ul><ul><ul><li>http://www.gnustep.org </li></ul></ul><ul><ul><ul><li>Home Page </li></ul></ul></ul>
    37. 37. <ul><li>Thank you . </li></ul>
    38. 38. Discussion
    39. 39. Discussion <ul><li>Objective C </li></ul><ul><li>StepTalk/Smalltalk </li></ul><ul><ul><li>Bytecodes </li></ul></ul><ul><ul><li>Bridge </li></ul></ul><ul><li>Object Finders </li></ul>
    40. 40. Discussion <ul><li>Objective C </li></ul><ul><ul><li>strict superset of C </li></ul></ul><ul><ul><li>Smalltalk object model </li></ul></ul><ul><ul><ul><li>un-typed objects, class objects, … </li></ul></ul></ul><ul><ul><li>reflection </li></ul></ul><ul><ul><li>dynamic binding </li></ul></ul><ul><ul><li>dynamic loading </li></ul></ul><ul><ul><li>message forwarding and delegation </li></ul></ul>
    41. 41. Discussion <ul><li>Objective C </li></ul><ul><ul><li>Messages </li></ul></ul><ul><ul><ul><li>[array insertObject:anObject atIndex:index] </li></ul></ul></ul><ul><ul><ul><li>obj = [dict objectForKey:someKey] </li></ul></ul></ul><ul><ul><li>Reflection </li></ul></ul><ul><ul><ul><li>respondsToSelector:, isTypeOf:, isKindOf: </li></ul></ul></ul><ul><ul><ul><li>class, superclass, … </li></ul></ul></ul><ul><ul><li>Forwarding </li></ul></ul><ul><ul><ul><li>doesNotRecognize:, forwardInvocation: </li></ul></ul></ul>
    42. 42. Discussion <ul><li>Smalltalk Bytecodes in StepTalk </li></ul><ul><ul><li>push </li></ul></ul><ul><ul><ul><li>receiver, receiver variable, extern, temporary, literal </li></ul></ul></ul><ul><ul><li>pop and store </li></ul></ul><ul><ul><ul><li>receiver variable, extern, temporary </li></ul></ul></ul><ul><ul><li>send selector </li></ul></ul><ul><ul><li>duplicate top, pop </li></ul></ul><ul><ul><li>block copy </li></ul></ul><ul><ul><li>return </li></ul></ul>
    43. 43. Discussion <ul><li>StepTalk to Objective C Bridge </li></ul><ul><ul><li>take arguments from stack </li></ul></ul><ul><ul><li>take receiver and selector </li></ul></ul><ul><ul><li>create method signature for receiver </li></ul></ul><ul><ul><li>convert argument objects to C values </li></ul></ul><ul><ul><li>create invocation </li></ul></ul><ul><ul><li>invoke </li></ul></ul><ul><ul><li>convert and return return value </li></ul></ul>
    44. 44. Discussion <ul><li>Smalltalk - Objective C Bridge </li></ul><ul><ul><li>No magic involved </li></ul></ul><ul><ul><li>Empty proxies </li></ul></ul><ul><ul><li>Forwarding </li></ul></ul>
    45. 45. Discussion <ul><li>Object Finders </li></ul><ul><ul><li>Find object referenced by name </li></ul></ul><ul><ul><li>Query name dictionary or service </li></ul></ul><ul><ul><li>Launch application or DO server </li></ul></ul><ul><ul><ul><li>if not already launched </li></ul></ul></ul><ul><ul><li>Create connection </li></ul></ul><ul><ul><li>Return distant object proxy </li></ul></ul>
    46. 46. Tools <ul><li>Script Objects </li></ul><ul><li>| object method source engine | </li></ul><ul><li>“ Prepare an object “ </li></ul><ul><li>object := STScriptObject scriptObject. </li></ul><ul><li>engine := STEngine </li></ul><ul><li>engineForLanguageWithName:'Smalltalk'. </li></ul><ul><li>“ Build a method” </li></ul><ul><li>source := 'sayHi Transcript show: 'Hi.'. ^self'. </li></ul><ul><li>method := engine methodFromSource:source </li></ul><ul><li>forReceiver:object </li></ul><ul><li>inEnvironment:Environment. </li></ul><ul><li>&quot; Add the method to the object &quot; </li></ul><ul><li>object addMethod:method. </li></ul><ul><li>object sayHi. </li></ul>
    47. 47. About <ul><li>StepTalk </li></ul><ul><li>ESUG 2003 presentation </li></ul><ul><li>© Š tefan Urb á nek <urbanek@host.sk> , August 200 3 </li></ul>
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×