Abstract
The design of languages is still more of an art than an engineering discipline. Although recently tools have been put forward to support the language design process, such as language workbenches, these have mostly focused on a syntactic view of languages. While these tools are quite helpful for the development of parsers and editors, they provide little support for the underlying design of the languages. In this paper we illustrate how to support the design of languages by focusing on their semantics first. Specifically, we will show that powerful and general language operators can be employed to adapt and grow sophisticated languages out of simple semantics concepts. We use Haskell as a metalanguage and will associate generic language concepts, such as semantics domains, with Haskell-specific ones, such as data types. We do this in a way that clearly distinguishes our approach to language design from the traditional syntax-oriented one. This will reveal some unexpected correlations, such as viewing type classes as language multipliers. We illustrate the viability of our approach with several real-world examples.
This work is partially supported by the Air Force Office of Scientific Research under the grant FA9550-09-1-0229 and by the National Science Foundation under the grant CCF-0917092.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Erwig, M., Kollmansberger, S.: Probabilistic Functional Programming in Haskell. Journal of Functional Programming 16(1), 21–34 (2006)
Erwig, M., Walkingshaw, E.: A DSL for Explaining Probabilistic Reasoning. In: Taha, W.M. (ed.) DSL 2009. LNCS, vol. 5658, pp. 335–359. Springer, Heidelberg (2009)
Erwig, M., Walkingshaw, E.: Visual Explanations of Probabilistic Reasoning. In: IEEE Int. Symp. on Visual Languages and Human-Centric Computing, pp. 23–27 (2009)
Erwig, M., Walkingshaw, E.: The Choice Calculus: A Representation for Software Variation. ACM Transactions on Software Engineering and Methodology (2011) (to appear)
Felleisen, M., Findler, R.B., Flatt, M.: Semantics Engineering with PLT Redex. MIT Press, Cambridge (2009)
Fowler, M.: Domain-Specific Languages. Addison-Wesley Professional (2010)
Halpern, J., Pearl, J.: Causes and Explanations: A Structural-Model Approach, Part I: Causes. British Journal of Philosophy of Science 56(4), 843–887 (2005)
Hudak, P.: Modular Domain Specific Languages and Tools. In: IEEE 5th Int. Conf. on Software Reuse, pp. 134–142 (1998)
Hudak, P.: Building Domain-Specific Embedded Languages. ACM Computing Surveys 28(4es), 196 (1996)
Gibbons, J., de Moor, O. (eds.): The Fun of Programming. Palgrave MacMillan (2003)
Kats, L.C.L., Visser, E., Wachsmuth, G.: Pure and Declarative Syntax Definition: Paradise Lost and Regained. In: ACM Int. Conf. on Object-Oriented Programming, Systems, Languages, and Applications, pp. 918–932 (2010)
Klint, P., Lämmel, R., Verhoef, C.: Toward an Engineering Discipline for Grammarware. ACM Trans. Softw. Eng. Methodol. 14, 331–380 (2005)
Liang, S., Hudak, P., Jones, M.: Monad Transformers and Modular Interpreters. In: 22nd ACM Symp. on Principles of Programming Languages, pp. 333–343 (1995)
Merkle, B.: Textual Modeling Tools: Overview and Comparison of Language Workbenches. In: ACM Int. Conf. on Object-Oriented Programming, Systems, Languages, and Applications, pp. 139–148 (2010)
Mitchell, J.C.: Concepts in Programming Languages. Cambridge University Press, Cambridge (2003)
Peyton Jones, S.L.: Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, Cambridge (2003)
Pfeiffer, M., Pichler, J.: A Comparison of Tool Support for Textual Domain-Specific Languages. In: OOPSLA Workshop on Domain-Specific Modeling, pp. 1–7 (2008)
Sheard, T.: Accomplishments and Research Challenges in Meta-Programming. In: Taha, W. (ed.) SAIG 2001. LNCS, vol. 2196, pp. 2–44. Springer, Heidelberg (2001)
Sheard, T., Pasalic, E.: Two-Level Types and Parameterized Modules. Journal of Functional Programming 14(5), 547–587 (2004)
Völter, M., Visser, E.: Language Extension and Composition With Language Workbenches. In: ACM Int. Conf. on Object-Oriented Programming, Systems, Languages, and Applications, pp. 301–304 (2010)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Erwig, M., Walkingshaw, E. (2012). Semantics First!. In: Sloane, A., Aßmann, U. (eds) Software Language Engineering. SLE 2011. Lecture Notes in Computer Science, vol 6940. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-28830-2_14
Download citation
DOI: https://doi.org/10.1007/978-3-642-28830-2_14
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-28829-6
Online ISBN: 978-3-642-28830-2
eBook Packages: Computer ScienceComputer Science (R0)