A Small-Step Semantics of a Concurrent Calculus with Goroutines and Deferred Functions

  • Martin Steffen
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9660)


In this paper, we present a small-step operational semantics for a small concurrent language supporting deferred function calls and related constructs in the style of the Go programming language. For lexical scoping, the presence of higher-order functions, but also the presence of the \(\mathrel {\mathtt {defer}}\)-command, requires the notion of closures in the semantics.


Function Body Operational Semantic Sequential Composition Abstract Syntax Concurrent Execution 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.



I am also grateful for the thorough, insightful, and detailed feedback from the anonymous reviewers which helped improving the paper.


  1. 1.
    Ábrahám, E., de Boer, F.S., de Roever, W.-P., Steffen, M.: A deductive proof system for multithreaded Java with exceptions. Fundam. Informaticae 82(4), 391–463 (2008). (73 pages), An extended version of the 2005 conference contribution to FSEN 2005 and a reworked and shortened version of the University of Kiel, Department of Computer Science Technical report 0303MathSciNetzbMATHGoogle Scholar
  2. 2.
    America, P.: Issues in the design of a parallel object-oriented language. Formal Aspects Comput. 1(4), 366–411 (1989)CrossRefzbMATHGoogle Scholar
  3. 3.
    Ancona, D., Lagorio, G., Zucca, E.: A core calculus for Java exceptions. SIGPLAN Not. 36, 16–30 (2001)CrossRefGoogle Scholar
  4. 4.
    Anton, K., Thiemann, P.: Typing coroutines. In: Page, R., Horváth, Z., Zsók, V. (eds.) TFP 2010. LNCS, vol. 6546, pp. 16–30. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  5. 5.
    Baker, H., Hewitt, C.: The incremental garbage collection of processes. ACM Sigplan Not. 12, 55–59 (1977)CrossRefGoogle Scholar
  6. 6.
    Belsnes, D., Østvold, B.M.: Mixing threads and coroutines, Unpublished manuscript (2005)Google Scholar
  7. 7.
    Berdine, J., O’Hearn, P., Reddy, U., Thielecke, H.: Linear continuation-passing. Higher-Order Symbolic Comput. 15(2–3), 181–208 (2002)CrossRefzbMATHGoogle Scholar
  8. 8.
    Conway, E.M.: Design of a separable transition-diagram compiler. Commun. ACM 6(7), 396–408 (1963)CrossRefzbMATHGoogle Scholar
  9. 9.
    Dahl, O.-J., Myhrhaug, B., Nygaard, K.: Simula 67, common base language. Technical report S-2, Norsk Regnesentral (Norwegian Computing Center), Oslo, Norway, May 1968Google Scholar
  10. 10.
    de Boer, F.S.: Reasoning about Dynamically Evolving Process Structures. A Proof Theory for the Parallel Object-Oriented Language POOL. Ph.D. thesis, Free University of Amsterdam (1991)Google Scholar
  11. 11.
    de Boer, F.S., Clarke, D., Johnsen, E.B.: A complete guide to the future. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 316–330. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  12. 12.
    de Moura, A.L., Rodriguez, N., Ierusalimschy, R.: Coroutines in Lua. J. Univ. Comput. Sci. 10, 910–925 (2004)Google Scholar
  13. 13.
    Donovan, A.A.A., Kernighan, B.W.: The Go Programming Language. Addison-Wesley (2015)Google Scholar
  14. 14.
    Evans Jr., A.: PAL – a language designed for teaching programming linguistics. In: Proceedings of the 1968 23rd ACM National Conference, pp. 395–403. ACM, New York (1968)Google Scholar
  15. 15.
    Evans Jr., A.: PAL: pedagogic algorithmic language: a reference manual and primer. Unpublished report, Department of Electrical Engineering, MIT (1968)Google Scholar
  16. 16.
    Felleisen, M., Friedman, D.P.: Control operators, the SECD-machine, and the \(\lambda \)-calculus. In: Wirsing, M. (ed.) Formal Description of Programming Concepts III, pp. 193–217. North-Holland, Amsterdam (1986)Google Scholar
  17. 17.
    Flanagan, C., Sabry, A., Duba, B.F., Felleisen, M.: The essence of compiling with continuations. In: ACM Conference on Programming Language Design and Implementation (PLDI), pp. 237–247. ACM, June 1993. In SIGPLAN Notices 28(6)Google Scholar
  18. 18.
    The Go programming language specification, August 2015.
  19. 19.
    Google. The Go programming language (2014).
  20. 20.
    Gordon, A.D., Hankin, P.D., Lassen, S.B.: Compilation and equivalence of imperative objects. In: Ramesh, S., Sivakumar, G. (eds.) FST TCS 1997. LNCS, vol. 1346, pp. 74–87. Springer, Heidelberg (1997). Full version available as Technical report 429, University of Cambridge Computer Laboratory, June 1997CrossRefGoogle Scholar
  21. 21.
    Halstead Jr., R.H.: Multilisp: a language for concurrent symbolic computation. ACM Trans. Program. Lang. Syst. 7(4), 501–538 (1985)CrossRefzbMATHGoogle Scholar
  22. 22.
    Hoare, C.A.R.: Communicating sequential processes. Commun. ACM 21(8), 666–677 (1978)MathSciNetCrossRefzbMATHGoogle Scholar
  23. 23.
    Hoare, C.A.R.: Communicating Sequential Processes. Prentice-Hall, Englewood Cliffs (1985)zbMATHGoogle Scholar
  24. 24.
    Apple Inc.: Swift. A modern programming language that is safe, fast, and interactive, October 2015.
  25. 25.
    Jeannin, J.B.: Capsules and closures: a small-step approach. Electron. Notes Theor. Comput. Sci. 276, 191–293 (2011). Proceedings of the Twenty-seventh Conference on the Mathematical Foundations of Programming Semantics (MFPS XXVII)MathSciNetCrossRefzbMATHGoogle Scholar
  26. 26.
    Jeannin, J.B., Kozen, D.: Computing with capsules. Technical report, Computing and Information Science, Cornell University, January 2011Google Scholar
  27. 27.
    Johnsson, T.: Lambda lifting: transforming programs to recursive equations. In: Jouannaud, J.-P. (ed.) FPCA 1985. LNCS, vol. 201, pp. 190–203. Springer, Heidelberg (1985)CrossRefGoogle Scholar
  28. 28.
    Laird, J.: A calculus of coroutines. In: Díaz, J., Karhumäki, J., Lepistö, A., Sannella, D. (eds.) ICALP 2004. LNCS, vol. 3142, pp. 882–893. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  29. 29.
    Landin, P.J.: The mechanical evaluation of expressions. Comput. J. 6(4), 308–320 (1964)CrossRefzbMATHGoogle Scholar
  30. 30.
    Liu, H., Qiu, Z.: Go model and object oriented programming. In: Pardo, A., et al. (eds.) SBLP 2015. LNCS, vol. 9325, pp. 59–74. Springer, Heidelberg (2015). doi: 10.1007/978-3-319-24012-1_5 CrossRefGoogle Scholar
  31. 31.
    Malayeri, D., Aldrich, J.: Integrating nominal and structural subtyping. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 260–285. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  32. 32.
    Milner, R., Parrow, J., Walker, D.: A calculus of mobile processes, part I/II. Inf. Comput. 100, 1–77 (1992)MathSciNetCrossRefzbMATHGoogle Scholar
  33. 33.
    Reus, B., Streicher, T.: About hoare logics for higher-order store. In: Caires, L., Italiano, G.F., Monteiro, L., Palamidessi, C., Yung, M. (eds.) ICALP 2005. LNCS, vol. 3580, pp. 1337–1348. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  34. 34.
    Steele, G.L., Sussman, G.J., Scheme: an interpreter for the extended lambda calculus. AI Memo 349, MIT Artificial Intelligence Laboratory (1975)Google Scholar
  35. 35.
    Steele, G.L., Sussman, G.J.: Scheme: an interpreter for the extended lambda calculus. High.-Order Symbolic Computat. 11, 405–439 (1998)CrossRefzbMATHGoogle Scholar
  36. 36.
    Summerfield, M.: Programming in Go. Addison-Wesley, Upper Saddle River (2012)Google Scholar
  37. 37.
    Wang, A., Dahl, O.-J.: Coroutine sequencing in a block structured environment. BIT Numer. Meth. 11(4), 425–449 (1971)CrossRefzbMATHGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2016

Authors and Affiliations

  1. 1.Department of InformaticsUniversity of OsloOsloNorway

Personalised recommendations