Super 8 Languages for Making Movies (A Functional Pearl) Leif - - PowerPoint PPT Presentation

super 8 languages for making movies
SMART_READER_LITE
LIVE PREVIEW

Super 8 Languages for Making Movies (A Functional Pearl) Leif - - PowerPoint PPT Presentation

Super 8 Languages for Making Movies (A Functional Pearl) Leif Andersen Stephen Chang Ma hias Felleisen PLT @ Northeastern University ICFP - Sept 4, 2017 Super 8 : Languages for Making Movies Super , 8 Languages for Making Movies Super 8 :


slide-1
SLIDE 1

Super 8 Languages for Making Movies

(A Functional Pearl) Leif Andersen Stephen Chang Mahias Felleisen

PLT @ Northeastern University ICFP - Sept 4, 2017

slide-2
SLIDE 2

Super 8: Languages for Making Movies Super, 8 Languages for Making Movies

slide-3
SLIDE 3

Super 8: Languages for Making Movies A DSL for Scripting Videos Super, 8 Languages for Making Movies DSL Towers to Solve Multitudes of Problems

slide-4
SLIDE 4

Super 8: Languages for Making Movies A DSL for Scripting Videos Super, 8 Languages for Making Movies DSL Towers to Solve Multitudes of Problems

slide-5
SLIDE 5
slide-6
SLIDE 6
slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10
slide-11
SLIDE 11
slide-12
SLIDE 12

One down

slide-13
SLIDE 13

One down 19 more to go…

slide-14
SLIDE 14
slide-15
SLIDE 15
slide-16
SLIDE 16

We Need Automation

slide-17
SLIDE 17

We Need Automation

Abstraction

slide-18
SLIDE 18

e Landscape

Tool Example Experience

Plugin-Ins

Blender Script, AE Script

UI Automation

(Macros) Apple Script

Shell Scripts

FFmpeg, AVISynth

slide-19
SLIDE 19

e Landscape

Tool Example Experience

Plugin-Ins

Blender Script, AE Script

UI Automation

(Macros) Apple Script

Shell Scripts

FFmpeg, AVISynth

slide-20
SLIDE 20

e Landscape

Tool Example Experience

Plugin-Ins

Blender Script, AE Script

UI Automation

(Macros) Apple Script

Shell Scripts

FFmpeg, AVISynth

slide-21
SLIDE 21

e Landscape

Tool Example Experience

Plugin-Ins

Blender Script, AE Script

UI Automation

(Macros) Apple Script

Shell Scripts

FFmpeg, AVISynth

slide-22
SLIDE 22

Video Editor

slide-23
SLIDE 23

Functional Programming Language*

*But bad with abstractions.

slide-24
SLIDE 24

Video,

the programming language

slide-25
SLIDE 25
slide-26
SLIDE 26

Primitives

slide-27
SLIDE 27

List Comprehensions

slide-28
SLIDE 28

Modules

slide-29
SLIDE 29
slide-30
SLIDE 30

Functions

slide-31
SLIDE 31
slide-32
SLIDE 32
slide-33
SLIDE 33
slide-34
SLIDE 34

Writing Video + Editing Talks

(RacketCon 2016) <

Editing Talks Manually

(RacketCon 2015)

slide-35
SLIDE 35

Super 8: Languages for Making Movies A DSL for Scripting Videos Super, 8 Languages for Making Movies DSL Towers to Solve Multitudes of Problems

slide-36
SLIDE 36

Super 8: Languages for Making Movies A DSL for Scripting Videos Super, 8 Languages for Making Movies DSL Towers to Solve Multitudes of Problems

slide-37
SLIDE 37

Video,

the tower of languages

slide-38
SLIDE 38

FFmpeg MLT Video

slide-39
SLIDE 39

FFmpeg MLT Video

slide-40
SLIDE 40

We have a problem…

slide-41
SLIDE 41

We have a problem… We want to solve it in the problem domain's own language…

slide-42
SLIDE 42

We have a problem… We want to solve it in the problem domain's own language…

DSLs are the

"Ultimate Abstraction"

Paul Hudak

slide-43
SLIDE 43

We have a problem…

V

slide-44
SLIDE 44

We have a problem… We want to solve it in the problem domain's own language…

V

slide-45
SLIDE 45

We have a problem… We want to solve it in the problem domain's own language…

Tower

  • f DSLs

V

slide-46
SLIDE 46

Tower

  • f DSLs

Language Oriented Programming

slide-47
SLIDE 47

We want to make DSLs quickly… Use Racket, a programmable programming language

MLT FFmpeg

