Skip to main content

Une implémentation des coroutines en Lisp, application à Smalltalk

  • Conference paper
  • First Online:
International Symposium on Programming (Programming 1984)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 167))

Included in the following conference series:

  • 137 Accesses

Resumé

Le couple 〈detach resume〉 réalise pour Simula un mécanisme d'interruption-reprise connu sous le terme générique de coroutine.

Le but de ce papier est d'étudier la signification d'un tel mécanisme dans un univers applicatif. Pour ce faire nous isolons un domaine de Lisp, celui du séquentiel pur (progn) et nous montrons comment implémenter le couple 〈detach, resume〉 sur ce domaine réduit. Cette implémentation ne requiert l'adjonction d'aucune primitive, n'utilise aucune connaissance concernant l'architecture de l'interprète Lisp (la fluidité des variables et la liaison superficielle étant admises) et ne fait aucune hypothèse quant à la structure de la pile.

Nous montrons à partir d'un exemple pris dans le domaine du calcul parallèle comment les coroutines s'expriment dans une vision Lisp récursive: il suffit d'ajouter au modèle précédent un mécanisme de fermeture puis d'exprimer les calculs récursifs en utilisant explicitement (`a la Plasma) la continuation. Est alors établi la complémentarité du couple 〈detach closure〉 qui marie à nouveau un échappement à une fermeture.

Smalltalk est une extension de Lisp par les classes hiérarchisées et la transmission de messages. Un objet est aussi une fermeture, il nous est donc suggéré d'exprimer le mécanisme des coroutines dans l'univers des classes. Cette expression prend un aspect original, puisqu'elle nous conduit à introduire la notion de méthodes d'instance: une méthode interrompue provoque la création d'une méthode de reprise non pas dans la classe mais directement dans l'objet receveur. Sont alors traités deux exemples, le premier montrant la génération puis la synchronisation de deux streams, le second traitant un algorithme de backtracking.

En conclusion, nous considérons que iprogn est un palliatif Lisp au calculparallèle, comme l'était déjà closure pour le funarg. Cette approche, à la P. Greussay, exprime pour tout Lisp un mécanisme portable de rupture de séquence et motive la réalisation d'algorithmes nouveaux.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

5. References

  1. G. Birtwistle, O. Dahl, B Myhrhaug, et K Nygaard, SIMULA BEGIN, Petrocelli/Charter, New York (1973).

    Google Scholar 

  2. J.P. Briot, “L'instanciation dans les languages objets,” Bigre, (37) pp. 173–209 (Décembre 83).

    Google Scholar 

  3. J. Chailloux, Le Lisp 80 (version 12), INRIA rapport technique No: 27 (Juillet 83).

    Google Scholar 

  4. E. Charniak, C. R. Riesbek, et D. V. Mc-Dermott, Artificial intelligence programming, LEA Lawrence Erlbaum associates, New Jersey (1980).

    Google Scholar 

  5. T. Christaller, Ein Objektorientierter Ansatz fur die Realisierung komplexer Kontroüstrukturen, Objektorientierte Software-und Hardware-architekturen, Berlin (5. und 6.5 1983).

    Google Scholar 

  6. P. Cointe, “Fermetures dans les λ-Interprètes: Application aux Languages LISP, PLASMA et SMALLTALK,” LITP 82–11, Université Paris VI, Paris (Décembre 1981). thèse de 3ième cycle

    Google Scholar 

  7. P. Cointe, “Evaluation of Object-oriented Programming from Simula to Smalltalk,” pp. 17–24 dans Proceedings of the Eleventh Simula Users' Conference, SIMULA INFORMATION, Paris (7th–9th September 1983).

    Google Scholar 

  8. P. Cointe, “A VLISP Implementation of SMALLTALK-76,” pp. 89–102 dans Integrated Interactive Computing Systems, ed. P. Degano & E. Sandewall, North-Holland, Amsterdam, New York, Oxford (1983).

    Google Scholar 

  9. P. Cointe, “Objvlisp: une extension de Vlisp par les Objets,” Science of Computer Programming., (1984). à paraître

    Google Scholar 

  10. O. Dahl, B. Myhrhaug, et K. Nygaard, “COMMON BASE LANGUAGE,” S-22, Norvegian Computing Center, Oslo (October 1970). SIMULA information

    Google Scholar 

  11. J.L. Durieux, Sémantique des liaisons nom-valeur: application à l'implémentation des λ-langages, Université Paul Sabatier, Toulouse (Septembre 81). thèse d'Etat

    Google Scholar 

  12. A. Goldberg et D. Robson, SMALLTALK-80 The Language and its Implementation, Addison-Wesley Publishing Compagny (1983).

    Google Scholar 

  13. P. Greussay, Contribution à la définition interprétative et à l'implémentation des λ-langages, Université Paris 7 (Novembre 1977). thèse d'Etat

    Google Scholar 

  14. P. Greussay, “Le Système VLISP-UNIX,” Département Informatique, Université Paris 8 — Vincennes (Février 1982). Draft

    Google Scholar 

  15. C. E. Hewitt et B. Smith, A PLASMA Primer, MIT Artificial Intelligence Laboratory (September 1975). Draft

    Google Scholar 

  16. C. E. Hewitt, “Viewing Control Structures as Patterns of Message passing,” A.I. MEMO 410, MIT (December 1976).

    Google Scholar 

  17. E. Horowitz, Fundamentals of Programming Languages, Springer-Verlag, Berlin-Heidelberg New York (1983).

    Google Scholar 

  18. D. H. Ingalls, “The Smalltalk-76 Programming System Design and Implementation,” dans Conference Record of the 5th Annual ACM Symposium on Principles of Programming Languages, Tucson (January 1978).

    Google Scholar 

  19. A. Kay et A. Goldberg, “SMALLTALK-72 Instruction Manual,” SSL 76-6, Xerox Palo Alto Research Center, Palo Alto, CA. (March 1976).

    Google Scholar 

  20. P. McKay et C. Shapiro, MULTI — A LISP Based Multiprocessing System, Conference Record of the 1980 LISP Conference, Stanford (August 25–27 1980).

    Google Scholar 

  21. J. R. Meehan, The new UCI LISP manual, LEA Hillsdale, New Jersey (1979).

    Google Scholar 

  22. D. A. Moon, R. Stallman, et D. Weinreb, LISP MACHINE MANUAL (fifth edition), MIT, Cambridge, Mass. (January 83).

    Google Scholar 

  23. J. Rees et I. Adams, T: A Dialect of Lisp or, LAMBDA: The Ultimate Software Tool, Conference Record of the 1982 ACM symposium on LISP and Functional Programming, Pittsburgh (1982).

    Google Scholar 

  24. B. Serpette, Une extension de LISP vers les processus, Soumis a publication au 6 ème colloque international sur la programmation Octobre 1983.

    Google Scholar 

  25. B. Serpette, Un modèle d'implémentation des processus dans les langages applicatifs., Draft Fevrier 84.

    Google Scholar 

  26. G.L. Steele et G.J. Sussman, “SCHEME: An Interpreter for Extended λ Calculus,” Memo 349, MIT Artificial Intelligence Laboratory (December 1975).

    Google Scholar 

  27. W. Teitelman, INTERLISP Reference Manual, Xerox Palo Alto Research Center, Palo Alto (October 1978). 3rd revision

    Google Scholar 

  28. M. Wand, Continuation-based Multiprocessing, Conference Record of the 1980 LISP Conference, Stanford (August 25–27, 1980).

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

M. Paul B. Robinet

Rights and permissions

Reprints and permissions

Copyright information

© 1984 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Cointe, P. (1984). Une implémentation des coroutines en Lisp, application à Smalltalk. In: Paul, M., Robinet, B. (eds) International Symposium on Programming. Programming 1984. Lecture Notes in Computer Science, vol 167. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-12925-1_29

Download citation

  • DOI: https://doi.org/10.1007/3-540-12925-1_29

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-12925-7

  • Online ISBN: 978-3-540-38809-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics