itu frp 2010 - university of nottingham

73
ITU FRP 2010 Lecture 7: Functional Programming Gets Physical Henrik Nilsson School of Computer Science University of Nottingham ITU FRP 2010: Lecture 7 – p.1/56

Upload: others

Post on 16-Oct-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ITU FRP 2010 - University of Nottingham

ITU FRP 2010Lecture 7:

Functional Programming Gets Physical

Henrik Nilsson

School of Computer Science

University of Nottingham

ITU FRP 2010: Lecture 7 – p.1/56

Page 2: ITU FRP 2010 - University of Nottingham

Modelling and Simulation (1)

Developing models and studying their propertiesand behaviour are of immense theoretical andpractical importance. Some examples:

• Science:- Weather forecasting- Biological cell models (e.g. neurons,

neocortical column)- Galaxy formation- and many, many more . . .

ITU FRP 2010: Lecture 7 – p.2/56

Page 3: ITU FRP 2010 - University of Nottingham

Modelling and Simulation (2)

• Engineering, from nanotechnology toskyscrapers and space shuttles:- initial development- performance optimisation- safety engineering

ITU FRP 2010: Lecture 7 – p.3/56

Page 4: ITU FRP 2010 - University of Nottingham

Early Mechanical Simulation Efforts

British wooden mechanical horse simulator

ITU FRP 2010: Lecture 7 – p.4/56

Page 5: ITU FRP 2010 - University of Nottingham

Computer Modelling and Simulation

• Modelling and simulation has been a mainapplication of digital computers from the start:Monte Carlo simulation of nuclear detonation(Manhattan project, Los Alamos)

• Recent examples:- Los Alamos molecular ribosome model:

2.64 million atoms.- The Blue Brain Project: Simulation of

10000-neuron, biologically accurateneocortical column on 8192-processor IBMBlue Gene super computer.

ITU FRP 2010: Lecture 7 – p.5/56

Page 6: ITU FRP 2010 - University of Nottingham

DSLs and Modelling (1)

The need for Domain-Specific languages to allowscientists and engineers to develop models isevident:

• Domain-experts are usually not programmers• The scale of the problems is such that

high-level, domain-specific notation and toolsare essential to get the work done.

ITU FRP 2010: Lecture 7 – p.6/56

Page 7: ITU FRP 2010 - University of Nottingham

DSLs and Modelling (2)

Some examples:

• Spice (analogue circuits)• VHDL-AMS (mixed digital/analogue circuits)• NEURON (neuron modelling)• gPROMS (process industries)• Simulink (domain-neutral, continuous-time)• Stateflow (event-driven simulation)• Modelica (domain-neutral, hybrid)

ITU FRP 2010: Lecture 7 – p.7/56

Page 8: ITU FRP 2010 - University of Nottingham

DSLs and Modelling (3)

Quote from NEURON site (www.neuron.yale.edu):

Instead of forcing users to reformulate their conceptual

models to fit the requirements of a general purpose

simulator, NEURON is designed to let them deal directly

with familiar neuroscience concepts. Consequently,

users can think in terms of the biophysical properties of

membrane and cytoplasm, the branched architecture of

neurons, and the effects of synaptic communication

between cells.

ITU FRP 2010: Lecture 7 – p.8/56

Page 9: ITU FRP 2010 - University of Nottingham

Reflection

Modelling and simulation constitute a big,diverse, and very important application area witha clear need for DSLs. But it is also “crowded”:there are plenty of successful DSLs already, both

• multi-(modelling-)domain• (modelling-)domain-specific

Question: What can Computer Science andspecifically Programming LanguageResearch contribute?

ITU FRP 2010: Lecture 7 – p.9/56

Page 10: ITU FRP 2010 - University of Nottingham

The Rest of This Talk

• Declarative, non-causal, hybrid modelling ofphysical systems:- electrical circuits- robot manipulators- chemical plants- . . .

• Modelica• Functional Hybrid Modelling

ITU FRP 2010: Lecture 7 – p.10/56

Page 11: ITU FRP 2010 - University of Nottingham

Non-Causal, Hybrid Modelling?

ITU FRP 2010: Lecture 7 – p.11/56

Page 12: ITU FRP 2010 - University of Nottingham

Non-Causal, Hybrid Modelling?

• Declarative, non-causal : models expressedas systems of undirected DifferentialAlgebraic Equations (DAE)

