f# in the real world (ndc)

222
F# in the Real World

Upload: yan-cui

Post on 18-Jan-2017

163.488 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: F# in the real world (NDC)

F#in�theReal�World

Page 2: F# in the real world (NDC)
Page 3: F# in the real world (NDC)

agenda

Page 4: F# in the real world (NDC)

Domain ModellingInfrastructureGame LogicAlgorithms

DSLs

Page 5: F# in the real world (NDC)

1MILLION USERS

ACTIVEDAILY

Page 6: F# in the real world (NDC)

250MILLION DAY

PERREQUEST

Page 7: F# in the real world (NDC)

2MONTH

TBP E R

secops25,000

Page 8: F# in the real world (NDC)

C#

Page 9: F# in the real world (NDC)

why F#?

Page 10: F# in the real world (NDC)

time to market

Page 11: F# in the real world (NDC)

correctness

Page 12: F# in the real world (NDC)

efficient

Page 13: F# in the real world (NDC)

tame complexity

Page 14: F# in the real world (NDC)
Page 15: F# in the real world (NDC)

Collectables

Wager Size

Special SymbolAvg Wager Size

Web Server call

Page 16: F# in the real world (NDC)

• Line Win– X number of matching symbols on adjacent columns– Positions have to be a ‘line’– Wild symbols substitute for other symbols

• Scatter Win– X number of matching symbols anywhere– Triggers bonus game

Page 17: F# in the real world (NDC)

What symbols should land?Any special symbol wins?

Did the player win anything?

Page 18: F# in the real world (NDC)

What the player’s new average wager?

Page 19: F# in the real world (NDC)

Should the player receive collectables?

Page 20: F# in the real world (NDC)

type Symbol = Standard of string | Wild

Page 21: F# in the real world (NDC)

type Symbol = Standard of string | Wild

e.g. Standard “hat”Standard “shoe”Standard “bonus”…

Page 22: F# in the real world (NDC)

type Symbol = Standard of string | Wild

i.e. Wild

Page 23: F# in the real world (NDC)

type Win = LineWin of int * Symbol * int | ScatterWin of Symbol * int

Page 24: F# in the real world (NDC)

type Win = LineWin of int * Symbol * int | ScatterWin of Symbol * int

e.g. LineWin (5, Standard “shoe”, 4)

Page 25: F# in the real world (NDC)

type Win = LineWin of int * Symbol * int | ScatterWin of Symbol * int

e.g. ScatterWin (Standard “bonus”, 3)

Page 26: F# in the real world (NDC)

type LineNum = inttype Count = int

type Win = LineWin of LineNum * Symbol * Count | ScatterWin of Symbol * Count

Page 27: F# in the real world (NDC)

closed hierarchy

Page 28: F# in the real world (NDC)

no Nulls

Page 29: F# in the real world (NDC)

“Make illegal states unrepresentable”

- Yaron Minsky

Page 30: F# in the real world (NDC)

[<Measure>]type Pence

e.g. 42<Pence>153<Pence>…

Page 31: F# in the real world (NDC)

10<Meter> / 2<Second> = 5<Meter/Second>10<Meter> * 2<Second> = 20<Meter Second> 10<Meter> + 10<Meter> = 20<Meter>10<Meter> * 10 = 100<Meter>10<Meter> * 10<Meter> = 100<Meter2>10<Meter> + 2<Second> // error10<Meter> + 2 // error

Page 32: F# in the real world (NDC)

10<Meter> / 2<Second> = 5<Meter/Second>10<Meter> * 2<Second> = 20<Meter Second> 10<Meter> + 10<Meter> = 20<Meter>10<Meter> * 10 = 100<Meter>10<Meter> * 10<Meter> = 100<Meter2>10<Meter> + 2<Second> // error10<Meter> + 2 // error

Page 33: F# in the real world (NDC)

type Wager = int64<Pence>type Multiplier = int

type Payout = Coins of Wager | MultipliedCoins of Multiplier * Wager | Multi of Payout list | BonusGame

Page 34: F# in the real world (NDC)

type Wager = int64<Pence>type Multiplier = int

type Payout = Coins of Wager | MultipliedCoins of Multiplier * Wager | Multi of Payout list | BonusGame

Page 35: F# in the real world (NDC)

