DSL explained _


Published on

Explanation of what DSLs are with slight shift towards MPS.

Slides from my talk at Deutsche Bank.
There is nothing particulary new in these slides, there are mostly based on Martin Fowler talks and book (http://www.martinfowler.com/dslwip/).

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Hi For those who haven't heard about it, SOLID is acronym composed from principles names. (There are 5 of them.) SOLID doesn't have any particular meaning. It's just a good way to remember list of principles. These principles are about low-level design and partly interpretation of OOP basics.
  • Before doing anything it's good to know “why” you're going to do it. In other words operating without context you're becoming coding monkey or a screwdriver.
  • I began programming at school because it was fun (before anyone actually taught me). Turbo Pascal, asm for DOS (for cool things). Then Delphi, C++. Of course we were told at school that OOP not only “Организация Освобождения Палестины”(Palestine Liberation Organization, in Russian sounds like OOP) but also encapsulation, polymorphism, inheritance © Nice words which I've known for quite a long time. What I did at the time was kind of “goal-oriented programming” . You don't really care how the work is done (almost), it's works today – fine! I knew some techniques like using inheritance but never bothered to understand why they exist. After (four?) years I got tired of “fighting the mess” and vision of programming as “low-level activity” so I programmed only for some “code for labs”. Some time later for some reason I though it would be nice to make sense of objects anyway. That way I came across patterns, UML, java, junit, refactoring and OOP (this time for real) . Nice java IDEs were also very attractive, but not more than the following “promises”.
  • DSL explained _

    1. 1. (Domain Specific Language, not Direct Server Link) [email_address] DSL explained
    2. 2. DSL premises
    3. 3. and only then for computers Code is written for people
    4. 4. Objects ---> Vocabulary Grammar ---> Language Domain Driven Design DSL
    5. 5. DSL is advanced stuff
    6. 6. DSL example (by Martin Fowler)
    7. 15. DSL is a computer language with: human language nature limited expressiveness domain focus
    8. 16. DSL types internal external language workbench
    9. 17. Internal DSL example
    10. 20. External DSL example
    11. 22. Language workbench example
    12. 24. More examples
    13. 25. regular expressions CSS SQL all XML Unix config files Ruby on Rails mocking frameworks wiki syntax / markdown LINQ
    14. 26. Using internal DSL (aka Fluent Interface)
    15. 27. Easy to do... no parsers, etc. Full IDE support Good Bad Limited by host language
    16. 33. Method chaining Object scoping Expression Builder
    17. 34. Using external DSL
    18. 35. Unlimited expressiveness You choose execution environment Good Bad Requires “more” work No IDE support
    19. 36. DSL script parse AST Semantic model optional
    20. 37. You can parse DSL manually (regexp, Tokenizer) using some tool (ANTLR, yacc, ...)
    21. 39. Using Language Workbenches
    22. 40. Meta Programming System Microsoft Oslo Intentional Domain Workbench Eclipse Modeling Project
    23. 42. concepts (language) edit you
    24. 43. AST (DSL script) concepts (language) edit describe you
    25. 44. AST (DSL script) concepts (language) edit edit describe “ user” you
    26. 45. AST (DSL script) concepts (language) edit describe “ user” you no text, just AST ! edit
    27. 46. useful stuff (like java code) AST (DSL script) concepts (language) edit describe transformed “ user” you edit
    28. 48. Module Project
    29. 49. Module Project Solution Language Generator DevKit kind of
    30. 50. Model Module Project Solution Language Generator DevKit kind of
    31. 51. Node Model Module Project Solution Language Generator DevKit kind of includes Concept defined by
    32. 69. Internal DSLs rule! :)