FUNCTIONAL ARCHITECTURE Phillip Trelford Trayport About Me Family - - PowerPoint PPT Presentation

functional architecture
SMART_READER_LITE
LIVE PREVIEW

FUNCTIONAL ARCHITECTURE Phillip Trelford Trayport About Me Family - - PowerPoint PPT Presentation

FUNCTIONAL ARCHITECTURE Phillip Trelford Trayport About Me Family Values Retail Halo 3 Trade Programming Languages Assemblers C with Classes Functional 6502 C++ JavaScript Z80 Java F# 680x0 C# Lua


slide-1
SLIDE 1

FUNCTIONAL ARCHITECTURE

Phillip Trelford Trayport

slide-2
SLIDE 2

About Me

Family Values Retail Halo 3 Trade

slide-3
SLIDE 3

Programming Languages

Assemblers

  • 6502
  • Z80
  • 680x0
  • 80x86
  • 65c816
  • SH-2
  • R3000
  • C

C with Classes

  • C++
  • Java
  • C#

Functional

  • JavaScript
  • F#
  • Lua
slide-4
SLIDE 4

Video Game Decades

1980s/1990s

Assemblers Scripts

2000s/2010s

C with Classes Scripts

slide-5
SLIDE 5

Coroutine Zombies

Pseudo Code random_pause 10 while not dead wait_until_in_range 50.0 home_in_on_target 10

slide-6
SLIDE 6

Coroutine Zombies

Pseudo Code random_pause 10 while not dead wait_until_in_range 50.0 home_in_on_target 10 F# yield! random_pause 10 while true do yield! wait_range 50 yield! home_in 10

slide-7
SLIDE 7

Speed

Runtime Super Nintendo

  • Interprets byte code
  • On 3.58MHz CPU
  • At 60FPS

Development DSL

  • Close to domain
  • Easy to port
  • Zero compile time
slide-8
SLIDE 8

FP Sweet Spots

Domain Concurrency Computation

slide-9
SLIDE 9

Thoughtworks Tech Radar 2012

F# “F# is excellent at concisely expressing business and domain logic.” Languages

slide-10
SLIDE 10

Types

F#

type Object(name) = member this.Name = name type Action = | Call of Object * string *Object | Async of Object * string *Object

UML Class Diagram

slide-11
SLIDE 11

Functions

Imply : Instrument[] -> Order[] -> Order[]

slide-12
SLIDE 12

Computation

slide-13
SLIDE 13

Concurrency

async { do! control.MouseLeftButtonDown |> Async.AwaitEvent }

slide-14
SLIDE 14

Joule Trading screen

slide-15
SLIDE 15

Thoughtworks Tech Radar 2012

“Developers trying to achieve explicit business logic within an application may opt to express their domain in F# with the majority of plumbing code in C#.”

slide-16
SLIDE 16

Applications

Erlang for Fault Tolerant Messaging

  • Messaging in Chat, Gaming, Messaging, NoSQL
  • Facebook, MMOG, RabbitMQ, Amazon, …

F#/Scala

  • Computation in Insurance, Finance, Gaming
  • Credit Suisse, Jane Street, TrueSkill, Path of Go, …

C#/Java/PHP/Python/Ruby…

  • CRUD in Line of Business Applications
  • Everything else
slide-17
SLIDE 17

Classes

reference.Member(argument, …) Member5(reference, argument, …)

slide-18
SLIDE 18

Dot Driven Development

slide-19
SLIDE 19

Buttons

Methods 63 Properties 63 Events 35 Constructors 1 Total Members 162

slide-20
SLIDE 20

XBLA: Path to Go – F# AI

slide-21
SLIDE 21

Q & A

  • Twitter: @ptrelford
  • Email: phil at trelford.com
  • Blog: http://trelford.com/blog