type Wager = int64<Pence>type Multiplier = int

type Payout = Coins of Wager | MultipliedCoins of Multiplier * Wager | Multi of Payout list | BonusGame

Page 36: F# in the real world (NDC)

type State = {

AvgWager : WagerSpecialSymbol : SymbolCollectables : Map<Collectable, Count>

}

Page 37: F# in the real world (NDC)

immutable by default

Page 38: F# in the real world (NDC)
Page 39: F# in the real world (NDC)

Recap

Page 40: F# in the real world (NDC)

lightweight syntax for types & hierarchies

Page 41: F# in the real world (NDC)

great for domain modelling

Page 42: F# in the real world (NDC)

make invalid states unrepresentable

Page 43: F# in the real world (NDC)

better correctness

Page 44: F# in the real world (NDC)

order of magnitude increase in productivity

Page 45: F# in the real world (NDC)
Page 46: F# in the real world (NDC)
Page 47: F# in the real world (NDC)

player states are big

Page 48: F# in the real world (NDC)

Stateless Server DatabaseClient

Page 49: F# in the real world (NDC)

1:1 read-write ratio

Page 50: F# in the real world (NDC)
Page 51: F# in the real world (NDC)

ServerClient

Session 1

Session 2

Page 52: F# in the real world (NDC)

ServerClient Database

Page 53: F# in the real world (NDC)

Elastic Load Balancer

S3

Auto scaling Group

Server A Server B

...

EC2

CloudFront

Stateful Server

Page 54: F# in the real world (NDC)

Stateful Server

Game Logic

Stateless Middle-tier

Infrastructure

logging circuit breaker

perf tracking retry …

Page 55: F# in the real world (NDC)

Stateful Server

Game Logic

Stateless Middle-tier

Infrastructure

logging circuit breaker

perf tracking retry …

Page 56: F# in the real world (NDC)

Stateful Server

Game Logic

Stateful Middle-tier

Infrastructure

logging circuit breaker

perf tracking retry …

Page 57: F# in the real world (NDC)

The Actor Model

An actor is the fundamental unit of computation which embodies the 3 things

• Processing• Storage• Communication

that are essential to computation.

-Carl Hewitt** http://bit.ly/HoNHbG

Page 58: F# in the real world (NDC)

The Actor Model

• Everything is an actor• An actor has a mailbox• When an actor receives a message it can:– Create new actors– Send messages to actors– Designate how to handle the next message

Page 59: F# in the real world (NDC)

Stateful Server

• Gatekeeper– Manages the local list of active workers– Spawns new workers

• Worker– Manages the states for a player– Optimistic locking– Persist state after period of inactivity

Page 60: F# in the real world (NDC)

Stateful Server

Game Server

Player A

Player B

S3Worker C

Worker B

GatekeeperR

eque

st H

andl

ers

Asynchronous

Page 61: F# in the real world (NDC)

Stateful Server

Game Server

Worker C

Worker B

Gatekeeper

Worker Aok

Req

uest

Han

dler

sPlayer A

Player B

Asynchronous

S3

Page 62: F# in the real world (NDC)

Stateful Server

Game Server

S3Worker C

Worker B

Gatekeeper

Worker AR

eque

st H

andl

ers

Player A

Player B

Asynchronous

Page 63: F# in the real world (NDC)

Stateful Server

Game Server

S3Worker C

Gatekeeper

Worker AR

eque

st H

andl

ers

Player A

Player B

Asynchronous

Page 64: F# in the real world (NDC)

Stateful Server

Game Server

Worker C

Worker A

Gatekeeper

error

Req

uest

Han

dler

sPlayer A

Player B

S3

Asynchronous

Page 65: F# in the real world (NDC)

type Agent<‘T> = MailboxProcessor<‘T>

Page 66: F# in the real world (NDC)

type Agent<‘T> = MailboxProcessor<‘T>

type Message = | Get of AsyncReplyChannel<…> | Put of State * Version * AsyncReplyChannel<…>

Page 67: F# in the real world (NDC)

type Agent<‘T> = MailboxProcessor<‘T>

type Message = | Get of AsyncReplyChannel<…> | Put of State * Version * AsyncReplyChannel<…>

Page 68: F# in the real world (NDC)