ITU FRP 2010: Lecture 7 – p.11/56

Page 13: ITU FRP 2010 - University of Nottingham

Non-Causal, Hybrid Modelling?

• Declarative, non-causal : models expressedas systems of undirected DifferentialAlgebraic Equations (DAE)

• Multi-domain : models spanning multiplephysical domains

ITU FRP 2010: Lecture 7 – p.11/56

Page 14: ITU FRP 2010 - University of Nottingham

Non-Causal, Hybrid Modelling?

• Declarative, non-causal : models expressedas systems of undirected DifferentialAlgebraic Equations (DAE)

• Multi-domain : models spanning multiplephysical domains

• Hybrid : models exhibiting both continuous-time and discrete time behaviour; e.g.,structural changes at discrete points in time:- model simplifications- structural changes- discrete subsystems

ITU FRP 2010: Lecture 7 – p.11/56

Page 15: ITU FRP 2010 - University of Nottingham

Causal vs. Non-Causal Modelling (1)

Causal or block-oriented modelling: model isODE in explicit form:

x′ = f(x,u, t)

Causality , i.e. cause-effect relationship, given bythe modeller. Cf. Functional Programming.

Causal modelling is the dominating modellingparadigm; languages include Simulink.

ITU FRP 2010: Lecture 7 – p.12/56

Page 16: ITU FRP 2010 - University of Nottingham

Causal vs. Non-Causal Modelling (2)

Non-causal or “object-oriented ” modelling:model is DAE in implicit form:

f(x,x′,w,u, t) = 0

Causality inferred by simulation tool from usagecontext. Cf. Logic Programming.

Non-causal modelling is a fairly recentdevelopment; languages include Dymola andModelica.

ITU FRP 2010: Lecture 7 – p.13/56

Page 17: ITU FRP 2010 - University of Nottingham

Causal Modelling: Example (1)

uR2= R2i2

uL = uin − uR2

i2′ =

uL

LuR1

= uin − uC

i1 =uR1

R1

uC′ =

i1

Ci = i1 + i2

ITU FRP 2010: Lecture 7 – p.14/56

Page 18: ITU FRP 2010 - University of Nottingham

Causal Modelling: Example (2)

Or, as a block diagram:

ITU FRP 2010: Lecture 7 – p.15/56

Page 19: ITU FRP 2010 - University of Nottingham

Drawbacks of Causal Modelling

Causal modelling bad fit for fundamentallynon-causal domains like physical modelling:

• Structure of model and modelled systemdoes not agree.

• Model not simple composition of models ofphysical components.

• Fixed causality hampers reuse.• Burden of deriving a non-causal model rests

with the modeller.

ITU FRP 2010: Lecture 7 – p.16/56

Page 20: ITU FRP 2010 - University of Nottingham

Non-Causal Modelling: Example (1)

Non-causal resistor model:

u = vp − vn

ip + in = 0

u = Rip

Non-causal inductor model:

u = vp − vn

ip + in = 0

u = Lip′

ITU FRP 2010: Lecture 7 – p.17/56

Page 21: ITU FRP 2010 - University of Nottingham

Non-Causal Modelling: Example (2)

A non-causal model of the entire circuit iscreated by instantiating the component models:copy the equations and rename the variables.

The instantiated components are thencomposed by adding connection equationsaccording to Kirchhoff’s laws, e.g.:

vR1,n = vC,p

iR1,n + iC,p = 0

Very direct: can be accomplished through adrag-and-drop GUI.

ITU FRP 2010: Lecture 7 – p.18/56

Page 22: ITU FRP 2010 - University of Nottingham

Modelica (1)

Modelica:

• non-causal• declarative• domain-neutral; supports e.g.

- mechanical- electrical- hydraulic- thermal

modelling and multi-modelling.ITU FRP 2010: Lecture 7 – p.19/56

Page 23: ITU FRP 2010 - University of Nottingham

Modelica (2)

• Being developed since late 1990s.• Supported by a number of sophisticated

implementations (e.g. from Dynasim (part ofDassault, using Modelica with CAD systemCATIA), Maplesoft, ITI GmbH).

• Standard library with 780 generic modelcomponents, 550 functions.

• In widespread use; e.g. in automotiveindustry (Ford, GM, Toyota, . . . ).

ITU FRP 2010: Lecture 7 – p.20/56

