How domain specific are Domain Specific Languages? Greg Michaelson School of Mathematical & Computer Sciences Heriot-Watt University.

Slides:



Advertisements
Similar presentations
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Advertisements

Object-Oriented Analysis and Design
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, Java Version, Third Edition.
Programming Languages Language Design Issues Why study programming languages Language development Software architectures Design goals Attributes of a good.
10/22/2002© 2002 Hal Perkins & UW CSEG-1 CSE 582 – Compilers Intermediate Representations Hal Perkins Autumn 2002.
1/18 CS 693/793 Lecture 09 Special Topics in Domain Specific Languages CS 693/793-1C Spring 2004 Mo, We, Fr 10:10 – 11:00 CH 430.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
Data Structures Introduction. What is data? (Latin) Plural of datum = something given.
Programming Languages Structure
Chapter 16 Programming and Languages: Telling the Computer What to Do.
Outline Chapter 1 Hardware, Software, Programming, Web surfing, … Chapter Goals –Describe the layers of a computer system –Describe the concept.
CS 104 Introduction to Computer Science and Graphics Problems Software and Programming Language (2) Programming Languages 09/26/2008 Yang Song (Prepared.
Generative Programming. Generic vs Generative Generic Programming focuses on representing families of domain concepts Generic Programming focuses on representing.
9-Aug-15 Vocabulary. Programming Vocabulary Watch closely, you might even want to take some notes. There’s a short quiz at the end of this presentation!
Java Software Solutions Lewis and Loftus Chapter 2 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Software Concepts -- Introduction.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
PROGRAMMING LANGUAGES The Study of Programming Languages.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
PZ01A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ01A -- Introduction Programming Language Design and.
There are only 10 types of people in the world, those who understand binary and those who don't.
Syntax & Semantic Introduction Organization of Language Description Abstract Syntax Formal Syntax The Way of Writing Grammars Formal Semantic.
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
1 Introduction Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Sections
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Chapter 3 Part II Describing Syntax and Semantics.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Cross Language Clone Analysis Team 2 October 13, 2010.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
12/18/2015© Hal Perkins & UW CSEG-1 CSE P 501 – Compilers Intermediate Representations Hal Perkins Winter 2008.
1-1 1 Introduction  Programming linguistics: concepts and paradigms syntax, semantics, and pragmatics language processors.  Historical development of.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Programming Language Concepts (CIS 635) Elsa L Gunter 4303 GITC NJIT,
FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.
Formal Semantics of Programming Languages 虞慧群 Topic 2: Operational Semantics.
Skill Area 311 Part B. Lecture Overview Assembly Code Assembler Format of Assembly Code Advantages Assembly Code Disadvantages Assembly Code High-Level.
Software. Introduction n A computer can’t do anything without a program of instructions. n A program is a set of instructions a computer carries out.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Software Engineering Algorithms, Compilers, & Lifecycle.
Chapter 1. Introduction.
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
CPS120 Introduction to Computer Science
Invitation to Computer Science, C++ Version, Fourth Edition
Introduction to programming languages, Algorithms & flowcharts
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
Introduction to programming languages, Algorithms & flowcharts
PROGRAMMING LANGUAGES
CSCI-235 Micro-Computer Applications
CS 3304 Comparative Languages
Computer Programming.
SOFTWARE DESIGN AND ARCHITECTURE
MatLab Programming By Kishan Kathiriya.
Invitation to Computer Science, Java Version, Third Edition
Developing Applications
Introduction to programming languages, Algorithms & flowcharts
Unit# 8: Introduction to Computer Programming
What Is Computer Science?
Ada – 1983 History’s largest design effort
Programming Languages 2nd edition Tucker and Noonan
The Programming Process
Intermediate Representations Hal Perkins Autumn 2005
Principles of Programming Languages
강의 내용 및 방법 접근방법 리포트 시험 Lambda Calculus, Proof of Correctness
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Programming Languages, Preliminaries, History & Evolution
Presentation transcript:

How domain specific are Domain Specific Languages? Greg Michaelson School of Mathematical & Computer Sciences Heriot-Watt University

Introduction tiresome writing lots of small programs for same problem area end up using same set of: – programming tropes – abstractions types data structures control

Introduction construct an ad hoc command based framework – scripts to invoke and configure individual programs nice to deploy some consistent notation oriented to problem area – with built in constructs capturing specialised abstractions domain specific language - DSL

Embeded DSL (EDSL) DSL embeded in extant host language 1. add library to host language call through API can use arbitrary host language constructs not a DSL?

Embeded DSL 2. add abstract syntax interpret abstract syntax trees call interpreter components from arbitrary host language constructs shallow embeding

Embeded DSL 3. design concrete syntax add concrete syntax -> AST compiler call interpreter component with parsed strings can embed interpreter component calls in arbitrary host language constructs shallow embeding. 4. extend extant language syntax and semantics deep embeding

Embeded DSL host language exposed – not Domain Specific? EDSL inherits semantics of host language if host language is not Turing complete (TC) then EDSL may be more expressive – can’t be less or differently expressive if host language is TC then so is EDSL – not Domain Specific?

Implemented DSL expose parser/interpreter only as stand alone language processor can only use domain specific syntax have implemented DSL in host language

Implemented DSL tend to want familiar general purpose programming language abstractions as well: – arithmetic & logic – sequence/selection/iteration – sub programs – sequences etc as DSL grows, tends to become less and less DS...

Language language = syntax + semantics semantics: program * state -> state semantics transforms initial state to final state guided by structure of program instance

Language and program program: input * state -> output * state treat outputs as part of final state program: input * state -> state program changes initial state to final state depending on input structure define input structure with syntax program is semantics of inputs does every program define a DSL?

What is domain specificity? Light Bulb Language program -> switch switch -> SWITCH |ε m [SWITCH] ON = OFF m [SWITCH] OFF = ON m [ε] ON = ON m [ε] OFF = OFF

What is domain specificity? Linear Light Bulbs Language program -> row | row program row -> switch | switch row s i ϵ switch b i ϵ {ON,OFF} m’ [s 1,...,s N ] {b 1,...,b N } = {m s 1 b 1,...,m s N b N }

What is domain specificity? Grid Light Bulbs Language program -> grid grid -> row | row grid r i ϵ row br i ϵ b* m’’ [r 1,...,r N ] {br 1,...,br N } = {m’ r 1 br 1,...,m’ r N br N }

What is domain specificity? is GLBL domain specific...? – light bulbs? – B/W image inversion? negating boolean values? – not very DS...

What is domain specificity? computer pioneers thought machine code was for configuring hardware 60’s language designers thought languages were purpose specific: – FORTRAN - sums – COBOL - accounts – ALGOL - algorithms – LISP - symbols – IMP - systems

What is domain specificity? designers of new languages think they’ve enabled something other languages can’t do new TC language ≡ old TC language + syntax + library is every language really an embeded DSL with a TC host?

DSL is about pragmatics DSL abstractions & constructs make it easier to express particular things what may be complex in an arbitrary TC language may become simpler in a DSL domain may frame choice of DSL abstractions & constructions abstractions and constructions from one domain may be appropriate for other domains