type Result<‘T> = | Success of ’T | Failure of Exception

Page 69: F# in the real world (NDC)

type Result<‘T> = | Success of ’T | Failure of Exception

type GetResult = Result<State * Version>type PutResult = Result<unit>

Page 70: F# in the real world (NDC)

type Agent<‘T> = MailboxProcessor<‘T>

type Message = | Get of AsyncReplyChannel<GetResult> | Put of State * Version * AsyncReplyChannel<PutResult>

Page 71: F# in the real world (NDC)

type Agent<‘T> = MailboxProcessor<‘T>

type Message = | Get of AsyncReplyChannel<GetResult> | Put of State * Version * AsyncReplyChannel<PutResult>

Page 72: F# in the real world (NDC)

type Worker (playerId) = let agent = Agent<Message>.Start(fun inbox -> let state = getCurrentState playerId

let rec workingState (state, version) = async { … } and closedState () = async { … }

workingState (state, 1))

Page 73: F# in the real world (NDC)

type Worker (playerId) = let agent = Agent<Message>.Start(fun inbox -> let state = getCurrentState playerId

let rec workingState (state, version) = async { … } and closedState () = async { … }

workingState (state, 1))

Page 74: F# in the real world (NDC)

type Worker (playerId) = let agent = Agent<Message>.Start(fun inbox -> let state = getCurrentState playerId

let rec workingState (state, version) = async { … } and closedState () = async { … }

workingState (state, 1))

Page 75: F# in the real world (NDC)

type Worker (playerId) = let agent = Agent<Message>.Start(fun inbox -> let state = getCurrentState playerId

let rec workingState (state, version) = async { … } and closedState () = async { … }

workingState (state, 1))

Page 76: F# in the real world (NDC)

type Worker (playerId) = let agent = Agent<Message>.Start(fun inbox -> let state = getCurrentState playerId

let rec workingState (state, version) = async { … } and closedState () = async { … }

workingState (state, 1))

Page 77: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with | None -> do! persist state return! closedState() … }

Page 78: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with | None -> do! persist state return! closedState() … }

Page 79: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with | None -> do! persist state return! closedState() … }

Page 80: F# in the real world (NDC)

non-blocking I/O

Page 81: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with | None -> do! persist state return! closedState() … }

Page 82: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with | None -> do! persist state return! closedState() … }

Page 83: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with … | Some(Get(reply)) -> reply.Reply <| Success(state, version) return! workingState(state, version) … }

Page 84: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with … | Some(Get(reply)) -> reply.Reply <| Success(state, version) return! workingState(state, version) … }

type Message =

| Get of AsyncReplyChannel<GetResult>

| Put of State * Version * AsyncReplyChannel<PutResult>

Page 85: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with … | Some(Get(reply)) -> reply.Reply <| Success(state, version) return! workingState(state, version) … }

type GetResult = Result<State * Version>

type PutResult = Result<unit>

Page 86: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with … | Some(Get(reply)) -> reply.Reply <| Success(state, version) return! workingState(state, version) … }

Page 87: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with … | Some(Put(newState, v, reply)) when version = v -> reply.Reply <| Success() return! workingState(newState, version+1) … }

Page 88: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with … | Some(Put(newState, v, reply)) when version = v -> reply.Reply <| Success() return! workingState(newState, version+1) … }

type Message =

| Get of AsyncReplyChannel<GetResult>

| Put of State * Version * AsyncReplyChannel<PutResult>

Page 89: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with … | Some(Put(newState, v, reply)) when version = v -> reply.Reply <| Success() return! workingState(newState, version+1) … }

Page 90: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with … | Some(Put(newState, v, reply)) when version = v -> reply.Reply <| Success() return! workingState(newState, version+1) … }

Page 91: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with … | Some(Put(_, v, reply)) -> reply.Reply <| Failure(VersionMismatch(version, v)) return! workingState(state, version) }

Page 92: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with … | Some(Put(_, v, reply)) -> reply.Reply <| Failure(VersionMismatch(version, v)) return! workingState(state, version) } type Result<‘T> =

| Success of ’T

| Failure of Exception

Page 93: F# in the real world (NDC)

