Your SlideShare is downloading. ×
0
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Domain Specific Languages: The Functional Way

1,380

Published on

In software development, we often face the same problem over and over again. For example, when designing user-interfaces, we need to specify the layout of components; when designing financial systems, …

In software development, we often face the same problem over and over again. For example, when designing user-interfaces, we need to specify the layout of components; when designing financial systems, we need to detect various patterns in changing prices. The Domain Specific Language (DSL) approach is to design a language for the specific problem domain and then use it repeatedly to solve multiple instances of the same problem.

In this talk, we look how to think about DSLs in a functional way. This lets us focus on the domain. Rather than worrying about the syntax, we start by understanding what problems we actually want to model and what is the best way to do so. Along the way, we’ll look at three fun examples ranging from a language for building 3D objects to a language for detecting price change patterns.

Published in: Technology, Education
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,380
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
21
Comments
0
Likes
4
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Domain Specific Languages The functional Way Tomas Petricek @tomaspetricek | www.fsharpworks.com
  • 2. F# Software Foundation http://www.fsharp.org software stacks trainings teaching F# user groups snippets mac and linux community books and tutorials consulting open-source MonoDevelop contributions research support cross-platform mailing lists
  • 3. Kaggle • Interactivity • Machine learning • Data processing GameSys • Time to Market • Social Gaming • Concurrency Tachyus • Analysis & reporting • Time to market • Oil & gas startup Credit Suisse • Complexity • Financial models • DSLs
  • 4. DSL= model + syntax
  • 5. COMPOSING 3D OBJECTS
  • 6. Domain-specific language approach Class of problems Constructing 3D objects Makefiles, stock price modelling, testing, … Domain-specific language in F# Primitives – basic building blocks Composition – how to put them together
  • 7. http://tomasp.net/blog/2014/puzzling-fsharp/
  • 8. GENERATING TEXT DOCUMENTS
  • 9. Domain model & Processing What is a text document? How can we process it?
  • 10. BUILDING AN F# DSL
  • 11. Operations on documents Parse Read from Markdown format Format Generate HTML output Process Translate to Norwegian!
  • 12. PROCESSING DOCUMENTS
  • 13. DSL for writing documents Creating DSLs with F# ===================== Key components of a DSL: * **Model** describes the structure of the domain that we are modelling * **Syntax** provides an easy way for solving problems using the DSL Creating DSLs with F# Key components of a DSL: • Model describes the structure of the domain that we are modelling • Syntax provides an easy way for solving problems using the DSL
  • 14. PARSING MARKDOWN http://manning.com/petricek2
  • 15. Processing Markdown Domain model Understand the problem domain! Using F# discriminated unions Domain-specific language Internal – just an F# library! External – parsing Markdown is easy!
  • 16. DETECTING PRICE PATTERNS
  • 17. Declining pattern
  • 18. Rounding top pattern
  • 19. Multiple bottom pattern
  • 20. Functional DSL style Primitive classifiers Declining price Rising price Composing classifiers Sequence and parallel patterns Linear regression
  • 21. DETECTING PRICE PATTERNS
  • 22. Summary
  • 23. ❶ Understand problem domain Primitives & Combinators ❷ Model the language using Discriminated Unions ❸ Add convenient Syntax Internal or External tomas@tomasp.net | @tomaspetricek |

×