SlideShare a Scribd company logo
1 of 12
Download to read offline
DSLs: what, why, how?
What is a DSL?
DSL computer programming language
limited expressiveness
particular domain
used by humans to instruct a computer
bare minimum of features
entire system can’t be built in a DSL
sense of fluency
domain focus makes a limited language worthwhile
executable by a computer
language nature
Internal vs. external DSLs
internal DSL
external DSL
a particular way to use a GPL
embedded into GPL
script in internal DSL valid code in its host GPL
only uses a subset of GPL’s features
has a feel of custom language rather than its host language
Ruby on Rails often seen as a collection of DSLs
a separate language has custom syntax
script in external DSL parsed using text parsing techniques
Unix little languages
Graph g =
graph("example1")
.directed()
.with(
node("a")
.link(
node("b")
)
);
Command-query APIs
methods on an object
command
query
commands queries
returns a value
does not change the state of the system
may change state of the system
should not return a value
doesn’t have side effects
can be called multiple times in any order without changing the results
does have side effects
should make sense in stand-alone contextnames of methods
obj.getName()
obj.removeAt(1)
obj.toString()
obj.setName(’a’)
Command-query APIs Vaadin Framework
domain rich Internet applications
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
@Title("My UI")
public class HelloWorld extends UI {
@Override
protected void init(VaadinRequest request) {
// Create the content root layout for the UI
VerticalLayout content = new VerticalLayout();
setContent(content);
// Display the greeting
content.addComponent(new Label("Hello World!"));
// Have a clickable button
content.addComponent(new Button("Push Me!",
click -> Notification.show("Pushed!")));
}
} semantic model
http://vaadin.com
Vaadin-based language
HelloWorld {
Component content = VerticalLayout {
Component myLabel = Label {
String Label caption = “Hello world!”;
}
Component myButton = Button {
String Button caption = “Push Me!”;
Function changeCaption = () {
caption = “Pushed!”;
} listens to click;
}
}
}
HelloWorld {
VerticalLayout {
Label “Hello world!”;
Button “Push Me!” {
when click: caption = “Pushed”;
}
}
}
TouchScript (H. Westergård, 2013)
layout vertically:
label “Hello world!”
button “Push Me!” as myButton
events for myButton:
click { caption = “Pushed”; }
“Hello world!”
[“Push Me!”]
when click on [“Push Me!”] -> [“Pushed”]
numerous options on how to define a DSL
[ ] – represent a button
no names for components
“transformation operator”
similar to REBOL syntaxview layout [text "Hello world!" button "Quit" [quit]]
Why use a DSL?
tool with limited focusDSL
very specific tool for very particular conditions
typical project uses a dozen of DSLs
improving development productivity
communication with domain experts
change in execution context
alternative computation model
shift logic from compile time to runtime
The Why: development productivity
communicate intent of a part of a system
easier to understand DSLDSL vs. command-query API
aestheticsnot only code is easier to read
easier to find mistakes
easier to modify the system
limited expressiveness harder to express wrong things
DSL to wrap awkward third-party library
The Why: domain experts
domain experts
read code
write code
understand what the system thinks it’s doing
spot mistakes
talk more effectively to programmers
focus on reading code not writing
DSL shouldn’t necessarily be implemented useful to describe the system
communication issues
involving domain experts is difficult but has a high payoff
The Why: alternative computation model
mainstream programming imperative what to do and in what sequence
conditionals loopscontrol flow
declarative what should happen rather than how it should happen
state machine
decision table
Problems with DSLs (1)
language “hell”
cost of building
languages are hard to learn
far easier to learnDSL simpler than GPL
people aren’t used to building DSLs
cost of a DSL model
help think about the model reduce cost of building itDSL
too many DSLs bad DSLs
good DSL wrap a bad library
make it easier to deal with
waste of resources to maintain
cost over the cost of
Problems with DSLs (2)
ghetto language
limited
abstraction
the whole system built in a language it’s a GPL!
DSL GPLmight evolve into a
DSL should be focused on a narrow problem
ideally no features that fall outside that
DSL provides abstraction to think about subject area
behavior of the domain expressed easier
than using lower-level constructs
the world is fit into abstraction instead of the other way around
DSL something evolving unfinished

More Related Content

What's hot

Envisioning the Future of Language Workbenches
Envisioning the Future of Language WorkbenchesEnvisioning the Future of Language Workbenches
Envisioning the Future of Language WorkbenchesMarkus Voelter
 