let rec workingState (state, version) = async { let! msg = inbox.TryReceive(60000) match msg with | None -> … | Some(Get(reply)) -> … | Some(Put(newState, v, reply)) when version = v -> … | Some(Put(_, v, reply)) -> … }

Page 94: F# in the real world (NDC)

and closedState () = async { let! msg = inbox.Receive() match msg with | Get(reply) -> reply.Reply <| Failure(WorkerStopped) return! closedState() | Put(_, _, reply) -> reply.Reply <| Failure(WorkerStopped) return! closedState() }

Page 95: F# in the real world (NDC)

and closedState () = async { let! msg = inbox.Receive() match msg with | Get(reply) -> reply.Reply <| Failure(WorkerStopped) return! closedState() | Put(_, _, reply) -> reply.Reply <| Failure(WorkerStopped) return! closedState() }

Page 96: F# in the real world (NDC)

5x efficient improvement

Page 97: F# in the real world (NDC)

60% latency drop

Page 98: F# in the real world (NDC)

no databases

Page 99: F# in the real world (NDC)

90% cost saving

Page 100: F# in the real world (NDC)
Page 101: F# in the real world (NDC)

akka.Net

Orleans

Page 102: F# in the real world (NDC)
Page 103: F# in the real world (NDC)
Page 104: F# in the real world (NDC)

Caught a Gnome

Page 105: F# in the real world (NDC)

EXP Item Gold

Quest Progress

Caught a Gnome

Page 106: F# in the real world (NDC)

Level Up

Quest Progress

EXP Item Gold

Caught a Gnome

Quest Complete

Page 107: F# in the real world (NDC)

Level Up

Quest Progress

EXP Item Gold

Caught a Gnome

New Quest

Quest Complete

Page 108: F# in the real world (NDC)

Quest Progress

EXP Item Gold

Caught a Gnome

Quest Complete

New Quest

Level Up

Page 109: F# in the real world (NDC)

Quest Progress

New QuestAchievement

Progress

EXP Item Gold

Quest CompleteLevel Up

Caught a Gnome

Page 110: F# in the real world (NDC)

Level Up

Quest Progress

EXP Item Gold

Caught a Gnome

Quest Complete

New QuestAchievement

Progress

Achievement Complete

Page 111: F# in the real world (NDC)

Level Up

Quest Progress

EXP Item Gold

Caught a Gnome

Quest Complete

New QuestAchievement

Progress

Achievement Complete

Page 112: F# in the real world (NDC)

100+ actions

Page 113: F# in the real world (NDC)
Page 114: F# in the real world (NDC)

triggered by different abstraction layers

Page 115: F# in the real world (NDC)

non-functional requirements

Page 116: F# in the real world (NDC)
Page 117: F# in the real world (NDC)

message-broker pattern

Page 118: F# in the real world (NDC)

Caught Gnome Trapping

Queue

Levelling

Quests

Achievements

Analytics

Partner Reporting

Page 119: F# in the real world (NDC)

Caught Gnome Trapping

Queue

Levelling

Quests

Achievements

Analytics

Partner Reporting

Ignore

Process

Process

Process

Process

Ignore

Page 120: F# in the real world (NDC)

Caught Gnome Trapping

Queue

Levelling

Quests

Achievements

Analytics

Partner Reporting

EXPItemGold

Page 121: F# in the real world (NDC)

Caught Gnome Trapping

Queue

Levelling

Quests

Achievements

Analytics

Partner Reporting

EXPItemGold

Page 122: F# in the real world (NDC)

Caught Gnome Trapping

Queue

Levelling

Quests

Achievements

Analytics

Partner Reporting

EXPItemGold

Process

Ignore

Ignore

Ignore

Process

Ignore

Page 123: F# in the real world (NDC)

Caught Gnome Trapping

Queue

Levelling

Quests

Achievements

Analytics

Partner Reporting

EXPItemGold

Level Up

Page 124: F# in the real world (NDC)

Caught Gnome Trapping

Queue

Levelling

Quests

Achievements

Analytics

Partner Reporting

EXPItemGold

Level Up

Page 125: F# in the real world (NDC)

need lots of facts

Page 126: F# in the real world (NDC)

type Fact = | GotExp of Exp | GotGold of Gold | GotItem of Item * Count | CaughtMonster of Monster * Bait * Location | LevelUp of OldLevel * NewLevel …

