A computational science agenda for programming language research - - - PowerPoint PPT Presentation

a computational science agenda for programming
SMART_READER_LITE
LIVE PREVIEW

A computational science agenda for programming language research - - - PowerPoint PPT Presentation

A computational science agenda for programming language research - slides Dominic Orchard and Andrew Rice http://dorchard.co.uk/science International Conference on Computational Science, 2014 Better Software Better Research Software


slide-1
SLIDE 1

A computational science agenda for programming language research - slides

Dominic Orchard and Andrew Rice

International Conference on Computational Science, 2014

http://dorchard.co.uk/science

slide-2
SLIDE 2

Better Software Better Research

Software Sustainability Institute (www.software.ac.uk)

slide-3
SLIDE 3

Better Software Better Research Better Languages

slide-4
SLIDE 4

The two complexities

Inherent complexity Accidental complexity

Inadequately supported Too easy to introduce

4

slide-5
SLIDE 5

Current programming approaches

Abstract model Solution strategy Prediction calculation Abstract model Solution strategy Prediction calculation

5

slide-6
SLIDE 6

Case study - heat equation

Abstract model

∂φ ∂t = α∂2φ ∂x2

φt

x = φt−1 x

+ α∆t ∆x2 (φt−1

x+1 − 2φt−1 x

+ φt−1

x−1)

Solution strategy

6

slide-7
SLIDE 7

Prediction calculation

Case study - heat equation

real :: h(1:nx), h_old(1:nx) ! heat function (discretised in space) h = 0 ! initialise as cold h(1) = 1 ! with one hot end do t = 1, nt h_old = h

r*(h_old(x-1) - 2*h_old(x) + h_old(x+1))

forall (x = 2:(nx - 1)) end do

h(x) = h_old(x) +

end do

9 10 11 12 13 14 15 16 17

7

slide-8
SLIDE 8

Hypothesis/model Prediction Experiment Reproduction Analysis

Computer programs Computer programs

8

slide-9
SLIDE 9
  • Invalid predictions: who’s to blame?

Accidental complexity in prediction

Invalid/incomplete model? Buggy implementation? Both?

  • Verification (program correctness) confused

with validation (correct model)

9

slide-10
SLIDE 10

Reproduction

complicated relationship

Prediction Experiment Analysis

Computer programs Computer programs

10

Hypothesis/model

slide-11
SLIDE 11

Accidental complexity in reproduction

  • Replication/repetition is good!

!! Some progress: publishing code, Open Science!

  • but not the final solution…!
  • shares bugs and over approximations!
  • abstract model hidden/lost!
  • code hard to understand

11

slide-12
SLIDE 12

Abstract model maths code Prediction strategy Prediction calculation papers programs ???

12

slide-13
SLIDE 13

Problems…

  • Reproduction!
  • Understandability!
  • Verification!
  • Utilise new hardware; scalability

13

slide-14
SLIDE 14

Roadmap

  • 1. Computer science engagement with scientists!
  • Understand needs!
  • Study applications/programming patterns!

!

15

slide-15
SLIDE 15

Results from programming language research

  • Advanced type systems for !
  • specification/verification!
  • abstraction!
  • Architecture-independent programs!
  • Automated test generation suites!
  • Better control of side effects

16

slide-16
SLIDE 16

Roadmap

  • 1. Computer science engagement with scientists!
  • 2. New systems for abstraction and specification!

17

slide-17
SLIDE 17

Future programming approaches

Abstract model Solution strategy Prediction calculation

Verification Validation Automated

18

slide-18
SLIDE 18
  • - Specification of heat equation PDE

spec h = (d h T) === (constant ?alpha * d2 h X) ‘withDomain‘ (X :. T :. Nil)

experiment = let ?dx = 0.05 ?dt = 0.05 ?nx = 100 ?nt = 100 ?alpha = 0.006 in verifyModel Euler spec approxFast

  • - Implementation using a recurrence relation

approx h’ (x, t) | x == 0 = 1 | x == ?nx = 0 | t == 0 = 0 | t == 0 = 0 | otherwise = h’ (x, t-1) + r * (

+ r * (h’ (x+1, t-1) - 2 * h’ (x, t-1) + h’ (x-1, t-1))

e = h’ (x, t-1) + r * (h’ (x+1, t-1) - 2 * h’ ( where r = ?alpha * (?dt / (?dx * ?dx))

Case study - heat equation

19

slide-19
SLIDE 19

Roadmap

  • 1. Computer science engagement with scientists!
  • 2. New systems for abstraction and specification!
  • 3. Evolutionary approach

20

slide-20
SLIDE 20

Evolutionary approach

Leverage advanced features Libraries/DSLs

Past Present

Refactoring tools Language extensions Test generation tools New languages

Future

{

CamFort

{

PDESpec

21

slide-21
SLIDE 21

Roadmap

  • 1. Computer science engagement with scientists!
  • 2. New systems for abstraction and specification!
  • 3. Evolutionary approach

22

slide-22
SLIDE 22

Better Software Better Research Better Languages

http://dorchard.co.uk/science Thanks!