Architecting Domain-Specific Languages
Architecting Domain-Specific LanguagesArchitecting Domain-Specific Languages
Architecting Domain-Specific LanguagesMarkus Voelter
 
BDD Testing Using Godog - Bangalore Golang Meetup # 32
BDD Testing Using Godog - Bangalore Golang Meetup # 32BDD Testing Using Godog - Bangalore Golang Meetup # 32
BDD Testing Using Godog - Bangalore Golang Meetup # 32OpenEBS
 
From Programming to Modeling And Back Again
From Programming to Modeling And Back AgainFrom Programming to Modeling And Back Again
From Programming to Modeling And Back AgainMarkus Voelter
 
CS152 Programming Paradigm
CS152 Programming Paradigm CS152 Programming Paradigm
CS152 Programming Paradigm Kaya Ota
 
Build your own Language - Why and How?
Build your own Language - Why and How?Build your own Language - Why and How?
Build your own Language - Why and How?Markus Voelter
 
Algorithm pseudocode flowchart program notes
Algorithm pseudocode flowchart program notesAlgorithm pseudocode flowchart program notes
Algorithm pseudocode flowchart program notesArghodeepPaul
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & LanguagesGaditek
 
SD & D Types of programming language
SD & D Types of programming languageSD & D Types of programming language
SD & D Types of programming languageForrester High School
 
Code Generation in Perl
Code Generation in PerlCode Generation in Perl
Code Generation in PerlIan Kluft
 
single pass compiler and its architecture
single pass compiler and its architecturesingle pass compiler and its architecture
single pass compiler and its architecturenoor ul ain
 
Windows batch scripting
Windows batch scriptingWindows batch scripting
Windows batch scriptingArghodeepPaul
 
ALPHA Script - Concept
ALPHA Script - ConceptALPHA Script - Concept
ALPHA Script - ConceptPROBOTEK
 
Metaprogramming by brandon
Metaprogramming by brandonMetaprogramming by brandon
Metaprogramming by brandonMaslowB
 

What's hot (20)

Programming Languages
Programming LanguagesProgramming Languages
Programming Languages
 
Envisioning the Future of Language Workbenches
Envisioning the Future of Language WorkbenchesEnvisioning the Future of Language Workbenches
Envisioning the Future of Language Workbenches
 
Architecting Domain-Specific Languages
Architecting Domain-Specific LanguagesArchitecting Domain-Specific Languages
Architecting Domain-Specific Languages
 
BDD Testing Using Godog - Bangalore Golang Meetup # 32
BDD Testing Using Godog - Bangalore Golang Meetup # 32BDD Testing Using Godog - Bangalore Golang Meetup # 32
BDD Testing Using Godog - Bangalore Golang Meetup # 32
 
From Programming to Modeling And Back Again
From Programming to Modeling And Back AgainFrom Programming to Modeling And Back Again
From Programming to Modeling And Back Again
 
CS152 Programming Paradigm
CS152 Programming Paradigm CS152 Programming Paradigm
CS152 Programming Paradigm
 
Build your own Language - Why and How?
Build your own Language - Why and How?Build your own Language - Why and How?
Build your own Language - Why and How?
 
Algorithm pseudocode flowchart program notes
Algorithm pseudocode flowchart program notesAlgorithm pseudocode flowchart program notes
Algorithm pseudocode flowchart program notes
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
 
SD & D Types of programming language
SD & D Types of programming languageSD & D Types of programming language
SD & D Types of programming language
 
Introduction to Go-Lang
Introduction to Go-LangIntroduction to Go-Lang
Introduction to Go-Lang
 
SD & D Implementation
SD & D ImplementationSD & D Implementation
SD & D Implementation
 
Text Editors and IDEs
Text Editors and IDEsText Editors and IDEs
Text Editors and IDEs
 
Code Generation in Perl
Code Generation in PerlCode Generation in Perl
Code Generation in Perl
 
Windows script host
Windows script hostWindows script host
Windows script host
 
Unit 1
Unit 1Unit 1
Unit 1
 
single pass compiler and its architecture
single pass compiler and its architecturesingle pass compiler and its architecture
single pass compiler and its architecture
 
Windows batch scripting
Windows batch scriptingWindows batch scripting
Windows batch scripting
 
ALPHA Script - Concept
ALPHA Script - ConceptALPHA Script - Concept
ALPHA Script - Concept
 
Metaprogramming by brandon
Metaprogramming by brandonMetaprogramming by brandon
Metaprogramming by brandon
 

