Internal DSLs from API design to languages SoftLang Team, - - PowerPoint PPT Presentation

internal dsls
SMART_READER_LITE
LIVE PREVIEW

Internal DSLs from API design to languages SoftLang Team, - - PowerPoint PPT Presentation

Internal DSLs from API design to languages SoftLang Team, University of Koblenz-Landau Prof. Dr. Ralf Lmmel Msc. Johannes Hrtel Msc. Marcel Heinz (C) 2018, SoftLang Team, University of Koblenz-Landau Fluent Interfaces from


slide-1
SLIDE 1

Internal DSLs

from API design to languages

(C) 2018, SoftLang Team, University of Koblenz-Landau

SoftLang Team, University of Koblenz-Landau

  • Prof. Dr. Ralf Lämmel
  • Msc. Johannes Härtel
  • Msc. Marcel Heinz
slide-2
SLIDE 2

Fluent Interfaces

Pure OO-Style

(C) 2018, SoftLang Team, University of Koblenz-Landau

from https://martinfowler.com/bliki/FluentInterface.html Fluent API (Method Chaining + Other Beneficial Design Choices)

slide-3
SLIDE 3

Fluent Interfaces (Object-Orientation)

Fluent API (Method Chaining + Other Beneficial Design Choices)

(C) 2018, SoftLang Team, University of Koblenz-Landau

Joe wants API users to write concise code. OO-Guy

slide-4
SLIDE 4

Fluent Interfaces (Software Language Engineering)

Fluent API (Method Chaining + Other Beneficial Design Choices)

(C) 2018, SoftLang Team, University of Koblenz-Landau

SLE-Guy Hey, this looks like an independent format for orders.

slide-5
SLIDE 5

Technological Spaces

Kurtev, I., Bézivin, J. and Aksit, M., 2002. Technological spaces: An initial appraisal. CoopIS, DOA, 2002.

SLE-Guy OO-Guy Big Data-Guy NLP-Guy

(C) 2018, SoftLang Team, University of Koblenz-Landau

slide-6
SLIDE 6

Fluent Interfaces (Software Language Engineering)

Fluent API (Method Chaining + Other Beneficial Design Choices)

(C) 2018, SoftLang Team, University of Koblenz-Landau

SLE-Guy Hey, this looks like an independent format for orders.

slide-7
SLIDE 7

Chrestomathies @ Softlang

  • 101companies exists for demonstrating

programming technologies in general by implementing a business scenario.

  • Metalib exists for demonstrating programming

technologies in the technical domain of implementing domain-specific languages.

○ Java internal DSL ○ Python internal DSL (C) 2018, SoftLang Team, University of Koblenz-Landau

slide-8
SLIDE 8

Domain-Specific Language (DSL) - Definition

“A domain-specific language (DSL) is a programming language or executable specification language that

  • ffers, through appropriate notations and

abstractions, expressive power focused on, and usually restricted to, a particular problem domain.” van Deursen, A., Klint, P., Visser, J.: Domain-specific languages: An annotated bibliography. SIGPLAN Not. 35(6), 26–36 (2000)

(C) 2018, SoftLang Team, University of Koblenz-Landau

slide-9
SLIDE 9

Domain-specific vs. General purpose

  • Domain Only DSLs have a relatively small and

well-defined domain.

  • Language size GPLs are large. DSLs are

typically small.

  • Turing completeness DSLs may not be Turing

complete.

  • Lifespan GPLs live for years to decades. DSLs

may live for months only.

  • Designed by GPLs are designed by gurus or
  • committees. DSLs are designed by a few

software engineers and domain experts.

  • Evolution GPLs evolve slowly. The evolution of

DSLs is fast-paced.

  • Deprecation/incompatible changes This is

almost impossible for GPLs; it is feasible and relatively common for DSLs.

  • R. Lämmel (2018). “Software languages: Syntax, semantics,

and metaprogramming". Springer (C) 2018, SoftLang Team, University of Koblenz-Landau

slide-10
SLIDE 10
slide-11
SLIDE 11
slide-12
SLIDE 12
slide-13
SLIDE 13
slide-14
SLIDE 14
slide-15
SLIDE 15
slide-16
SLIDE 16
slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20
slide-21
SLIDE 21
slide-22
SLIDE 22
slide-23
SLIDE 23
slide-24
SLIDE 24
slide-25
SLIDE 25
slide-26
SLIDE 26
slide-27
SLIDE 27
slide-28
SLIDE 28
slide-29
SLIDE 29
slide-30
SLIDE 30
slide-31
SLIDE 31
slide-32
SLIDE 32

DSL Implementation

(C) 2018, SoftLang Team, University of Koblenz-Landau

slide-33
SLIDE 33

Metalib

  • https://softlang.github.io/metalib/

(C) 2018, SoftLang Team, University of Koblenz-Landau

slide-34
SLIDE 34

Outlook

  • Simplified: Internal DSLs make use of an

existing programming language environment.

  • How to implement FSML as an own

independent language?

○ Parsing ○ Code generation (C) 2018, SoftLang Team, University of Koblenz-Landau