Page 24: ITU FRP 2010 - University of Nottingham

Modelica (3)

• Integrated language support for GUImodelling and simulation:- Models can be decorated with graphical

annotations to specify the graphical view.- Ways to associate model parameters and

variables with textual descriptions.

(However, not all language constructs have agraphical representation.)

ITU FRP 2010: Lecture 7 – p.21/56

Page 25: ITU FRP 2010 - University of Nottingham

Modelica (4)

Modelling and simulation through typical GUI

ITU FRP 2010: Lecture 7 – p.22/56

Page 26: ITU FRP 2010 - University of Nottingham

Simple Circuit in Modelica (1)

connector PinVoltage v;flow Current i;

end Pin;

partial model TwoPinPin p, n;Voltage u;

equationu = p.v - n.v;p.i + n.i = 0;

end TwoPin

ITU FRP 2010: Lecture 7 – p.23/56

Page 27: ITU FRP 2010 - University of Nottingham

Simple Circuit in Modelica (2)

model Resistorextends TwoPin;parameter Resistance R;

equationR * p.i = u;

end Resistor;

model Inductorextends TwoPin;parameter Inductance L;

equationL * der(p.i) = u;

end Inductor;

ITU FRP 2010: Lecture 7 – p.24/56

Page 28: ITU FRP 2010 - University of Nottingham

Simple Circuit in Modelica (3)

model SimpleCircuitResistor R1(R=1000), R2(R=2200);Capacitor C(C=0.00047);Inductor L(L=0.01);VsourceAC AC(AC=12);Ground G;

equationconnect(AC.p, R1.p);connect(R1.n, C.p);connect(C.n, AC.n);connect(R1.p, R2.p);connect(R2.n, L.p);connect(L.n, C.n);connect(AC.n, G.p);

end;

ITU FRP 2010: Lecture 7 – p.25/56

Page 29: ITU FRP 2010 - University of Nottingham

Any Issues? (1)

ITU FRP 2010: Lecture 7 – p.26/56

Page 30: ITU FRP 2010 - University of Nottingham

Any Issues? (1)

• Modelica representative of many DSLs inbeing designed with strong input from theusers , i.e. domain experts with in depthunderstanding of

ITU FRP 2010: Lecture 7 – p.26/56

Page 31: ITU FRP 2010 - University of Nottingham

Any Issues? (1)

• Modelica representative of many DSLs inbeing designed with strong input from theusers , i.e. domain experts with in depthunderstanding of- what the needs are

ITU FRP 2010: Lecture 7 – p.26/56

Page 32: ITU FRP 2010 - University of Nottingham

Any Issues? (1)

• Modelica representative of many DSLs inbeing designed with strong input from theusers , i.e. domain experts with in depthunderstanding of- what the needs are- how to meet those needs using current

technology.

ITU FRP 2010: Lecture 7 – p.26/56

Page 33: ITU FRP 2010 - University of Nottingham

Any Issues? (1)

• Modelica representative of many DSLs inbeing designed with strong input from theusers , i.e. domain experts with in depthunderstanding of- what the needs are- how to meet those needs using current

technology.• As a result, Modelica is a great language for

“getting the job done”.

ITU FRP 2010: Lecture 7 – p.26/56

Page 34: ITU FRP 2010 - University of Nottingham

Any Issues? (2)

But, Modelica has recognised limitations, and,from a CS perspective, the Modelica designarguably cuts a few corners. For example:

ITU FRP 2010: Lecture 7 – p.27/56

Page 35: ITU FRP 2010 - University of Nottingham

Any Issues? (2)

But, Modelica has recognised limitations, and,from a CS perspective, the Modelica designarguably cuts a few corners. For example:

• Limited hybrid modelling capabilities.

ITU FRP 2010: Lecture 7 – p.27/56

Page 36: ITU FRP 2010 - University of Nottingham

Any Issues? (2)

But, Modelica has recognised limitations, and,from a CS perspective, the Modelica designarguably cuts a few corners. For example:

• Limited hybrid modelling capabilities.• “Declarative”, but imperative origins show

(both syntactically and semantically).

ITU FRP 2010: Lecture 7 – p.27/56

Page 37: ITU FRP 2010 - University of Nottingham

Any Issues? (2)

But, Modelica has recognised limitations, and,from a CS perspective, the Modelica designarguably cuts a few corners. For example:

• Limited hybrid modelling capabilities.• “Declarative”, but imperative origins show

(both syntactically and semantically).• Very complicated, rather ad-hoc type system.

ITU FRP 2010: Lecture 7 – p.27/56

Page 38: ITU FRP 2010 - University of Nottingham

Any Issues? (2)

But, Modelica has recognised limitations, and,from a CS perspective, the Modelica designarguably cuts a few corners. For example:

• Limited hybrid modelling capabilities.• “Declarative”, but imperative origins show

(both syntactically and semantically).• Very complicated, rather ad-hoc type system.

I believe Programming Language Researchcan provide useful input to address some ofthese concerns.

ITU FRP 2010: Lecture 7 – p.27/56

Page 39: ITU FRP 2010 - University of Nottingham

The Breaking Pendulum (1)

Pendulum modelled aspoint mass fixed at theend of rigid, mass-lessrod, subject to gravityand applied torque. Rodbreaks at given point intime, allowing mass to fallfreely.

ITU FRP 2010: Lecture 7 – p.28/56

Page 40: ITU FRP 2010 - University of Nottingham

The Breaking Pendulum (2)

model BreakingPendulum

parameter Real m=1, g=9.81, L=0.5;

parameter Boolean Broken;

input Real u;

Real pos[2], vel[2];

Real phi(start=PI/4), phid;

...

ITU FRP 2010: Lecture 7 – p.29/56

Page 41: ITU FRP 2010 - University of Nottingham

The Breaking Pendulum (3)...

equation

vel = der(pos);

if not Broken then

// Equations for pendulum.

pos = {L*sin(phi), -L*cos(phi)};

phid = der(phi);

m*L*L*der(phid) + m*g*L*sin(phi) = u;

else

// Equations for mass falling freely.

m*der(vel) = m*{0, -g};

end if;

end BreakingPendulum;ITU FRP 2010: Lecture 7 – p.30/56

Page 42: ITU FRP 2010 - University of Nottingham

The Breaking Pendulum (3)

Unfortunately, Modelica does not allow Brokento change during simulation in this case, as theimplied structural changes are too radical.What are the reasons?

• Lots of hard simulation problems in thegeneral case.

• Language design decision: Modelicadesigned to allow compilation of simulationcode prior to simulation.

ITU FRP 2010: Lecture 7 – p.31/56

Page 43: ITU FRP 2010 - University of Nottingham

Functional Hybrid Modelling (1)

Functional Hybrid Modelling (FHM):

ITU FRP 2010: Lecture 7 – p.32/56

Page 44: ITU FRP 2010 - University of Nottingham

Functional Hybrid Modelling (1)

Functional Hybrid Modelling (FHM):• Novel approach to designing purely

declarative languages for non-causalmodelling and simulation.

ITU FRP 2010: Lecture 7 – p.32/56

Page 45: ITU FRP 2010 - University of Nottingham

Functional Hybrid Modelling (1)

Functional Hybrid Modelling (FHM):• Novel approach to designing purely

declarative languages for non-causalmodelling and simulation.

• Vehicle for research into semanticfoundations with a view to- improve hybrid capabilities- designing domain-specific type systems

ITU FRP 2010: Lecture 7 – p.32/56

Page 46: ITU FRP 2010 - University of Nottingham

Functional Hybrid Modelling (1)

Functional Hybrid Modelling (FHM):• Novel approach to designing purely

declarative languages for non-causalmodelling and simulation.

• Vehicle for research into semanticfoundations with a view to- improve hybrid capabilities- designing domain-specific type systems

• Modelling language in its own right, as well asa “back-end” for more traditional languages.

ITU FRP 2010: Lecture 7 – p.32/56

Page 47: ITU FRP 2010 - University of Nottingham

Functional Hybrid Modelling (2)

• FHM was inspired by Functional ReactiveProgramming, in particular Yampa.

• Initially joint work with Paul Hudak and JohnPeterson.

• Currently working with George Giorgidze.

ITU FRP 2010: Lecture 7 – p.33/56

Page 48: ITU FRP 2010 - University of Nottingham

Yampa in a Nutshell (1)

• Yampa (in principle) supports causalmodelling through functions ontime-continuous signals , so called SignalFunctions . Conceptually:Signal α ≈ Time→α

SF α β ≈ Signal α →Signal β

