Abstract
In these lecture notes we present the F# implementation of a small programming language we call Simply. We give the parser implementation using active patterns, F#’s unique feature for extensible pattern matching, which as we demonstrate provide an elegant and type-safe mechanism to embed parsers as an alternative approach to parser generators. We also build an evaluator, and extend the core Simply language with Logo-like primitives and build a graphical shell environment around it.
As a warm-up, we give a rudimentary survey of some notable F# features, including sequence expressions and active patterns. For a treatment of units of measure, used briefly in the Simply shell environment, the reader is encouraged to study [AK-09] and [AK-CEFP-09].
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
Granicz, A.: Prototyping DSLs in F#: Parsing and Semantic Checking (August 24, 2009), http://www.devx.com/dotnet/Article/42552 , DevX.com
Granicz, A., Tayanovskyy, A., Björnson, J., Echeverri, D., et al.: IntelliFactory blogs (2009), http://www.intellifactory.com/blogs
Syme, D., Neverov, G., Margetson, J.: Extensible Pattern Matching Via a Lightweight Language Extension. In: The Proceedings of the International Conference on Functional Programming, vol. 42(9), pp. 29–42 (2007)
Syme, D.: Leveraging.NET Meta-Programming Components from F# - Integrated Queries and Interoperable Heterogeneous Execution. In: The Proceedings of the ACM SIGPLAN Workshop on ML and its Applications, pp. 43–54 (2006)
Syme, D., et al.: The F# Web Site (2009), http://fsharp.net
Kennedy, A.: Blog Site (2009), http://blogs.msdn.com/andrewkennedy
Kennedy, A.: Types for Units-of-Measure: Theory and Practice (2009), http://research.microsoft.com/en-us/um/people/akenn/units/CEFP09RevisedNotes.pdf
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2010 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Granicz, A. (2010). Rapid Prototyping of DSLs with F#. In: Horváth, Z., Plasmeijer, R., Zsók, V. (eds) Central European Functional Programming School. CEFP 2009. Lecture Notes in Computer Science, vol 6299. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-17685-2_1
Download citation
DOI: https://doi.org/10.1007/978-3-642-17685-2_1
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-17684-5
Online ISBN: 978-3-642-17685-2
eBook Packages: Computer ScienceComputer Science (R0)