6. Coroutine Zombies
Pseudo Code F#
random_pause 10 yield! random_pause 10
while not dead while true do
wait_until_in_range 50.0 yield! wait_range 50
home_in_on_target 10 yield! home_in 10
7. Speed
Runtime Development
Super Nintendo DSL
• Interprets byte code • Close to domain
• On 3.58MHz CPU • Easy to port
• At 60FPS • Zero compile time
9. Thoughtworks Tech Radar 2012
F# Languages
“F# is excellent at concisely
expressing business and
domain logic.”
10. Types
F# UML Class Diagram
type Object(name) =
member this.Name = name
type Action =
| Call of Object * string *Object
| Async of Object * string *Object
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#.”
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
I work as a hands-on Software Architect AND Developer at Trayport.I work with the project team on the code on a day-to-day basis.
Wrote first commercial game when I was 13, nearly 30 years ago which makes me just over 27 ;)Characterized by functional concepts.Video games: state machines & DSLs, transformation, math, proceduralE-Commerce: immutable messages & commands (audit trail – no deletion)Machine Learning: computationTrading: immutable messages, computation, concurrency
C is assemblerC++ was initially called C with ClassesJava/C# = C with Classes + GC
1980s/1990s Games written in C interpreters & custom DSLs with coroutines, engines written in Assembler including C2000s/2010s Games written in Lua & custom DSLs, engines written in C & C++
Runtime: 80/20 rule – performance of most code is not importantDevelopment: time to market is importantPsygnosis offered to pay: 25,000GBP to convert a video game in 6 months 75,000GBP to convert a video game in 3 months
Lightweight types with correct defaultsImmutabilityCompositionSeparation of concernsLightweight functions with correct defaultsIdempotentTestableType signatures
Map: (‘T -> ‘U) -> ‘T -> ‘U
Samples:Units in CellzLunar Landurz
Putting it all together: http://www.trayport.com/en/joule/video
Intellisense via the dot gives discoverabilityMakes it easy to explore an APIWorld bank sample