Similar to DSLs: what, why, how

Vb6.0 Introduction
Vb6.0 IntroductionVb6.0 Introduction
Vb6.0 IntroductionTennyson
 
IS L04 Programming Language
IS L04 Programming LanguageIS L04 Programming Language
IS L04 Programming LanguageJan Wong
 
BIS07 Application Development - I
BIS07 Application Development - IBIS07 Application Development - I
BIS07 Application Development - IPrithwis Mukerjee
 
Plug-in Architectures
Plug-in ArchitecturesPlug-in Architectures
Plug-in Architectureselliando dias
 
Building DSLs On CLR and DLR (Microsoft.NET)
Building DSLs On CLR and DLR (Microsoft.NET)Building DSLs On CLR and DLR (Microsoft.NET)
Building DSLs On CLR and DLR (Microsoft.NET)Vitaly Baum
 
Entrepreneur’s guide to programming
Entrepreneur’s guide to programmingEntrepreneur’s guide to programming
Entrepreneur’s guide to programmingChris Callahan
 
The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84Mahmoud Samir Fayed
 
Couch DB/PouchDB approach for hybrid mobile applications
Couch DB/PouchDB approach for hybrid mobile applicationsCouch DB/PouchDB approach for hybrid mobile applications
Couch DB/PouchDB approach for hybrid mobile applicationsIhor Malytskyi
 
APIs and SDKs: Breaking Into and Succeeding in a Specialty Market
APIs and SDKs: Breaking Into and Succeeding in a Specialty MarketAPIs and SDKs: Breaking Into and Succeeding in a Specialty Market
APIs and SDKs: Breaking Into and Succeeding in a Specialty MarketScott Abel
 
Agile development with Ruby
Agile development with RubyAgile development with Ruby
Agile development with Rubykhelll
 
Accessibility in the age of the headless CMS
Accessibility in the age of the headless CMSAccessibility in the age of the headless CMS
Accessibility in the age of the headless CMSRian Rietveld
 
Software Language Design & Engineering: Mobl & Spoofax
Software Language Design & Engineering: Mobl & SpoofaxSoftware Language Design & Engineering: Mobl & Spoofax
Software Language Design & Engineering: Mobl & SpoofaxEelco Visser
 
Translation Markup Language and Universal Translation Memory
Translation Markup Language and Universal Translation MemoryTranslation Markup Language and Universal Translation Memory
Translation Markup Language and Universal Translation MemoryMichael Berkovich
 
Livecode widget course
Livecode widget courseLivecode widget course
Livecode widget coursecrazyaxe
 
The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189Mahmoud Samir Fayed
 
Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008guestd9065
 

Similar to DSLs: what, why, how (20)

Vb6.0 Introduction
Vb6.0 IntroductionVb6.0 Introduction
Vb6.0 Introduction
 
IS L04 Programming Language
IS L04 Programming LanguageIS L04 Programming Language
IS L04 Programming Language
 
BIS07 Application Development - I
BIS07 Application Development - IBIS07 Application Development - I
BIS07 Application Development - I
 
Plug-in Architectures
Plug-in ArchitecturesPlug-in Architectures
Plug-in Architectures
 
Building DSLs On CLR and DLR (Microsoft.NET)
Building DSLs On CLR and DLR (Microsoft.NET)Building DSLs On CLR and DLR (Microsoft.NET)
Building DSLs On CLR and DLR (Microsoft.NET)
 
Entrepreneur’s guide to programming
Entrepreneur’s guide to programmingEntrepreneur’s guide to programming
Entrepreneur’s guide to programming
 
WEB DEVELOPMENT
WEB DEVELOPMENTWEB DEVELOPMENT
WEB DEVELOPMENT
 
The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84
 
Couch DB/PouchDB approach for hybrid mobile applications
Couch DB/PouchDB approach for hybrid mobile applicationsCouch DB/PouchDB approach for hybrid mobile applications
Couch DB/PouchDB approach for hybrid mobile applications
 
APIs and SDKs: Breaking Into and Succeeding in a Specialty Market
APIs and SDKs: Breaking Into and Succeeding in a Specialty MarketAPIs and SDKs: Breaking Into and Succeeding in a Specialty Market
APIs and SDKs: Breaking Into and Succeeding in a Specialty Market
 
Agile development with Ruby
Agile development with RubyAgile development with Ruby
Agile development with Ruby
 
