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 : Languages for Making Movies A DSL for Scripting Videos Super , 8 Languages for Making Movies DSL Towers to Solve Multitudes of Problems
Super 8 : Languages for Making Movies A DSL for Scripting Videos Super , 8 Languages for Making Movies DSL Towers to Solve Multitudes of Problems
One down
One down 19 more to go…
We Need Automation
We Need Automation Abstraction
e Landscape Tool Example Experience Plugin-Ins Blender Script, AE Script UI Automation Apple Script (Macros) Shell Scripts FFmpeg, AVISynth
e Landscape Tool Example Experience Plugin-Ins Blender Script, AE Script UI Automation Apple Script (Macros) Shell Scripts FFmpeg, AVISynth
e Landscape Tool Example Experience Plugin-Ins Blender Script, AE Script UI Automation Apple Script (Macros) Shell Scripts FFmpeg, AVISynth
e Landscape Tool Example Experience Plugin-Ins Blender Script, AE Script UI Automation Apple Script (Macros) Shell Scripts FFmpeg, AVISynth
Video Editor
Functional Programming Language * * But bad with abstractions.
Video, the programming language
Primitives
List Comprehensions
Modules
Functions
(RacketCon 2016) < Writing Video Editing Talks + Editing Talks Manually (RacketCon 2015)
Super 8 : Languages for Making Movies A DSL for Scripting Videos Super , 8 Languages for Making Movies DSL Towers to Solve Multitudes of Problems
Super 8 : Languages for Making Movies A DSL for Scripting Videos Super , 8 Languages for Making Movies DSL Towers to Solve Multitudes of Problems
Video, the tower of languages
Video MLT FFmpeg
Video MLT FFmpeg
We have a problem…
We have a problem… We want to solve it in the problem domain's own language…
We have a problem… We want to solve it in the problem domain's own language… DSLs are the "Ultimate Abstraction" Paul Hudak
V We have a problem…
V We have a problem… We want to solve it in the problem domain's own language…
V We have a problem… We want to solve it in the problem domain's own language… Tower of DSLs
Tower of DSLs Language Oriented Programming
We want to make DSLs quickly… Use Racket, a programmable programming language MLT FFmpeg
We make DSLs using Linguistic Inheritance
Movie Script We make DSLs using Linguistic Inheritance Video Implementation Racket
Movie Script We make DSLs using Linguistic Inheritance Re-export construct Video Implementation Racket
Movie Script We make DSLs using Linguistic Inheritance Re-export construct Video Implementation Remove construct Racket
Movie Script We make DSLs using Linguistic Inheritance Re-export construct New construct Video Implementation Remove construct Racket
Movie Script We make DSLs using Linguistic Inheritance Re-export construct New construct Video Implementation Remove construct Change construct Racket
Change construct
Interposition Points #lang video (module anon video ( #%module-begin logo logo parses talk talk (define logo ...) ;; Where (define talk ...))) (define logo ...) (define talk ...)
Interposition Points (module anon video (module anon racket ( #%module-begin ( #%module-begin logo (require vidlib) elaborates talk (define logo (define logo ...) ...) (define talk (define talk ...) ...))) (vid-begin vid logo talk)))
Implementing Interposition Points #lang racket
FFI
An FFI DSL mlt_repository mlt_factory_init(const char *directory); (Scheme Wrksp., 2004)
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)
An Object DSL (define-mlt mlt-factory-init ...) (define-mlt mlt-factory-close ...) (define-constructor clip video ... mlt-factory-init ... mlt-factory-close ...)
MLT FFmpeg
Documentation
A Documentation DSL (ICFP, 2009)
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)
MLT FFmpeg
Types
(clip "clip.mp4" #:start 0 #:end 50)
(cut-producer (clip "clip.mp4" #:start 0 #:end 50) #:start 0 #:end 100)
(cut-producer (clip "clip.mp4" #:start 0 #:end 50) #:start 0 #:end 100)
A Typed DSL
A Typed DSL (POPL, 2016)
A Type Implementation DSL (define-typed-syntax (clip f) ≫ [ ⊢ f ≫ _ ⇐ File] #:where n (length f) ------------------------------------- [ ⊢ (untyped:clip f) ⇒ (Producer n)]) (POPL, 2016)
MLT FFmpeg
DSL V We have a problem…
DSL V We have a problem… We want to solve it in the problem domain's own language…
DSL V We have a problem… We want to solve it in the problem domain's own language… syntax-parse A DSL for making DSLs (ICFP, 2010)
MLT FFmpeg
Editor V We have a problem…
Editor V We have a problem… We want to solve it in the problem domain's own language…
Editor V We have a problem… We want to solve it in the problem domain's own language… ? Linguistic Inheritance ? We make DSLs using
Future Work
MLT FFmpeg
anks For Watching http://lang.video We make DSLs using @videolang Linguistic Inheritance MLT FFmpeg
Recommend
More recommend