• Think block diagrams:

ITU FRP 2010: Lecture 7 – p.34/56

Page 49: ITU FRP 2010 - University of Nottingham

Yampa in a Nutshell (2)

• Yampa has two “layers”:- The functional layer , or host language

(Haskell)- The reactive layer : signal functions and

related constructs• Signal Functions are first class entities in

the functional layer. As a result:- (Some) meta modelling capabilities for free.- Very flexible hybrid modelling as new

models can be computed dynamically,during simulation.

ITU FRP 2010: Lecture 7 – p.35/56

Page 50: ITU FRP 2010 - University of Nottingham

Yampa in a Nutshell (3)

• In typical hybrid fashion, execution alternatesbetween:- event processing at discrete points in time,

possibly resulting in structuralreconfigurations (functional layer)

- processing of (conceptually) continuoussignals in between events (reactive layer).

ITU FRP 2010: Lecture 7 – p.36/56

Page 51: ITU FRP 2010 - University of Nottingham

Example: Space Invaders

ITU FRP 2010: Lecture 7 – p.37/56

Page 52: ITU FRP 2010 - University of Nottingham

Back to FHM

FHM attempts to combine the advantages ofFRP with non-causal modelling:

ITU FRP 2010: Lecture 7 – p.38/56

Page 53: ITU FRP 2010 - University of Nottingham

Back to FHM

FHM attempts to combine the advantages ofFRP with non-causal modelling:

• First-class relations on signals instead offunctions on signals to enable non-causalmodelling.

ITU FRP 2010: Lecture 7 – p.38/56

Page 54: ITU FRP 2010 - University of Nottingham

Back to FHM

FHM attempts to combine the advantages ofFRP with non-causal modelling:

• First-class relations on signals instead offunctions on signals to enable non-causalmodelling.

• Employ state-of-the-art symbolic andnumerical methods for sound and efficientsimulation.

ITU FRP 2010: Lecture 7 – p.38/56

Page 55: ITU FRP 2010 - University of Nottingham

Back to FHM

FHM attempts to combine the advantages ofFRP with non-causal modelling:

• First-class relations on signals instead offunctions on signals to enable non-causalmodelling.

• Employ state-of-the-art symbolic andnumerical methods for sound and efficientsimulation.

Think of a signal relation as a (fragment of) aDAE system.

ITU FRP 2010: Lecture 7 – p.38/56

Page 56: ITU FRP 2010 - University of Nottingham

First class signal relations

The type for e.g. a binary signal relation:SR (Real, Real)

E.g. the derivative relation:der :: SR (Real, Real)

ITU FRP 2010: Lecture 7 – p.39/56

Page 57: ITU FRP 2010 - University of Nottingham

Defining Relations

The following construct denotes a signal relation:

sigrel pattern where equations

The pattern introduces signal variables that ateach point in time are going to be bound to to a“sample” of the corresponding signal.

Given p :: t, we have:sigrel p where . . . :: SR t

ITU FRP 2010: Lecture 7 – p.40/56

Page 58: ITU FRP 2010 - University of Nottingham

Equations

Let ei :: ti be non-relational expressions possiblyintroducing new signal variables.

Point-wise equality; the equality must hold for allpoints in time:

e1 = e2

Relation application ; the relation must hold forall points in time:

sr ⋄ e3

Here, sr is an expression having type SR t3.

ITU FRP 2010: Lecture 7 – p.41/56

Page 59: ITU FRP 2010 - University of Nottingham

Modelling Electrical Components (1)

The type Pin is assumed to be a record typedescribing an electrical connection. It has fields v

for voltage and i for current.twoPin :: SR (Pin, Pin, Voltage)twoPin = sigrel (p, n, v) where

v = p.v − n.vp.i + n.i = 0

ITU FRP 2010: Lecture 7 – p.42/56

Page 60: ITU FRP 2010 - University of Nottingham

Modelling Electrical Components (2)

resistor :: Resistance→ SR (Pin, Pin)resistor r = sigrel (p, n) where

twoPin ⋄ (p, n, v)r · p.i = v

inductor :: Inductance→ SR (Pin, Pin)inductor l = sigrel (p, n) where

twoPin ⋄ (p, n, v)l · der(p.i) = v

ITU FRP 2010: Lecture 7 – p.43/56

Page 61: ITU FRP 2010 - University of Nottingham