Accessibility in the age of the headless CMS
Accessibility in the age of the headless CMSAccessibility in the age of the headless CMS
Accessibility in the age of the headless CMS
 
Software Language Design & Engineering: Mobl & Spoofax
Software Language Design & Engineering: Mobl & SpoofaxSoftware Language Design & Engineering: Mobl & Spoofax
Software Language Design & Engineering: Mobl & Spoofax
 
Translation Markup Language and Universal Translation Memory
Translation Markup Language and Universal Translation MemoryTranslation Markup Language and Universal Translation Memory
Translation Markup Language and Universal Translation Memory
 
Javascript mynotes
Javascript mynotesJavascript mynotes
Javascript mynotes
 
Livecode widget course
Livecode widget courseLivecode widget course
Livecode widget course
 
Tml for Objective C
Tml for Objective CTml for Objective C
Tml for Objective C
 
The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189
 
Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008
 
C Language
C LanguageC Language
C Language
 

More from Mikhail Barash

MODELS 2020 Tutorial on MPS - Supplementary Material 8 - TextGen
MODELS 2020 Tutorial on MPS - Supplementary Material 8 - TextGen MODELS 2020 Tutorial on MPS - Supplementary Material 8 - TextGen
MODELS 2020 Tutorial on MPS - Supplementary Material 8 - TextGen Mikhail Barash
 
MODELS 2020 Tutorial on MPS - Supplementary Material 5 - Creating concept Ent...
MODELS 2020 Tutorial on MPS - Supplementary Material 5 - Creating concept Ent...MODELS 2020 Tutorial on MPS - Supplementary Material 5 - Creating concept Ent...
MODELS 2020 Tutorial on MPS - Supplementary Material 5 - Creating concept Ent...Mikhail Barash
 
MODELS 2020 Tutorial on MPS - Supplementary Material 3 - Creating editors for...
MODELS 2020 Tutorial on MPS - Supplementary Material 3 - Creating editors for...MODELS 2020 Tutorial on MPS - Supplementary Material 3 - Creating editors for...
MODELS 2020 Tutorial on MPS - Supplementary Material 3 - Creating editors for...Mikhail Barash
 
MODELS 2020 Tutorial on MPS - Supplementary Material 1 - Creating concept Entity
MODELS 2020 Tutorial on MPS - Supplementary Material 1 - Creating concept EntityMODELS 2020 Tutorial on MPS - Supplementary Material 1 - Creating concept Entity
MODELS 2020 Tutorial on MPS - Supplementary Material 1 - Creating concept EntityMikhail Barash
 
Towards a mnemonic classification of software languages
Towards a mnemonic classification of software languagesTowards a mnemonic classification of software languages
Towards a mnemonic classification of software languagesMikhail Barash
 
Worst practices for domain-specific modelling
Worst practices for domain-specific modellingWorst practices for domain-specific modelling
Worst practices for domain-specific modellingMikhail Barash
 
An ABC of JetBrains MPS
An ABC of JetBrains MPSAn ABC of JetBrains MPS
An ABC of JetBrains MPSMikhail Barash
 
KernelF: a functional core for domain-specific languages in JetBrains MPS
KernelF: a functional core for domain-specific languages in JetBrains MPSKernelF: a functional core for domain-specific languages in JetBrains MPS
KernelF: a functional core for domain-specific languages in JetBrains MPSMikhail Barash
 
Reflections on teaching JetBrains MPS within a university course
Reflections on teaching JetBrains MPS within a university courseReflections on teaching JetBrains MPS within a university course
Reflections on teaching JetBrains MPS within a university courseMikhail Barash
 
Language Workbench Language Wheel
Language Workbench Language WheelLanguage Workbench Language Wheel
Language Workbench Language WheelMikhail Barash
 
Design dimensions of DSLs
Design dimensions of DSLsDesign dimensions of DSLs
Design dimensions of DSLsMikhail Barash
 
JetBrains MPS: Typesystem Aspect
JetBrains MPS: Typesystem AspectJetBrains MPS: Typesystem Aspect
JetBrains MPS: Typesystem AspectMikhail Barash
 
JetBrains MPS: Editor Aspect
JetBrains MPS: Editor AspectJetBrains MPS: Editor Aspect
JetBrains MPS: Editor AspectMikhail Barash
 
JetBrains MPS: Structure Aspect
JetBrains MPS: Structure AspectJetBrains MPS: Structure Aspect
JetBrains MPS: Structure AspectMikhail Barash
 
