Programming Language Specification and Implementation

  • Peter SestoftEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11244)


The specification of a programming language is a special case of the specification of software in general. This paper discusses the relation between semantics and implementation, or specification and program, using two very different languages for illustration. First, we consider small fragments of a specification of preliminary Ada, and show that what was considered a specification in VDM in 1980 now looks much like an implementation in a functional language. Also, we discuss how a formal specification may be valuable even though seen from a purely formal point of view it is flawed. Second, we consider the simple language of spreadsheet formulas and give a complete specification. We show that nondeterminism in the specification may reflect run-time nondeterminism, but also underspecification, that is, implementation-time design choices. Although specification nondeterminism may appear at different binding-times there is no conventional way to distinguish these. We also consider a cost semantics and find that the specification may need to contain some “artificial” nondeterminism for underspecification.


Specification Implementation Programming languages Nondeterminism Underspecification 


  1. 1.
    Biermann, F., Dou, W., Sestoft, P.: Rewriting high-level spreadsheet structures into higher-order functional programs. In: Calimeri, F., Hamlen, K., Leone, N. (eds.) PADL 2018. LNCS, vol. 10702, pp. 20–35. Springer, Cham (2018). Scholar
  2. 2.
    Bjørner, D., Jones, C.B. (eds.): The Vienna Development Method: The Meta-Language. LNCS, vol. 61. Springer, Heidelberg (1978). Scholar
  3. 3.
    Bjørner, D., Nest, O.N. (eds.): Towards a Formal Description of Ada. LNCS, vol. 98. Springer, Heidelberg (1980). Scholar
  4. 4.
    Bjørner, D., Gram, C., Oest, O.N., Rystrøm, L.: Dansk datamatik center. In: History of Nordic Computing 3 - Third IFIP WG 9.7 Conference, HiNC 3, Stockholm, Sweden, pp. 350–359, 18–20 October 2010. Springer (2011)Google Scholar
  5. 5.
    Blelloch, G.: Programming parallel algorithms. CACM 39(3), 85–97 (1996)CrossRefGoogle Scholar
  6. 6.
    Bock, A., Bøgholm, T., Leth, L., Sestoft, P., Thomsen, B.: Concrete and abstract cost semantics for spreadsheets. Technical report. ITU-TR-2018-203, IT University of Copenhagen (2018). (to appear)Google Scholar
  7. 7.
    Broy, M., Havelund, K., Kumar, R.: Towards a unified view of modeling and programming. In: Margaria, T., Steffen, B. (eds.) ISoLA 2016, Part II. LNCS, vol. 9953, pp. 238–257. Springer, Cham (2016). Scholar
  8. 8.
    Ganzinger, H., Jones, N.D. (eds.): Programs as Data Objects. LNCS, vol. 217. Springer, Heidelberg (1986). Scholar
  9. 9.
    Gordon, M.J., Milner, A.J., Wadsworth, C.P.: Edinburgh LCF: A Mechanised Logic of Computation. LNCS, vol. 78. Springer, Heidelberg (1979). Scholar
  10. 10.
    Havelund, K.: Closing the gap between specification and programming: VDM++ and Scala. In: HOWARD-60: A Festschrift on the Occasion of Howard Barringer’s 60th Birthday. EPiC Series in Computing, vol. 42, pp. 210–233 (2014)Google Scholar
  11. 11.
    Henhapl, W., Jones, C.B.: A formal definition of ALGOL 60 as described in the 1975 modified report. In: Bjørner, D., Jones, C.B. (eds.) The Vienna Development Method: The Meta-Language. LNCS, vol. 61, pp. 305–336. Springer, Heidelberg (1978). Scholar
  12. 12.
    Hudak, P., Jones, M.P.: Haskell vs. Ada vs. C++ vs. Awk vs. ...: An experiment in software prototyping productivity. Technical report. YALEU/DCS/RR-1049, Yale University, Department of Computer Science, October 1994Google Scholar
  13. 13.
    Jones, N.D. (ed.): SDCG 1980. LNCS, vol. 94. Springer, Heidelberg (1980). Scholar
  14. 14.
    Kahn, G.: Natural semantics. In: Brandenburg, F.J., Vidal-Naquet, G., Wirsing, M. (eds.) STACS 1987. LNCS, vol. 247, pp. 22–39. Springer, Heidelberg (1987). Scholar
  15. 15.
    Launchbury, J.: A natural semantics for lazy evaluation. In: Twentieth ACM Symposium on Principles of Programming Languages, Charleston, South Carolina, January 1993, pp. 144–154. ACM (1993)Google Scholar
  16. 16.
    Naur, P.: Formalization in program development. BIT 22(4), 437–453 (1982)MathSciNetCrossRefGoogle Scholar
  17. 17.
    Naur, P.: Programming as theory building. Microprocess. Microprogram. 15, 253–261 (1985)CrossRefGoogle Scholar
  18. 18.
    Nielson, H., Nielson, F.: Semantics with Applications: An Appetizer. Springer, London (2007). Scholar
  19. 19.
    Platek, R.A.: The European formal definition of Ada. A U.S. perspective. IDA Memorandum Report M-389, Institute for Defense Analyses (1988)Google Scholar
  20. 20.
    Sestoft, P.: Analysis and Efficient Implementation of Functional Programs. Ph.D. thesis, DIKU, University of Copenhagen, Denmark (1991). DIKU Research Report 92/6Google Scholar
  21. 21.
    Sestoft, P.: Deriving a lazy abstract machine. J. Funct. Program. 7(3), 231–264 (1997)MathSciNetCrossRefGoogle Scholar
  22. 22.
    Sestoft, P.: Spreadsheet Implementation Technology: Basics and Extensions, 325 p. MIT Press, Cambridge (2014). ISBN 978-0-262-52664-7Google Scholar
  23. 23.
    Syme, D., Granicz, A., Cisternino, A.: Expert F#, 4th edn. Apress, New York (2015)CrossRefGoogle Scholar
  24. 24.
    Tofte, M.: Compiler Generators. In: What They Can Do, What They Might Do, and What They Will Probably Never Do. Monographs in Theoretical Computer Science. Springer, Heidelberg (1990). Scholar
  25. 25.

Copyright information

© Springer Nature Switzerland AG 2018

Authors and Affiliations

  1. 1.Computer Science DepartmentIT University of CopenhagenCopenhagenDenmark

Personalised recommendations