Abstract
In ordinary interpreters and executable specifications of operational semantics the interpreted language is represented by an algebraic data type and the operations are functions having this data type as argument. In this essay we reverse the roles of functions and data structures. Here the language constructs are represented by state transforming functions belonging to some class. There are instances of this class for the operations on the specified language. Typical examples of operations are reduction, pretty printing, and transformations. The state is a data structure indicating the desired operation. The advantage of this approach is that it is easy to add language constructs and operations independently of each other.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Barendregt, H.: The lambda calculus, its syntax and semantics, revised edition. Studies in Logic, vol. 103. North-Holland (1984)
Carette, J., Kiselyov, O., Shan, C.-C.: Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages. J. Funct. Program. 19(5), 509–543 (2009)
Curry, H., Feys, R.: Combinatory logic. Studies in Logic and the Foundations of Mathematics Series, vol. 2. North-Holland Publishing Company (1972)
Hinze, R.: Fun with phantom types. In: Gibbons, J., de Moor, O. (eds.) The Fun of Programming, pp. 245–262. Palgrave Macmillan (2003)
Jansen, J.: Functional Web Applications – Implementation and Use of Client Side Interpreters. PhD thesis, Radboud University Nijmegen, 8 (July 2010) ISBN 978-90-9025436-4
Jansen, J., Koopman, P., Plasmeijer, R.: Efficient interpretation by transforming data types and patterns to functions. In: Nilsson, H. (ed.) Proceedings of the 7th Symposium on Trends in Functional Programming, TFP 2006, Nottingham, UK, April 19-21, pp. 157–172 (2006) ISBN 978-1-84150-188-8
Johann, P., Ghani, N.: Foundations for structured programming with gadts. SIGPLAN Not. 43(1), 297–308 (2008)
Koopman, P.: Functional Programs as Executable Specifications. PhD thesis, University of Nijmegen (1990)
Koopman, P., Plasmeijer, R., Achten, P.: An Effective Methodology for Defining Consistent Semantics of Complex Systems. In: Horváth, Z., Plasmeijer, R., Zsók, V. (eds.) CEFP 2009. LNCS, vol. 6299, pp. 224–267. Springer, Heidelberg (2010)
Koopman, P.W.M., van Eekelen, M.C.J.D., Plasmeijer, M.J.: Operational machine specification in a functional programming language. Softw., Pract. Exper. 25(5), 463–499 (1995)
Lämmel, R., Ostermann, K.: Software extension and integration with type classes. In: Proceedings of the 5th International Conference on Generative Programming and Component Engineering, GPCE 2006, pp. 161–170. ACM, New York (2006)
Landin, P.J.: The next 700 programming languages. Commun. ACM 9(3), 157–166 (1966)
Löh, A., Hinze, R.: Open data types and open functions. In: Proceedings of the 8th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, PPDP 2006, pp. 133–144. ACM, New York (2006)
Middelkoop, A., Dijkstra, A., Swierstra, D.: A leaner specification for GADTs. In: Achten, P., Koopman, P., Morazán, M. (eds.) Trends in Functional Programming, vol. 9, pp. 65–80. Intellect (2009) ISBN 978-1-84150-277-9
Nielson, H., Nielson, F.: Semantics with applications: a formal introduction. John Wiley & Sons, Inc. (1992)
Pil, M.: Dynamic types and type dependent functions. In: Hammond, K., Davie, T., Clack, C. (eds.) IFL 1998. LNCS, vol. 1595, pp. 169–185. Springer, Heidelberg (1999)
Plasmeijer, R., Achten, P., Koopman, P.: iTasks: executable specifications of interactive work flow systems for the web. In: Hinze, R., Ramsey, N. (eds.) Proceedings of the International Conference on Functional Programming, ICFP 2007, Freiburg, Germany, pp. 141–152. ACM Press (2007)
Plasmeijer, R., Achten, P., Koopman, P.: Generic Functions Dynamically Applied. In: Porkoláb, Z., Pataki, N. (eds.) Proceedings of Workshop on Generative Technologies, WGT 2010, Paphos, Cyprus, March 27, pp. 1–2 (2010)
Plasmeijer, R., Lijnse, B., Michels, S., Achten, P., Koopman, P.: Task-Oriented Programming in a Pure Functional Language. In: Proceedings of the 2012 ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, PPDP 2012, Leuven, Belgium, pp. 195–206. ACM (September 2012)
Plasmeijer, R., van Eekelen, M.: Clean language report (version 2.1) (2002), http://clean.cs.ru.nl
Reynolds, J.: Defunctional interpreters for higher-order programming languages. Higher-Order and Symbolic Computation 11(4), 363–397 (1998)
Schönfinkel, M.: über die bausteine der mathematischen logik. Mathematische Annalen 92, 305–316 (1924)
Swierstra, W.: Data types à la carte. J. Funct. Program. 18(4), 423–436 (2008)
Syme, D., Neverov, G., Margetson, J.: Extensible pattern matching via a lightweight language extension. In: Proceedings of the 12th ACM SIGPLAN International Conference on Functional Programming, ICFP 2007, pp. 29–40. ACM, New York (2007)
Turner, D.A.: A new implementation technique for applicative languages. Software: Practice and Experience 9(1), 31–49 (1979)
Turner, D.A.: Miranda: a non-strict functional language with polymorphic types. In: Jouannaud, J.-P. (ed.) FPCA 1985. LNCS, vol. 201, pp. 1–16. Springer, Heidelberg (1985)
Wadler, P.: The expression problem. Message to Java-genericity Electronic Mailing List (November 1998)
Zenger, M., Odersky, M.: Extensible algebraic datatypes with defaults. SIGPLAN Not. 36(10), 241–252 (2001)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Koopman, P. (2013). Functional Semantics. In: Achten, P., Koopman, P. (eds) The Beauty of Functional Code. Lecture Notes in Computer Science, vol 8106. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-40355-2_6
Download citation
DOI: https://doi.org/10.1007/978-3-642-40355-2_6
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-40354-5
Online ISBN: 978-3-642-40355-2
eBook Packages: Computer ScienceComputer Science (R0)