Page 127: F# in the real world (NDC)

type Reward = | GotExp of Exp | GotGold of Gold | GotItem of Item * Count

type StateChange = | LevelUp of OldLevel * NewLevel …

Page 128: F# in the real world (NDC)

type Fact = | StateChange of StateChange | Reward of Reward | Trapping of Trapping | Fishing of Fishing …

Page 129: F# in the real world (NDC)

let process fact = match fact with | StateChange(stateChange) -> … | Reward(reward) -> … | Trapping(trapping) -> … …

Page 130: F# in the real world (NDC)

C# interop

Page 131: F# in the real world (NDC)

…var fact = Fact.NewStateChange(

StateChange.NewLevelUp(oldLvl, newLvl));…

Page 132: F# in the real world (NDC)

type IFact = interface end

type Reward = | GotExp of Exp | GotGold of Gold | GotItem of Item * Count interface IFact

Page 133: F# in the real world (NDC)

type IFact = interface end

type Reward = | GotExp of Exp | GotGold of Gold | GotItem of Item * Count interface IFact

Page 134: F# in the real world (NDC)

let process (fact : IFact) = match fact with | :? StateChange as stateChange -> … | :? Reward as reward -> … | :? Trapping as trapping -> … … | _ -> raise <| NotSupportedFact fact

Page 135: F# in the real world (NDC)

let process (fact : IFact) = match fact with | :? StateChange as stateChange -> … | :? Reward as reward -> … | :? Trapping as trapping -> … … | _ -> raise <| NotSupportedFact fact

Page 136: F# in the real world (NDC)

let process (fact : IFact) = match fact with | :? StateChange as stateChange -> … | :? Reward as reward -> … | :? Trapping as trapping -> … … | _ -> raise <| NotSupportedFact fact

Page 137: F# in the real world (NDC)

simple

Page 138: F# in the real world (NDC)

flexible

Page 139: F# in the real world (NDC)

saver

Page 140: F# in the real world (NDC)
Page 141: F# in the real world (NDC)

location baitattraction rate

catch rate

Page 142: F# in the real world (NDC)

auto-tuning trapping stats

Page 143: F# in the real world (NDC)

Monsterstrength speed

intelligence

Trapstrength speed

technology

Page 144: F# in the real world (NDC)

Monsterstrength speed

intelligence

Trapstrength speed

technology

Catch Rate %

Page 145: F# in the real world (NDC)

trial-and-error

Page 146: F# in the real world (NDC)
Page 147: F# in the real world (NDC)

“…if you require constant diligence you’re setting everyone up for failure and hurt”

Page 148: F# in the real world (NDC)
Page 149: F# in the real world (NDC)

genetic algorithms

Page 150: F# in the real world (NDC)
Page 151: F# in the real world (NDC)
Page 152: F# in the real world (NDC)
Page 153: F# in the real world (NDC)
Page 154: F# in the real world (NDC)
Page 155: F# in the real world (NDC)
Page 156: F# in the real world (NDC)
Page 157: F# in the real world (NDC)
Page 158: F# in the real world (NDC)
Page 159: F# in the real world (NDC)
Page 160: F# in the real world (NDC)
Page 161: F# in the real world (NDC)

F#-powered DSLs.Awesome!

Page 162: F# in the real world (NDC)
Page 163: F# in the real world (NDC)
Page 164: F# in the real world (NDC)

wanna find correlations?

Page 165: F# in the real world (NDC)

wanna find correlations?

you can DIY it!

;-)

Page 166: F# in the real world (NDC)

why was payment service slow last night?

Page 167: F# in the real world (NDC)
Page 168: F# in the real world (NDC)
Page 169: F# in the real world (NDC)

Pain Driven Development

Page 170: F# in the real world (NDC)

Amazon.CloudWatch.Selector

github.com/fsprojects/Amazon.CloudWatch.Selector

Page 171: F# in the real world (NDC)

Find metrics whose 5 min average exceeded

1 second during last 12 hours

Page 172: F# in the real world (NDC)

cloudWatch.Select( unitIs “milliseconds” + average (>) 1000.0 @ last 12 hours |> intervalOf 5 minutes)

Page 173: F# in the real world (NDC)