Xtext: type checking and scoping
Xtext: type checking and scopingXtext: type checking and scoping
Xtext: type checking and scopingMikhail Barash
 
Xtext: code generation
Xtext: code generationXtext: code generation
Xtext: code generationMikhail Barash
 
Xtext: validation, quickfixes, custom formatting
Xtext: validation, quickfixes, custom formattingXtext: validation, quickfixes, custom formatting
Xtext: validation, quickfixes, custom formattingMikhail Barash
 
Xtend Programming Language
Xtend Programming LanguageXtend Programming Language
Xtend Programming LanguageMikhail Barash
 
Xtext: Eclipse Modeling Framework
Xtext: Eclipse Modeling FrameworkXtext: Eclipse Modeling Framework
Xtext: Eclipse Modeling FrameworkMikhail Barash
 

More from Mikhail Barash (20)

MODELS 2020 Tutorial on MPS - Supplementary Material 8 - TextGen
MODELS 2020 Tutorial on MPS - Supplementary Material 8 - TextGen MODELS 2020 Tutorial on MPS - Supplementary Material 8 - TextGen
MODELS 2020 Tutorial on MPS - Supplementary Material 8 - TextGen
 
MODELS 2020 Tutorial on MPS - Supplementary Material 5 - Creating concept Ent...
MODELS 2020 Tutorial on MPS - Supplementary Material 5 - Creating concept Ent...MODELS 2020 Tutorial on MPS - Supplementary Material 5 - Creating concept Ent...
MODELS 2020 Tutorial on MPS - Supplementary Material 5 - Creating concept Ent...
 
MODELS 2020 Tutorial on MPS - Supplementary Material 3 - Creating editors for...
MODELS 2020 Tutorial on MPS - Supplementary Material 3 - Creating editors for...MODELS 2020 Tutorial on MPS - Supplementary Material 3 - Creating editors for...
MODELS 2020 Tutorial on MPS - Supplementary Material 3 - Creating editors for...
 
MODELS 2020 Tutorial on MPS - Supplementary Material 1 - Creating concept Entity
MODELS 2020 Tutorial on MPS - Supplementary Material 1 - Creating concept EntityMODELS 2020 Tutorial on MPS - Supplementary Material 1 - Creating concept Entity
MODELS 2020 Tutorial on MPS - Supplementary Material 1 - Creating concept Entity
 
Towards a mnemonic classification of software languages
Towards a mnemonic classification of software languagesTowards a mnemonic classification of software languages
Towards a mnemonic classification of software languages
 
Worst practices for domain-specific modelling
Worst practices for domain-specific modellingWorst practices for domain-specific modelling
Worst practices for domain-specific modelling
 
An ABC of JetBrains MPS
An ABC of JetBrains MPSAn ABC of JetBrains MPS
An ABC of JetBrains MPS
 
KernelF: a functional core for domain-specific languages in JetBrains MPS
KernelF: a functional core for domain-specific languages in JetBrains MPSKernelF: a functional core for domain-specific languages in JetBrains MPS
KernelF: a functional core for domain-specific languages in JetBrains MPS
 
Reflections on teaching JetBrains MPS within a university course
Reflections on teaching JetBrains MPS within a university courseReflections on teaching JetBrains MPS within a university course
Reflections on teaching JetBrains MPS within a university course
 
Language Workbench Language Wheel
Language Workbench Language WheelLanguage Workbench Language Wheel
Language Workbench Language Wheel
 
Design dimensions of DSLs
Design dimensions of DSLsDesign dimensions of DSLs
Design dimensions of DSLs
 
JetBrains MPS: Typesystem Aspect
JetBrains MPS: Typesystem AspectJetBrains MPS: Typesystem Aspect
JetBrains MPS: Typesystem Aspect
 
JetBrains MPS: Editor Aspect
JetBrains MPS: Editor AspectJetBrains MPS: Editor Aspect
JetBrains MPS: Editor Aspect
 
JetBrains MPS: Structure Aspect
JetBrains MPS: Structure AspectJetBrains MPS: Structure Aspect
JetBrains MPS: Structure Aspect
 
Projectional editing
Projectional editingProjectional editing
Projectional editing
 
Xtext: type checking and scoping
Xtext: type checking and scopingXtext: type checking and scoping
Xtext: type checking and scoping
 
Xtext: code generation
Xtext: code generationXtext: code generation
Xtext: code generation
 
Xtext: validation, quickfixes, custom formatting
Xtext: validation, quickfixes, custom formattingXtext: validation, quickfixes, custom formatting
Xtext: validation, quickfixes, custom formatting
 
