preface
Input =~ /d{3}-d{3}-d{4}/
You might scoff that it’s just a regular expression match, and maybe you know what it matches.
Regular expressions are often accused of being too convoluted, but imagine what pattern matching would look like if all you could use was plain old regular control code. How easy is this code to understand and modify compared to regular expressions?
This is ** Domain-specific Language (DSL) ** If you think about regular expressions, why am I talking about DSLS here because of their two main advantages
1. The first advantage of DSLS is that they are good at working in specific places in programs and making them easy to understand, which improves writing, maintenance, and bug reduction.
2. The second advantage of DSLS is not limited to programmers. Because DSLS tend to be short and easy to read, non-programmers can understand the code that drives their important business. Exposing this real code to people who understand the domain ensures a very smooth line of communication between the programmer and the customer.
But when people talk about DSL, they often say that DSL can make you no longer need programmers. I strongly disagree with this statement, after all, it is about COBOL. But it is true that some languages are used by people who claim not to be programmers, such as CSS. For this language, reading is much more important than writing. If a domain expert can read and understand most of the core business code, he can talk to the programmer who wrote the code in great detail.
The second reason is that using DSLS is not easy, but the payoff can be huge. The narrowest bottleneck in software development is the communication between the programmer and the customer, and any technique that can solve this problem is worth learning.
To adapt to the crowd
The book is ideal for professional software programmers who are thinking about building DSLS. I think this type of reader should have many years of experience and believe in the basic ideas of software design.
If you’ve delved deeply into the topic of language design, there’s probably not much in this book that you haven’t already covered. I hope the way I organize and present information in the book has been helpful. While a great deal of work has been done in language design, especially in the academic world, very little of it has been applied to professional programming.
The first few chapters of the narrative can also clear up some confusion about what a DSL is and what a DSL is for. After reading through part 1, you will have a fuller understanding of the different DSL implementation technologies.
I would like to introduce this book from the godfather of software development Lao Ma
The first part, introduction
Chapter 1 is an introductory example
Chapter 2 uses DSL
Chapter 3 implements DSL
Chapter 4 implements an internal DSL
Chapter 5 implements an external DSL
Chapter 6 Internal DSL vs External DSL
Chapter 7 Overview of other computing models
Chapter 8 code generation
Chapter 9 Language Workbench
Part II General themes
Chapter 10 various DSLS
Chapter 11 semantic model
Chapter 12 symbol table
Chapter 13 Context Variables
Chapter 14. Stereotype Generators
Ohata 15
Chapter 16 Notice
Part iii External DSL topics
Chapter 17 delimiters guide translation
Chapter 18 grammar guide translation
Chapter 19 BNF
Chapter 20: Lexers based on regular expression tables
Chapter 21 recursive descent French law parser
Chapter 22 parser combinators
Chapter 23. Parser Generator
Chapter 24 Tree Construction
Chapter 25 embedded grammar translation
Chapter 26 embedded interpreters
Chapter 27 additional code
Chapter 28 variable participles
Chapter 29. Nested operator expressions
Chapter 30 uses line breaks as separators
Chapter 31 External DSL pickups
Part iv Internal DSL topics
Chapter 32 expression Generators
Chapter 33 sequence of functions
Chapter 34: Nested functions
Chapter 35 method cascade
Chapter 36 Object Scope
Chapter 37 closures
Chapter 38 on Nested closures
Chapter 39. Literal construction of lists
Chapter 40 Literal Map
Chapter 41 dynamic reception
Chapter 42 notes
Chapter 43 parse tree operations
Chapter 44 class symbol table
Chapter 45 text polishing
Chapter 46 provides an extension on literals
The fifth part other calculation models
Chapter 47 adaptive Model
Chapter 48 Decision table
Chapter 49 Depends on the network
Chapter 50 production rule system
Chapter 51 state machines
The sixth part code generation
Chapter 52 code generation based on converters
Chapter 53. Templated Generators
Chapter 54 embed Helper
Chapter 55 model-based code generation
Chapter 56 ignored model code generation
Chapter 57 Generation Gap
Each knowledge point in addition to the principle of explanation, there are corresponding diagrams and source code display, easy for everyone to understand and watch
** If you need this information, click here to see how to get it