Why do I need DSL analysis tools?

Could DSL be as simple as an API, and therefore does not need a parser? Or I don’t understand what a specific domain is? I thought this applies to any organized set of rules to solve a specific domain problem. The API seems to fit this definition, right?

+5
source share
5 answers

You can embed DSL in a more general programming language. This is often a good solution. (We can say that this DSL takes the form of a specific API.)

You can also create a separate language with your own interpreter to represent the concepts of your domain. This is usually a larger event, and often this is not necessary.

+5
source

You confuse the concept with implementation. A domain-specific language is any representation of an idea that is considered to be "close" to the subject area, and is not a common language for describing problem solving in general.

Yes, DSL can be implemented as an API that provides functions related to specific concepts in a problem area, but DSL is equally valid when presented as a text file.

Pragmatic programmer: Journeyman to Master provides a good description of DSL and the circumstances in which they are useful, with examples. Highly recommended.

+4

.

: . , DSL, ...

+1

, - API DSL, - .

Ruby - , .

  • Rails DSL -, .

  • - DSL () make .

OOFILE - , DSL ++ - ​​ ​​dBase ++, .

Forth - , DSL API, Forth , . , Forth DSL Abundance - - -, , BBL Forth. BBL - 32- DOS FORTH. . . . . , , klunker XT AT. , .

0

And, of course, graphical DSL does not require parsing at all.

-2
source

All Articles