Domain-Specific Programming Language: Difference between revisions

From GM-RKB
Jump to navigation Jump to search
Tag: New redirect
Line 1: Line 1:
A [[Domain-Specific Programming Language]] is a [[programming language]] that is tailored to solve some [[domain-specific task]]s.
#REDIRECT [[Domain-Specific Programming Language (DLS)]]
* <B>AKA:</B> [[Special-Purpose Language]].
* <B>Context:</B>
** It can range from being an [[Imperative DSL]] to being a [[Declarative DSL]].
** It can range from being an [[External Domain-Specific Programming Language]] to being an [[Internal Domain-Specific Programming Language]] ([[Fowler, 2010]]).
** …
* <B>Example(s):</B>
** [[HTML]].
** [[SQL Language]].
** A [[Statistics Programming Language]], such as [[R Language|R]], [[SAS Language]], ...
** [[MatLab Language]].
** a [[Scala-based DSL]] (based on [[Scala language]]), such as [[Axle DSL]].
** a [[System Configuration Language]], such as: [[HashiCorp Configuration Language (HCL)]].
** a [[Workflow DSL]] (for [[workflow specification]]).
** …
* <B>Counter-Example(s):</B>
** [[General-Purpose Programming Language]].
* <B>See:</B> [[Embedded Domain Specific Language]], [[Configuration File]].
 
----
----
 
== References ==
 
=== 2023 ===
* chat
** Q: what is a DSL? what different kinds are there? Provide some examples.
** A: A [[DSL (Domain-Specific Language]]) is a [[programming language]] that is designed for a specific domain or problem. Unlike general-purpose programming languages, DSLs are specialized and often easier to use for the particular problem domain they are designed for. There are different kinds of DSLs, including the following:
*** [[External DSL]]s: External DSLs are programming languages that are independent of any other programming language or system. They have their own syntax and grammar, and their own interpreter or compiler. Examples of external DSLs include SQL (Structured Query Language) for database management, HTML (Hypertext Markup Language) for web development, and CSS (Cascading Style Sheets) for styling web pages.
*** [[Internal DSL]]s: Internal DSLs are programming languages that are embedded within a general-purpose programming language. They often use the syntax and grammar of the host language, which makes them easier to learn and use. Examples of internal DSLs include RSpec, a Ruby-based DSL for writing tests, and Gradle, a Groovy-based DSL for build automation.
*** [[Language workbench]]es: Language workbenches are tools that allow developers to create their own DSLs. These tools provide a framework for defining the syntax, semantics, and other aspects of the DSL. Examples of language workbenches include JetBrains MPS (Meta Programming System) and Xtext.
** Here are some examples of DSLs in various domains:
*** [[Regular expressions]]: [[Regular expression]]s are a DSL for pattern matching in strings.
*** [[Makefile]]: Makefile is a DSL for defining build rules and dependencies.
*** [[Robot Framework]]: Robot Framework is a DSL for writing automated tests for software systems.
*** [[LaTeX]]: LaTeX is a DSL for typesetting scientific and technical documents.
*** [[SQL]]: SQL is a DSL for managing relational databases.
 