Modelling an Electrical Circuit (1)

simpleCircuit :: SR CurrentsimpleCircuit = sigrel i where

resistor(1000) ⋄ (r1p, r1n)resistor(2200) ⋄ (r2p, r2n)capacitor(0.00047) ⋄ (cp, cn)inductor(0.01) ⋄ (lp, ln)vSourceAC (12) ⋄ (acp, acn)ground ⋄ gp

. . .

ITU FRP 2010: Lecture 7 – p.44/56

Page 62: ITU FRP 2010 - University of Nottingham

Modelling an Electrical Circuit (2)

. . .connect acp, r1p, r2pconnect r1n, cp

connect r2n, lp

connect acn, cn, ln, gp

i = r1p.i + r2p.i

ITU FRP 2010: Lecture 7 – p.45/56

Page 63: ITU FRP 2010 - University of Nottingham

Prototype Hydra Implementation (1)Our current FHM instance is called Hydra :

• Embedding in Haskell using quasiquoting .• Model transformed to form suitable for

simulation by an embedded compiler.• The resulting system function and event

detection functions are compiled to nativecode using the Low-Level Virtual Machine(LLVM) JIT compiler.

• System function and event detector passed tostate-of-the art numerical solvers fromSUNDIALS suite (from LLNL).

ITU FRP 2010: Lecture 7 – p.46/56

Page 64: ITU FRP 2010 - University of Nottingham

Prototype Hydra Implementation (2)

• At events:- Continuous integration stops.- Event-related information propagated back

to the functional layer.- A new signal relation is computed.- The new relation is compiled into a new

system function and a new event detectionfunction.

- Continuous integration resumes.

ITU FRP 2010: Lecture 7 – p.47/56

Page 65: ITU FRP 2010 - University of Nottingham

Prototype Hydra Implementation (3)

f (~y, d~ydt

, t) = 0

SR a

fllvm(~y, d~ydt

, t) = 0

Simulation Result

Embedded Compiler

LLVM JIT

Numerical SolverEvent Detector

Event Handler

Event

ITU FRP 2010: Lecture 7 – p.48/56

Page 66: ITU FRP 2010 - University of Nottingham

Prototype Hydra Implementation (4)

Status:• Can simulate breaking pendulum, ideal

diodes, and other models that undergo drasticstructural changes.

• Have not yet looked in earnest at issues likestate transfer across structural changes.Currently done explicitly.

ITU FRP 2010: Lecture 7 – p.49/56

Page 67: ITU FRP 2010 - University of Nottingham

Example: Ideal Diodes (1)

ITU FRP 2010: Lecture 7 – p.50/56

Page 68: ITU FRP 2010 - University of Nottingham

Example: Ideal Diodes (2)

ITU FRP 2010: Lecture 7 – p.51/56

Page 69: ITU FRP 2010 - University of Nottingham

Example: Ideal Diodes (3)

icDiode :: SR (Pin, Pin)icDiode = sigrel (p, n) where

twoPin ⋄ (p, n, u)initially; when p.v − n.v > 0 ⇒

u = 0when p.i < 0 ⇒

p.i = 0

ITU FRP 2010: Lecture 7 – p.52/56

Page 70: ITU FRP 2010 - University of Nottingham

Example: Ideal Diodes (4)

ITU FRP 2010: Lecture 7 – p.53/56

Page 71: ITU FRP 2010 - University of Nottingham

Example: Ideal Diodes (5)

ITU FRP 2010: Lecture 7 – p.54/56

Page 72: ITU FRP 2010 - University of Nottingham

Example: Ideal Diodes (6)

To simulate the full-wave rectifier:

• The diode model has to be extended to allowthe assumption that the voltage over thediodes are always pairwise equal to beexpressed.

• Redundant, semantically identical equationsneeds to be eliminated (“constantpropagation” suffice in this case).

ITU FRP 2010: Lecture 7 – p.55/56

Page 73: ITU FRP 2010 - University of Nottingham

Final Thoughts• The area of modelling and simulation offers

many opportunities for DSLs.• Programming language research has a lot to

offer.• However, not always an “easy sell”:

- Deep understanding of the domain needed.- Keeping things sufficiently simple can be a

challenge.- Ideally, an inside accomplice who

understands the benefits of principled,modern, language design is needed.

ITU FRP 2010: Lecture 7 – p.56/56