SlideShare a Scribd company logo
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
• 80x86
• 65c816
• SH-2
• R3000
•C
Video Game Decades
1980s/1990s                  2000s/2010s




      Scripts                      Scripts

                                             C with
                Assemblers
                                             Classes
Coroutine Zombies
Pseudo Code

random_pause 10
while not dead
  wait_until_in_range 50.0
  home_in_on_target 10
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
Speed
Runtime                     Development

Super Nintendo              DSL
• Interprets byte code      • Close to domain
• On 3.58MHz CPU            • Easy to port
• At 60FPS                  • Zero compile time
FP Sweet Spots


          Domain




Computation        Concurrency
Thoughtworks Tech Radar 2012
F#                              Languages



“F# is excellent at concisely
  expressing business and
  domain logic.”
Types
F#                                    UML Class Diagram

type Object(name) =
 member this.Name = name

type Action =
 | Call of Object * string *Object
 | Async of Object * string *Object
Functions


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

async {
 do! control.MouseLeftButtonDown
     |> Async.AwaitEvent
}
Joule Trading screen
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#.”
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
Classes


reference.Member(argument, …)

Member(reference, argument, …)
Dot Driven Development
Buttons


Methods         63
Properties      63
Events          35
Constructors    1


Total Members   162
XBLA: Path to Go – F# AI
Q&A

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

More Related Content

PPTX
Computers for kids
PDF
Computer language
PDF
Practical Puppet: Systems Building Systems
PPT
iKnow! API - introduction and sample applications
PPTX
Functional Augmented State Transfer (FAST) architecture
PDF
The JSON architecture
PDF
Parquet Strata/Hadoop World, New York 2013
PDF
Programing fundamentals with C++
Computers for kids
Computer language
Practical Puppet: Systems Building Systems
iKnow! API - introduction and sample applications
Functional Augmented State Transfer (FAST) architecture
The JSON architecture
Parquet Strata/Hadoop World, New York 2013
Programing fundamentals with C++

Similar to Functional Architecture - goto copenhagen 2012 (20)

PDF
PPTX
F# for Trading
PDF
Making A Game Engine Is Easier Than You Think
PPTX
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
PPTX
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
PPT
Metaprogramming by brandon
PPTX
Being a game developer with the skills you have
PPTX
"The F# Path to Relaxation", Don Syme
PPT
Introduction to c_sharp
PPT
Introduction to c_sharp
PDF
Jariko - A JVM interpreter for RPG written in kotlin
PDF
Clean Code @Voxxed Days Cluj 2023 - opening Keynote
PDF
Inspecting Block Closures To Generate Shaders for GPU Execution
PDF
The Next Mainstream Programming Language: A Game Developer's Perspective
PPTX
Turbo charging v8 engine
PDF
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
PDF
Introduction to D programming language at Weka.IO
PPTX
Old code doesn't stink - Detroit
PDF
NetWork - 15.10.2011 - Applied code generation in .NET
PDF
10 Reasons Why Java Now Rocks More Than Ever
F# for Trading
Making A Game Engine Is Easier Than You Think
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
Metaprogramming by brandon
Being a game developer with the skills you have
"The F# Path to Relaxation", Don Syme
Introduction to c_sharp
Introduction to c_sharp
Jariko - A JVM interpreter for RPG written in kotlin
Clean Code @Voxxed Days Cluj 2023 - opening Keynote
Inspecting Block Closures To Generate Shaders for GPU Execution
The Next Mainstream Programming Language: A Game Developer's Perspective
Turbo charging v8 engine
Simple Single Instruction Multiple Data (SIMD) with the Intel® Implicit SPMD ...
Introduction to D programming language at Weka.IO
Old code doesn't stink - Detroit
NetWork - 15.10.2011 - Applied code generation in .NET
10 Reasons Why Java Now Rocks More Than Ever
Ad

More from Phillip Trelford (20)

