Gain an accelerated introduction to domain-specific languages in R, including coverage of regular expressions. This compact, in-depth book shows you how DSLs are programming languages specialized for a particular purpose, as opposed to general purpose programming languages. Along the way, youll learn to specify tasks you want to do in a precise way and achieve programming goals within a domain-specific context.
Domain-Specific Languages in R includes examples of DSLs including large data sets or matrix multiplication; pattern matching DSLs for application in computer vision; and DSLs for continuous time Markov chains and their applications in data science. After reading and using this book, youll understand how to write DSLs in R and have skills you can extrapolate to other programming languages.
What You'll Learn
Program with domain-specific languages using R
Discover the components of DSLs
Carry out large matrix expressions and multiplications
Implement metaprogramming with DSLs
Parse and manipulate expressions
Who This Book Is For
Those with prior programming experience. R knowledge is helpful but not required.
Thomas Mailund is an associate professor in bioinformatics at Aarhus University, Denmark. He has a background in math and computer science. For the last decade, his main focus has been on genetics and evolutionary studies, particularly comparative genomics, speciation, and gene flow between emerging species. He has publishedBeginning Data Science in R, Functional Programming in R andMetaprogramming in R with Apress as well as other books.
1.Introduction.- 2.Matrix expressions.- 3.Components of a programming language.- 4.Functions, classes and operators.- 5.Parsing and manipulating expressions.- 6.Lambda expressions.- 7. Environments and Expressions.- 8.Tidy evaluation.- 9.List comprehension.- 10.Continuous-Time Markov chains.- 11.Pattern matching.- 12. Dynamic programming.- 13.Conclusion.