cloudWatch.Select(“ unitIs ‘milliseconds’ and average > 1000.0 duringLast 12 hours at intervalOf 5 minutes”)

Page 174: F# in the real world (NDC)

did any cache nodes’ CPU spike

yesterday?

Page 175: F# in the real world (NDC)

cloudWatch.Select( namespaceLike “elasticache” + nameLike “cpu” + max (>) 80.0 @ last 24 hours |> intervalOf 15 minutes)

Page 176: F# in the real world (NDC)

cloudWatch.Select( namespaceLike “elasticache” + nameLike “cpu” + max (>) 80.0 @ last 24 hours |> intervalOf 15 minutes)

regex support

Page 177: F# in the real world (NDC)
Page 178: F# in the real world (NDC)
Page 179: F# in the real world (NDC)
Page 180: F# in the real world (NDC)
Page 181: F# in the real world (NDC)
Page 182: F# in the real world (NDC)

Amazing

F# =

Page 183: F# in the real world (NDC)

usable from anywhere you can run F# code

e.g. F# REPL, executable, ..

Internal DSL

Page 184: F# in the real world (NDC)

useful for building tools e.g. CLI, …

External DSL

Page 185: F# in the real world (NDC)
Page 186: F# in the real world (NDC)

Recap

Page 187: F# in the real world (NDC)
Page 188: F# in the real world (NDC)
Page 189: F# in the real world (NDC)
Page 190: F# in the real world (NDC)

managedkey-value store

Page 191: F# in the real world (NDC)

redundancy9-9s guarantee

Page 192: F# in the real world (NDC)

great performance

Page 193: F# in the real world (NDC)

name your throughput

Page 194: F# in the real world (NDC)
Page 195: F# in the real world (NDC)
Page 196: F# in the real world (NDC)
Page 197: F# in the real world (NDC)

select GameTitle, UserId, TopScore from GameScores where GameTitle = “Starship X” and TopScore >= 1000 order desc limit 3 with (NoConsistentRead, Index(GameTitleIndex, true))

Page 198: F# in the real world (NDC)

DynamoDB.SQL

github.com/fsprojects/DynamoDb.SQL

Page 199: F# in the real world (NDC)

GOAL

Disguise complexity

Page 200: F# in the real world (NDC)

GOAL

SELECT UserId, TopScore FROM GameScore WHERE GameTitle CONTAINS “Zelda” ORDER DESCLIMIT 3 WITH (NoConsistentRead)

Page 201: F# in the real world (NDC)

Query

AST

Execution

Page 202: F# in the real world (NDC)

F# & FParsec*

*www.quanttec.com/fparsec

External DSL via

Page 203: F# in the real world (NDC)
Page 204: F# in the real world (NDC)

SELECT * FROM GameScore

Abstract Syntax Tree (AST)

FParsec

Page 205: F# in the real world (NDC)
Page 206: F# in the real world (NDC)

select GameTitle, UserId, TopScore from GameScores where GameTitle = “Starship X” and TopScore >= 1000 order desc limit 3 with (NoConsistentRead, Index(GameTitleIndex, true))

Page 207: F# in the real world (NDC)
Page 208: F# in the real world (NDC)

< 50 LOC

Page 209: F# in the real world (NDC)

S3 Provider

github.com/fsprojects/S3Provider

F# type provider for Amazon S3

Page 210: F# in the real world (NDC)
Page 211: F# in the real world (NDC)
Page 212: F# in the real world (NDC)

intellisense over S3

Page 213: F# in the real world (NDC)

compile time validation

Page 214: F# in the real world (NDC)

no code generation

Page 215: F# in the real world (NDC)

Domain ModellingInfrastructureGame LogicAlgorithms

DSLs

Page 216: F# in the real world (NDC)

why F#?

Page 217: F# in the real world (NDC)

time to market

Page 218: F# in the real world (NDC)

correctness

Page 219: F# in the real world (NDC)

efficient

Page 220: F# in the real world (NDC)

tame complexity

Page 221: F# in the real world (NDC)

also on the Functional Track this year :-)

Today

REPL Driven Dev

FP Lab Hour

Tomorrow

Parser Combinators

FP Lab Hour

Page 222: F# in the real world (NDC)

@theburningmonktheburningmonk.comgithub.com/theburningmonk