=== 2014 ===
* ([[2014_UnifyingFunctionalandObjectOrie|Odersky & Rompf, 2014]]) ⇒ [[Martin Odersky]], and [[Tiark Rompf]]. ([[2014]]). “[http://delivery.acm.org/10.1145/2600000/2591013/p76-odersky.pdf Unifying Functional and Object-oriented Programming with Scala].” In: [[Communications of the ACM Journal]], 57(4).In: [[Communications of the ACM Journal]], 57(4). [http://dx.doi.org/10.1145/2591013 doi:10.1145/2591013]
** QUOTE: The focus on objects and modularity makes Scala a library-centric language; since everything is an object, everything is a library module. Consequently, Scala makes it easy for [[programmer]]s to define high-level and efficient libraries and frameworks — important for scaling programs from small scripts to large software systems. Its syntactic flexibility, paired with an expressive type system, makes Scala a popular choice for embedding [[Domain-Specific Programming Language|domain-specific languages (DSLs)]]. The main language constructs for component composition are based on traits that can contain other types, including abstract ones, as members. …        <P>        Lightweight modular staging (LMS)20 and Delite4,9 are a set of techniques and frameworks that enable embedded [[Domain-Specific Programming Language|DSL]]s and "active" libraries that generate code from high-level Scala expressions at runtime, even for heterogeneous low-level target languages (such as [[C]], [[CUDA]], and [[OpenCL]]). [[Domain-Specific Programming Language|DSL]]s developed through Delite have been shown to perform competitively with hand-optimized C code. For graph processing, the [[Opti-Graph DSL]]23 (embedded in Scala) performs on par with the standalone language Green Marl. Many Scala features are crucial for LMS and Delite to implement compiler optimizations in a modular and extensible way.21
 
=== 2013 ===
* (Wikipedia, 2012) ⇒ http://en.wikipedia.org/wiki/Domain-specific_language
** QUOTE: A '''domain-specific language</B> ('''DSL</B>) is a type of [[programming language]] or [[specification language]] in software development and [[domain engineering]] dedicated to a particular problem domain, a particular problem representation technique, and/or a particular solution technique.        <P>                    The concept isn't new. Special-purpose programming languages and all kinds of modeling/specification languages have always existed in the computer age. But the term has become more popular due to the rise of [[domain-specific modeling]].        <P>                    Examples of domain-specific languages include [[HTML]], [[Logo (programming language)|Logo]] for pencil-like drawing, [[Verilog]] and [[VHSIC hardware description language|VHDL]] hardware description languages, Mata for matrix programming, [[Mathematica]] and [[Maxima (software)|Maxima]] for [[symbol]]ic [[mathematics]], [[spreadsheet]] formulas and macros, [[SQL]] for [[relational database]] queries, [[Yacc|YACC]] grammars for creating [[parsers]], [[regular expressions]] for specifying [[Lexical analysis|lexers]], the [[Generic Eclipse Modeling System]] for creating diagramming languages, [[Csound]] for sound and music synthesis, and the input languages of [[GraphViz]] and [[GrGen]], software packages used for [[graph layout]] and [[graph rewriting]].
** The opposite is:
*** a ''[[general-purpose programming language]]'', such as [[C (programming language)|C]], [[Java (programming language)|Java]] or [[Python (programming language)|Python]],
*** or a ''general-purpose modeling language'' such as the Unified Modeling Language ([[Unified Modeling Language|UML]]).
** Creating a domain-specific language (with software to support it) can be worthwhile if the language allows a particular type of problem or solution to be expressed more clearly than an existing language would allow and the type of problem in question reappears sufficiently often. [[Language-oriented programming|Language-Oriented Programming]] considers the creation of special-purpose languages for expressing problems a standard part of the problem solving process.
<references/>
 
=== 2012 ===
* ([[2012_ModelDrivenSoftwareEngineeringi|Brambilla et al., 2012]]) ⇒ [[Marco Brambilla]], [[Jordi Cabot]], and [[Manuel Wimmer]]. ([[2012]]). “Model-Driven Software Engineering in Practice." Morgan & Claypool Publishers. ISBN:1608458822, 9781608458820 [http://dx.doi.org/10.2200/S00441ED1V01Y201208SWE001 doi:10.2200/S00441ED1V01Y201208SWE001]
** QUOTE:
    6.4 UML Extensibility: The MiddleWay Between [[GPL]] and [[Domain-Specific Programming Language|DSL]]
    6.5 Overview on [[Domain-Specific Programming Language|DSLs (Domain Specific Languages)]]
        6.5.1 Principles of [[Domain-Specific Programming Language|DSL]]s
        6.5.2 Some Examples of [[Domain-Specific Programming Language|DSL]]s
 
=== 2010 ===
* ([[Fowler, 2010]]) ⇒ [[Martin Fowler]]. ([[2010]]). “[http://martinfowler.com/books/dsl.html Domain-specific languages]." Pearson Education.
** QUOTE: [[Domain-Specific Programming Language|DSL]]s come in two main forms: external and internal. An [[external DSL]] is a language that's parsed independently of the host general purpose language: good examples include regular expressions and CSS. External [[Domain-Specific Programming Language|DSL]]s have a strong tradition in the Unix community. Internal [[Domain-Specific Programming Language|DSL]]s are a particular form of API in a host general purpose language, often referred to as a fluent interface. The way mocking libraries, such as JMock, define expectations for tests are good examples of this, as are many of the mechanisms used by Ruby on Rails. Internal [[Domain-Specific Programming Language|DSL]]s also have a long tradition of usage, particularly in the Lisp community.
 
----
 
__NOTOC__
[[Category:Concept]]

Revision as of 04:58, 18 February 2023