Questions tagged [dsl]

Domain-Specific Language is a programming language intended for a particular application domain

A domain-specific language (DSL) is a programming language intended for a particular application domain.

Well-known examples that can be considered DSLs include for markup, for statistics.

There are three key points in above mentioned definition.

  1. Programming Language: DSL is a programming language, which is used by humans to instruct a computer to do something.
  2. Limited Expressiveness: DSL is not a general purpose language like C, Java, etc. It supports minimum features needed to support its domain. Programmer cannot build entire software system using DSL.
  3. Domain focus: DSL focuses on a small domain. The limited focus makes it easy to understand and easy to use.

Martin Fowler divides DSL mainly into two categories :

  1. A External DSL : it is a standalone language with its own custom syntax, but adopting other language such as XML syntax is common. Example of external DSLs are for database queries, languages.
  2. An Internal DSL : They are intrinsically embedded inside a general-purpose language, such as Lava (hardware description language on top of ), (build system on top of ), or (structured markup language on top of ).
2200 questions
0
votes
0 answers

Elasticsearch, match multiple different phrases

So I have the following sample JSON. { "_index" : "prd-avi-chatbot-sales-fargate-2022.07.04", "_type" : "log", "_id" : "Xaksy4EB5R0ILwHLOelN", "_score" : 78.2336, "_source" : { "@timestamp" :…
INGl0R1AM0R1
  • 1,532
  • 5
  • 16
0
votes
1 answer

How to make beautiful DSL in ruby with just words in arguments, without commas

I want to achieve something like that: something.configure do on arg1 arg2 "real_arg" do end end Without commas just like that. I assume Ruby interprets this code as: something.configure do on(arg1)(arg2 "real_arg") do end end In the…
idchlife
  • 554
  • 1
  • 6
  • 16
0
votes
1 answer

swift result builder for two different type of input and the same type of output

This is the common function between ModelBuilder and StackModelBuilder in order to be called in the result builder functions protocol Builder { func build() -> ViewFactory? } protocol ModelBuilder: Builder { var data: MerchDataSource? { get…
benoitcn
  • 149
  • 1
  • 12
0
votes
1 answer

How to obtain data count from NEST that is not exact What data count does the DSL query return?

My Old DSL query from which i am getting 2237 records from same index and link ../design/_count?pretty=true { "query": { "bool": { "must": { "match_all": {} }, "filter": { …
abbas ahmed
  • 283
  • 2
  • 13
0
votes
0 answers

How to pass values from examples for nested JSON in Karate in a scenario

Here is json structure { "mfsCommonServiceRequest": { "mfsSourceInfo": { "channelId": "22", "surroundSystem": "1" }, "mfsTransaction": { "request": "9086544566665", "service": "0", "time": "1517218465350" } } } My code Scenario Outline: To validate…
0
votes
1 answer

Parsing unique but unordered named blocks

I have a DSL where a file consists of multiple named blocks. Ideally, each block should occur only once, but the order doesn't matter. How do I write a parser that ignores block order, but gives syntax errors if the same block is repeated?
shader
  • 801
  • 1
  • 7
  • 25
0
votes
0 answers

Ruby yard documenting DSL method definition AND its uses>

Ruby with Yard 0.9.8. I'm defining custom attribute accessors in a ClassMethods module that will be extended into classed and other modules. What I want to do is document what the DSL accessor methods do and attach that to their definitions, but…
RoUS
  • 1,888
  • 2
  • 14
  • 29
0
votes
0 answers

Typescript code generator for Python, Kotlin & Dart

I want to make a domain specific language. The "source code" is yml. Compilation targets should be TypeScript, Kotlin, Python and Dart. I already wrote a parser in TypeScript which outputs my abstract syntax tree as JSON. Can I efficiently generate…
0
votes
1 answer

What is the order of precedence of operator in DSL

Query is below { "query": { "bool": { "must": { "query_string": { "query": "messi NOT barca AND psg", "fields": ["name^128"] } } } } } What is the difference in "query": "messi AND barca…
sim
  • 524
  • 3
  • 14
0
votes
2 answers

How to DSL query to search query string with asterisk after excluding predefined words

my stop.txt is having messi Settings is belows { "settings": { "index": { "analysis": { "filter": { "synonym_en": { "type": "synonym", "synonyms_path": "synom.txt" }, …
sim
  • 524
  • 3
  • 14
0
votes
1 answer

KotlinPoet: how to generate a DSL with parameters

I'm trying to generate this Kotlin code that contains a DSL with a parameter: listOf( navArgument(QUERY_PARAM) { type = NavType.StringType nullable = true defaultValue = null }, ) Is there a better way to provide the…
Roberto Leinardi
  • 10,641
  • 6
  • 65
  • 69
0
votes
1 answer

How to wrap long lines of Apache Camel Java DSL code

In my project we are using Apache Camel via Java DSL This is how a typical route looks: from("direct:MyPizzaRestaurant") .routeId("PizzaRoute") .log(LoggingLevel.INFO, LOG, LOG_IN_MESSAGE) …
0
votes
1 answer

What does Rails DSL configuration mean and what does a DSL configuration look like?

I have the following Bower file: group :vendor, assets_path: 'assets/shop' do asset 'jquery', '2.2.1' asset 'lodash', '4.6.1' ... end Now I see the output in the folder vendor/assets/shop, which is as specified in the docs. What I'm trying to…
Alexander Solonik
  • 9,838
  • 18
  • 76
  • 174
0
votes
0 answers

How to add suggestion inside term query in DSL

My DOc is below [ {'id':1, 'name': 'sachin messi', 'description': 'football@football.com', 'type': 'football', 'var':'sports'}, {'id':2, 'name': 'lionel messi', 'description': 'messi@fifa.com','type': 'soccer','var':'sports'}, {'id':3, 'name':…
sim
  • 524
  • 3
  • 14
0
votes
2 answers

How to apply term query with match_prefix in elasticsearch

My document is below [ {'id':1, 'name': 'sachin messi', 'description': 'football@football.com', 'type': 'football', 'var':'sports'}, {'id':2, 'name': 'lionel messi', 'description': 'messi@fifa.com','type': 'soccer','var':'sports'}, {'id':3, 'name':…
sim
  • 524
  • 3
  • 14