slide-48
SLIDE 48

We make DSLs using

Linguistic Inheritance

slide-49
SLIDE 49

We make DSLs using

Linguistic Inheritance

Movie Script

Video Implementation

Racket

slide-50
SLIDE 50

We make DSLs using

Linguistic Inheritance

Movie Script

Video Implementation

Racket

Re-export construct

slide-51
SLIDE 51

We make DSLs using

Linguistic Inheritance

Movie Script

Video Implementation

Racket

Re-export construct Remove construct

slide-52
SLIDE 52

We make DSLs using

Linguistic Inheritance

Movie Script

Video Implementation

Racket

Re-export construct Remove construct New construct

slide-53
SLIDE 53

We make DSLs using

Linguistic Inheritance

Movie Script

Video Implementation

Racket

Re-export construct Remove construct New construct Change construct

slide-54
SLIDE 54

Change construct

slide-55
SLIDE 55

Interposition Points

#lang video logo talk ;; Where (define logo ...) (define talk ...)

(module anon video ( #%module-begin logo talk (define logo ...) (define talk ...)))

parses

slide-56
SLIDE 56

Interposition Points

(module anon video ( #%module-begin logo talk (define logo ...) (define talk ...))) (module anon racket ( #%module-begin (require vidlib) (define logo ...) (define talk ...) (vid-begin vid logo talk)))

elaborates

slide-57
SLIDE 57

Implementing Interposition Points

#lang racket

slide-58
SLIDE 58

FFI

slide-59
SLIDE 59

An FFI DSL

mlt_repository mlt_factory_init(const char *directory);

(Scheme Wrksp., 2004)

slide-60
SLIDE 60

An FFI DSL

mlt_repository mlt_factory_init(const char *directory);

(define-mlt mlt-factory-init (_fun [p : _path]

  • > [ret : _mlt-repository/null]
  • > (maybe-error? ret)))

(Scheme Wrksp., 2004)

slide-61
SLIDE 61

An Object DSL

(define-mlt mlt-factory-init ...) (define-mlt mlt-factory-close ...) (define-constructor clip video ... mlt-factory-init ... mlt-factory-close ...)

slide-62
SLIDE 62

MLT FFmpeg

slide-63
SLIDE 63

Documentation

slide-64
SLIDE 64

A Documentation DSL

(ICFP, 2009)

slide-65
SLIDE 65

A Documentation DSL

#lang video/documentation @title{Video: The Language} @(defmodulelang video) Video Language (or VidLang, sometimes referred to as just Video) is a DSL for editing...videos. It aims to merge the capabilities of a traditional

(ICFP, 2009)

slide-66
SLIDE 66

MLT FFmpeg

slide-67
SLIDE 67

Types

slide-68
SLIDE 68

(clip "clip.mp4" #:start 0 #:end 50)

slide-69
SLIDE 69

(cut-producer #:start 0 #:end 100) (clip "clip.mp4" #:start 0 #:end 50)

slide-70
SLIDE 70

(cut-producer #:start 0 #:end 100) (clip "clip.mp4" #:start 0 #:end 50)

slide-71
SLIDE 71

A Typed DSL

slide-72
SLIDE 72

A Typed DSL

(POPL, 2016)

slide-73
SLIDE 73

A Type Implementation DSL

(define-typed-syntax (clip f) ≫ [⊢ f ≫ _ ⇐ File] #:where n (length f)

  • [⊢ (untyped:clip f) ⇒ (Producer n)])

(POPL, 2016)

slide-74
SLIDE 74

MLT FFmpeg

slide-75
SLIDE 75

We have a problem…

DSL

V

slide-76
SLIDE 76

We have a problem… We want to solve it in the problem domain's own language…

DSL

V

slide-77
SLIDE 77

We have a problem… We want to solve it in the problem domain's own language…

syntax-parse

A DSL for making DSLs

DSL

V

(ICFP, 2010)

slide-78
SLIDE 78

MLT FFmpeg

slide-79
SLIDE 79

We have a problem…

Editor

V

slide-80
SLIDE 80

We have a problem… We want to solve it in the problem domain's own language…

Editor

V

slide-81
SLIDE 81

We have a problem… We want to solve it in the problem domain's own language…

?

We make DSLs using

Linguistic Inheritance ?

Editor

V

slide-82
SLIDE 82
slide-83
SLIDE 83
slide-84
SLIDE 84

Future Work

slide-85
SLIDE 85

MLT FFmpeg

slide-86
SLIDE 86

anks For Watching

http://lang.video @videolang

We make DSLs using

Linguistic Inheritance

MLT FFmpeg