Xtend Programming Language
Xtend Programming LanguageXtend Programming Language
Xtend Programming Language
 
Xtext: Eclipse Modeling Framework
Xtext: Eclipse Modeling FrameworkXtext: Eclipse Modeling Framework
Xtext: Eclipse Modeling Framework
 

Recently uploaded

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 

Recently uploaded (20)

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 

DSLs: what, why, how

  • 2. What is a DSL? DSL computer programming language limited expressiveness particular domain used by humans to instruct a computer bare minimum of features entire system can’t be built in a DSL sense of fluency domain focus makes a limited language worthwhile executable by a computer language nature
  • 3. Internal vs. external DSLs internal DSL external DSL a particular way to use a GPL embedded into GPL script in internal DSL valid code in its host GPL only uses a subset of GPL’s features has a feel of custom language rather than its host language Ruby on Rails often seen as a collection of DSLs a separate language has custom syntax script in external DSL parsed using text parsing techniques Unix little languages Graph g = graph("example1") .directed() .with( node("a") .link( node("b") ) );
  • 4. Command-query APIs methods on an object command query commands queries returns a value does not change the state of the system may change state of the system should not return a value doesn’t have side effects can be called multiple times in any order without changing the results does have side effects should make sense in stand-alone contextnames of methods obj.getName() obj.removeAt(1) obj.toString() obj.setName(’a’)
  • 5. Command-query APIs Vaadin Framework domain rich Internet applications import com.vaadin.server.VaadinRequest; import com.vaadin.ui.Label; import com.vaadin.ui.UI; @Title("My UI") public class HelloWorld extends UI { @Override protected void init(VaadinRequest request) { // Create the content root layout for the UI VerticalLayout content = new VerticalLayout(); setContent(content); // Display the greeting content.addComponent(new Label("Hello World!")); // Have a clickable button content.addComponent(new Button("Push Me!", click -> Notification.show("Pushed!"))); } } semantic model http://vaadin.com
  • 6. Vaadin-based language HelloWorld { Component content = VerticalLayout { Component myLabel = Label { String Label caption = “Hello world!”; } Component myButton = Button { String Button caption = “Push Me!”; Function changeCaption = () { caption = “Pushed!”; } listens to click; } } } HelloWorld { VerticalLayout { Label “Hello world!”; Button “Push Me!” { when click: caption = “Pushed”; } } } TouchScript (H. Westergård, 2013) layout vertically: label “Hello world!” button “Push Me!” as myButton events for myButton: click { caption = “Pushed”; } “Hello world!” [“Push Me!”] when click on [“Push Me!”] -> [“Pushed”] numerous options on how to define a DSL [ ] – represent a button no names for components “transformation operator” similar to REBOL syntaxview layout [text "Hello world!" button "Quit" [quit]]
  • 7. Why use a DSL? tool with limited focusDSL very specific tool for very particular conditions typical project uses a dozen of DSLs improving development productivity communication with domain experts change in execution context alternative computation model shift logic from compile time to runtime
  • 8. The Why: development productivity communicate intent of a part of a system easier to understand DSLDSL vs. command-query API aestheticsnot only code is easier to read easier to find mistakes easier to modify the system limited expressiveness harder to express wrong things DSL to wrap awkward third-party library
  • 9. The Why: domain experts domain experts read code write code understand what the system thinks it’s doing spot mistakes talk more effectively to programmers focus on reading code not writing DSL shouldn’t necessarily be implemented useful to describe the system communication issues involving domain experts is difficult but has a high payoff
  • 10. The Why: alternative computation model mainstream programming imperative what to do and in what sequence conditionals loopscontrol flow declarative what should happen rather than how it should happen state machine decision table
  • 11. Problems with DSLs (1) language “hell” cost of building languages are hard to learn far easier to learnDSL simpler than GPL people aren’t used to building DSLs cost of a DSL model help think about the model reduce cost of building itDSL too many DSLs bad DSLs good DSL wrap a bad library make it easier to deal with waste of resources to maintain cost over the cost of
  • 12. Problems with DSLs (2) ghetto language limited abstraction the whole system built in a language it’s a GPL! DSL GPLmight evolve into a DSL should be focused on a narrow problem ideally no features that fall outside that DSL provides abstraction to think about subject area behavior of the domain expressed easier than using lower-level constructs the world is fit into abstraction instead of the other way around DSL something evolving unfinished