What is a domain specific language? Anybody using it? And in what way?

前端 未结 14 1849
天涯浪人
天涯浪人 2020-12-22 17:04

I guess I am looking for some kind of intro and see if anybody have used it. Are there any particular advantages of using it?

Wikipedia:

domai

14条回答
  •  半阙折子戏
    2020-12-22 17:36

    Well! there is lot of things explained above. I will try to explain this in much simpler way as some one like me come will understand.

    As general purpose languages are used for vast purposes the DSL is only made for specific domain. Like HTML or CSS.

    You can say if you wrote instructions to a paper which only some person or your only best friend can understand and no one else could. Then it may be a DSL. But if you wrote instruction in such terms which many people could understand and could follow then this is not DSL.

    I onces created a Switch board for user which could be operated via Serial port of a computer and User want a program for that board which could be executed on that board and Relay switches will be turned on and off accordingly. So I wrote some instructions and told the user to program that board according to these instructions. This is an example of DSL. I did not invented a new Language rather then I just created bunch of Strings that micro controller could read from EEPROM and could parse accordingly and could perform a specific task.

提交回复
热议问题