PPTX
How to be a rock star developer
PPTX
Mobile F#un
PPTX
F# eXchange Keynote 2016
PPTX
FSharp eye for the Haskell guy - London 2015
PPTX
Beyond lists - Copenhagen 2015
PPTX
F# for C# devs - Copenhagen .Net 2015
PPTX
Generative Art - Functional Vilnius 2015
PPTX
24 hours later - FSharp Gotham 2015
PPTX
Building cross platform games with Xamarin - Birmingham 2015
PPTX
Beyond Lists - Functional Kats Conf Dublin 2015
PPTX
FSharp On The Desktop - Birmingham FP 2015
PPTX
Ready, steady, cross platform games - ProgNet 2015
PPTX
F# for C# devs - NDC Oslo 2015
PPTX
F# for C# devs - Leeds Sharp 2015
PPTX
Build a compiler in 2hrs - NCrafts Paris 2015
PPTX
24 Hours Later - NCrafts Paris 2015
PPTX
Real World F# - SDD 2015
PPTX
F# for C# devs - SDD 2015
PPTX
Machine learning from disaster - GL.Net 2015
PPTX
F# for Trading - QuantLabs 2014
How to be a rock star developer
Mobile F#un
F# eXchange Keynote 2016
FSharp eye for the Haskell guy - London 2015
Beyond lists - Copenhagen 2015
F# for C# devs - Copenhagen .Net 2015
Generative Art - Functional Vilnius 2015
24 hours later - FSharp Gotham 2015
Building cross platform games with Xamarin - Birmingham 2015
Beyond Lists - Functional Kats Conf Dublin 2015
FSharp On The Desktop - Birmingham FP 2015
Ready, steady, cross platform games - ProgNet 2015
F# for C# devs - NDC Oslo 2015
F# for C# devs - Leeds Sharp 2015
Build a compiler in 2hrs - NCrafts Paris 2015
24 Hours Later - NCrafts Paris 2015
Real World F# - SDD 2015
F# for C# devs - SDD 2015
Machine learning from disaster - GL.Net 2015
F# for Trading - QuantLabs 2014
Ad

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Machine Learning_overview_presentation.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Encapsulation_ Review paper, used for researhc scholars
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPT
Teaching material agriculture food technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
A Presentation on Artificial Intelligence
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine Learning_overview_presentation.pptx
Approach and Philosophy of On baking technology
Reach Out and Touch Someone: Haptics and Empathic Computing
Encapsulation_ Review paper, used for researhc scholars
The AUB Centre for AI in Media Proposal.docx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Mobile App Security Testing_ A Comprehensive Guide.pdf
Teaching material agriculture food technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Agricultural_Statistics_at_a_Glance_2022_0.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
MIND Revenue Release Quarter 2 2025 Press Release
Review of recent advances in non-invasive hemoglobin estimation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
A Presentation on Artificial Intelligence
20250228 LYD VKU AI Blended-Learning.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

Functional Architecture - goto copenhagen 2012

Editor's Notes

  • #2: 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.
  • #3: 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
  • #4: C is assemblerC++ was initially called C with ClassesJava/C# = C with Classes + GC
  • #5: 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++
  • #6: See: http://en.wikipedia.org/wiki/Coroutine#Common_usesCode sample:http://fssnip.net/ca
  • #7: See: http://en.wikipedia.org/wiki/Coroutine#Common_usesCode sample:http://fssnip.net/ca
  • #8: 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
  • #11: Lightweight types with correct defaultsImmutabilityCompositionSeparation of concernsLightweight functions with correct defaultsIdempotentTestableType signatures
  • #12: Map: (‘T -> ‘U) -> ‘T -> ‘U
  • #13: Samples:Units in CellzLunar Landurz
  • #15: Putting it all together: http://www.trayport.com/en/joule/video
  • #19: Intellisense via the dot gives discoverabilityMakes it easy to explore an APIWorld bank sample