SlideShare una empresa de Scribd logo
1 de 67
The Next Mainstream Programming Language: A Game Developer’s Perspective Tim Sweeney Epic Games
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Game Development
Game Development: Gears of War ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Software Dependencies ,[object Object],Gears of War Gameplay Code ~250,000 lines C++, script code Unreal Engine 3  Middleware Game Engine ~250,000 lines C++ code DirectX Graphics OpenAL Audio Ogg Vorbis Music Codec Speex Speech Codec wx Widgets Window Library ZLib Data Compr- ession
Game Development: Platforms ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What’s in a game? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Three Kinds of Code ,[object Object],[object Object],[object Object]
Gameplay Simulation
Gameplay Simulation ,[object Object],[object Object],[object Object],[object Object],[object Object]
Gameplay Simulation – The Numbers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Numeric Computation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Shading
Shading ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Shading in HLSL
Shading – The Numbers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Three Kinds of Code FPU Usage Lines of Code CPU Budget Languages 500 GFLOPS 5 GFLOPS 0.5 GFLOPS 10,000 250,000 250,000 n/a 90% 10% CG, HLSL C++ C++, Scripting Shading Numeric Computation Game Simulation
What are the hard problems? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Performance
Performance ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Modularity
Unreal’s game framework package UnrealEngine; class Actor { int Health; void TakeDamage(int Amount)‏ { Health = Health – Amount; if (Health<0)‏ Die(); } } class Player extends Actor { string PlayerName; socket NetworkConnection; } Gameplay module Base class of gameplay objects Members
Game class hierarchy Actor Player Enemy InventoryItem Weapon Actor Player Enemy Dragon Troll InventoryItem Weapon Sword Crossbow Generic Game Framework Game-Specific Framework Extension
Software Frameworks ,[object Object],[object Object],[object Object],[object Object]
Software Frameworks ,[object Object],[object Object],[object Object],[object Object],[object Object]
What we would like to write… ,[object Object],package Engine; class Actor { int Health; … } class Player extends Actor { … } class Inventory extends Actor { … } Base Framework Package GearsOfWar extends Engine; class Actor extends Engine.Actor { // Here we can add new members // to the base class. …  } class Player extends Engine.Player { // Thus virtually inherits from // GearsOfWar.Actor … } class Gun extends GearsOfWar.Inventory { … } Extended Framework
Reliability Or: If the compiler doesn’t beep, my program should work
Dynamic Failure in Mainstream Languages Vertex[] Transform (Vertex[] Vertices, int[] Indices, Matrix m) { Vertex[] Result = new Vertex[Indices.length]; for(int i=0; i<Indices.length; i++)‏ Result[i] = Transform(m,Vertices[Indices[i]]); return Result; }; Example (C#): Given a vertex array and an index array, we read and transform the indexed vertices into a new array. What can possibly go wrong?
Dynamic Failure in Mainstream Languages Vertex[] Transform (Vertex[] Vertices, int[] Indices, Matrix m) { Vertex[] Result = new Vertex[Indices.length]; for(int i=0; i<Indices.length; i++)‏ Result[i] = Transform(m,Vertices[Indices[i]]); return Result; }; May be NULL May be NULL May contain indices outside of the range of the Vertex array May be NULL Array access might be out of bounds Will the compiler realize this can’t fail? Could dereference a null pointer Our code is littered with runtime failure cases, Yet the compiler remains silent!
Dynamic Failure in Mainstream Languages ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What we would like to write… Transform{n:nat}(Vertices:[n]Vertex, Indices:[]nat<n, m:Matrix):[]Vertex=   for each(i in Indices)   Transform(m,Vertices[i])‏ Universally quantify over all natural numbers An array of exactly known size An index buffer containing natural numbers less than n Haskell-style array comprehension The only possible failure mode: divergence, if the call to Transform diverges.
How might this work? ,[object Object],[object Object],[object Object],int nat nat<n Sum{n:nat}(xs:[n]int)=.. a=Sum([7,8,9])‏ Sum(n:nat,xs:[n]int)=.. a=Sum(3,[7,8,9])‏ The Integers The Natural Numbers The Natural Numbers less than n, where n may be a variable! Explicit type/value dependency between function parameters
How might this work? ,[object Object],[object Object],xp:^int xo:?int xpo:?^int A pointer to an integer An optional integer An optional pointer to an integer! Successors(xs:[]int):[]int= foreach(x in xs) x+1
How might this work? A guarded casting mechanism for cases where need a safe “escape”: All potential failure must be explicitly handled, but we lose no expressiveness. GetElement(as:[]string, i:int):string=   if(n:nat<as.length=i) as[n]   else “ Index Out of Bounds” Here, we cast  i  to type of natural numbers bounded by the length of  as , and bind the result to  n We can only access  i within this context If the cast fails, we execute the else-branch
Analysis of the Unreal code ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Accessing uninitialized variables ,[object Object],[object Object],[object Object],[object Object],[object Object],class MyClass { const int a=c+1; const int b=7; const int c=b+1; } MyClass myvalue = new C; // What is myvalue.a?
Dynamic Failure: Conclusion ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Integer overflow The Natural Numbers  Factoid: C# exposes more than 10 integer-like data types, none of which are those defined by (Pythagoras, 500BC). In the future, can we get integers right? data Nat = Zero | Succ Nat
Can we get integers right? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],This could be a viable tradeoff
Concurrency
The C++/Java/C# Model: “Shared State Concurrency” ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The C++/Java/C# Model: “Shared State Concurrency” ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],There must be a better way!
Three Kinds of Code: Revisited ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Concurrency in Shading ,[object Object],[object Object],[object Object],[object Object]
Concurrency in Shading ,[object Object],[object Object]
Concurrency in Numeric Computation ,[object Object],[object Object],[object Object],[object Object],In the future, we will write these algorithms using referentially-transparent constructs.
Numeric Computation Example: Collision Detection ,[object Object],struct vec3 { float x,y,z; }; struct hit { bool  DidCollide; float Time; vec3  Location; }; hit collide(vec3 start,vec3 end); Vec3  = data Vec3 float float float Hit  = data Hit float Vec3 collide :: (vec3,vec3)->Maybe Hit
Numeric Computation Example: Collision Detection ,[object Object],[object Object],[object Object],[object Object],[object Object],collide(start:Vec3,end:Vec3):?Hit print(s:string)[#imperative]:void A pure function (the default)‏ Effectful functions require explicit annotations In a concurrent world, imperative is the wrong default!
Concurrency in Gameplay Simulation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Concurrency in Gameplay Simulation: Software Transactional Memory ,[object Object],[object Object],[object Object],[object Object],[object Object],Claim: Transactions are the only plausible solution to concurrent mutable state
Three Kinds of Code: Revisited 500 GFLOPS 5 GFLOPS 0.5 GFLOPS FPU Usage Implicit Data Parallelism Implicit Thread Parallelism Software Transactional Memory Parallelism Lines of Code CPU Budget Languages 10,000 250,000 250,000 n/a 90% 10% CG, HLSL C++ C++, Scripting Shading Numeric Computation Game Simulation
Parallelism and purity Software Transactional Memory Purely functional core Physics, collision detection, scene traversal, path finding, .. Data Parallel Subset Graphics shader programs Game World State
Musings On the Next Maintream Programming Language
Musings ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Dependent types and concurrency must evolve simultaneously
Language Implications ,[object Object],[object Object],[object Object],[object Object]
Language Implications ,[object Object],[object Object],[object Object],[object Object],Why not go one step further and define partiality as an effect, thus creating a foundational language subset suitable for proofs?
Performance – Language Implications ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Syntax ,[object Object],[object Object],[object Object],int f{nat n}(int[] as,natrange<n> i) { return as[i]; } f{n:nat}(as:[]int,i:nat<n)=as[i] f :: forall n::nat. ([int],nat<n) -> int f (xs,i) = xs !! i C Family: Least scary, but it’s a messy legacy Haskell family: Quite scary   :-)‏ Pascal/ML family: Seems promising
Conclusion
A Brief History of Game Technology 1972 Pong (hardware)‏ 1980 Zork (high level interpretted language)‏ 1993 DOOM (C)‏ 1998 Unreal (C++, Java-style scripting)‏ 2005-6 Xbox 360, PlayStation 3 with 6-8 hardware threads 2009 Next console generation. Unification of the CPU, GPU. Massive multi-core, data parallelism, etc.
The Coming Crisis in Computing ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Questions?
Backup Slides
The Genius of Haskell ,[object Object],[object Object],[object Object],[object Object],[object Object]
The Genius of Haskell ,[object Object],sort []  = [] sort (x:xs) = sort [y | y<-xs, y<x ] ++ [x  ] ++   sort [y | y<-xs, y>=x] int partition(int y[], int f, int l); void quicksort(int x[], int first, int last) { int pivIndex = 0; if(first < last) { pivIndex = partition(x,first, last); quicksort(x,first,(pivIndex-1)); quicksort(x,(pivIndex+1),last); } } int partition(int y[], int f, int l) { int up,down,temp; int cc; int piv = y[f]; up = f; down = l; do {  while (y[up] <= piv && up < l) { up++; } while (y[down] > piv  ) { down--; } if (up < down ) { temp = y[up]; y[up] = y[down]; y[down] = temp; } } while (down > up); temp = piv; y[f] = y[down]; y[down] = piv; return down; } Sorting in Haskell Sorting in C
Why Haskell is Not My Favorite Programming Language ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Why Haskell is Not My Favorite Programming Language ,[object Object],[object Object],[object Object],[object Object],f(x,y) = x+y a=f(3,”4”)   f(int x,int y) = x+y a=f(3,”4”)‏ ERROR - Cannot infer instance *** Instance  : Num [Char] *** Expression : f (3,&quot;4&quot;)‏ Parameter mismatch paremter 2 of call to f:   Expected: int Got:  “4” … … ???

Más contenido relacionado

La actualidad más candente

Java Tutorial: Part 1. Getting Started
Java Tutorial: Part 1. Getting StartedJava Tutorial: Part 1. Getting Started
Java Tutorial: Part 1. Getting StartedSvetlin Nakov
 
Software Abstractions for Parallel Hardware
Software Abstractions for Parallel HardwareSoftware Abstractions for Parallel Hardware
Software Abstractions for Parallel HardwareJoel Falcou
 
The Goal and The Journey - Turning back on one year of C++14 Migration
The Goal and The Journey - Turning back on one year of C++14 MigrationThe Goal and The Journey - Turning back on one year of C++14 Migration
The Goal and The Journey - Turning back on one year of C++14 MigrationJoel Falcou
 
SPF Getting Started - Console Program
SPF Getting Started - Console ProgramSPF Getting Started - Console Program
SPF Getting Started - Console ProgramHock Leng PUAH
 
Symbolic Reasoning and Concrete Execution - Andrii Vozniuk
Symbolic Reasoning and Concrete Execution - Andrii Vozniuk Symbolic Reasoning and Concrete Execution - Andrii Vozniuk
Symbolic Reasoning and Concrete Execution - Andrii Vozniuk Andrii Vozniuk
 
Java Foundations: Basic Syntax, Conditions, Loops
Java Foundations: Basic Syntax, Conditions, LoopsJava Foundations: Basic Syntax, Conditions, Loops
Java Foundations: Basic Syntax, Conditions, LoopsSvetlin Nakov
 
20.1 Java working with abstraction
20.1 Java working with abstraction20.1 Java working with abstraction
20.1 Java working with abstractionIntro C# Book
 
D3, TypeScript, and Deep Learning
D3, TypeScript, and Deep LearningD3, TypeScript, and Deep Learning
D3, TypeScript, and Deep LearningOswald Campesato
 
Cs8792 cns - Public key cryptosystem (Unit III)
Cs8792   cns - Public key cryptosystem (Unit III)Cs8792   cns - Public key cryptosystem (Unit III)
Cs8792 cns - Public key cryptosystem (Unit III)ArthyR3
 
Introduction to Machine Learning with TensorFlow
Introduction to Machine Learning with TensorFlowIntroduction to Machine Learning with TensorFlow
Introduction to Machine Learning with TensorFlowPaolo Tomeo
 
Designing Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.ProtoDesigning Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.ProtoJoel Falcou
 
Java programming lab assignments
Java programming lab assignments Java programming lab assignments
Java programming lab assignments rajni kaushal
 
Java Foundations: Strings and Text Processing
Java Foundations: Strings and Text ProcessingJava Foundations: Strings and Text Processing
Java Foundations: Strings and Text ProcessingSvetlin Nakov
 
Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology
 

La actualidad más candente (19)

Java Tutorial: Part 1. Getting Started
Java Tutorial: Part 1. Getting StartedJava Tutorial: Part 1. Getting Started
Java Tutorial: Part 1. Getting Started
 
Software Abstractions for Parallel Hardware
Software Abstractions for Parallel HardwareSoftware Abstractions for Parallel Hardware
Software Abstractions for Parallel Hardware
 
The Goal and The Journey - Turning back on one year of C++14 Migration
The Goal and The Journey - Turning back on one year of C++14 MigrationThe Goal and The Journey - Turning back on one year of C++14 Migration
The Goal and The Journey - Turning back on one year of C++14 Migration
 
Symbolic Execution And KLEE
Symbolic Execution And KLEESymbolic Execution And KLEE
Symbolic Execution And KLEE
 
SPF Getting Started - Console Program
SPF Getting Started - Console ProgramSPF Getting Started - Console Program
SPF Getting Started - Console Program
 
Symbolic Reasoning and Concrete Execution - Andrii Vozniuk
Symbolic Reasoning and Concrete Execution - Andrii Vozniuk Symbolic Reasoning and Concrete Execution - Andrii Vozniuk
Symbolic Reasoning and Concrete Execution - Andrii Vozniuk
 
Java Foundations: Basic Syntax, Conditions, Loops
Java Foundations: Basic Syntax, Conditions, LoopsJava Foundations: Basic Syntax, Conditions, Loops
Java Foundations: Basic Syntax, Conditions, Loops
 
20.1 Java working with abstraction
20.1 Java working with abstraction20.1 Java working with abstraction
20.1 Java working with abstraction
 
D3, TypeScript, and Deep Learning
D3, TypeScript, and Deep LearningD3, TypeScript, and Deep Learning
D3, TypeScript, and Deep Learning
 
Cs8792 cns - Public key cryptosystem (Unit III)
Cs8792   cns - Public key cryptosystem (Unit III)Cs8792   cns - Public key cryptosystem (Unit III)
Cs8792 cns - Public key cryptosystem (Unit III)
 
Icom4015 lecture12-s16
Icom4015 lecture12-s16Icom4015 lecture12-s16
Icom4015 lecture12-s16
 
Introduction to Machine Learning with TensorFlow
Introduction to Machine Learning with TensorFlowIntroduction to Machine Learning with TensorFlow
Introduction to Machine Learning with TensorFlow
 
Icom4015 lecture4-f16
Icom4015 lecture4-f16Icom4015 lecture4-f16
Icom4015 lecture4-f16
 
Designing Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.ProtoDesigning Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.Proto
 
Java programming lab assignments
Java programming lab assignments Java programming lab assignments
Java programming lab assignments
 
Icom4015 lecture4-f17
Icom4015 lecture4-f17Icom4015 lecture4-f17
Icom4015 lecture4-f17
 
Java Foundations: Strings and Text Processing
Java Foundations: Strings and Text ProcessingJava Foundations: Strings and Text Processing
Java Foundations: Strings and Text Processing
 
Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011
 
Icom4015 lecture15-f16
Icom4015 lecture15-f16Icom4015 lecture15-f16
Icom4015 lecture15-f16
 

Destacado (8)

Credit2
Credit2Credit2
Credit2
 
Tutoriel Voice Recorder
Tutoriel Voice RecorderTutoriel Voice Recorder
Tutoriel Voice Recorder
 
Ejaki
EjakiEjaki
Ejaki
 
Alista
AlistaAlista
Alista
 
Ergonomics By Blr
Ergonomics By BlrErgonomics By Blr
Ergonomics By Blr
 
Edublog
EdublogEdublog
Edublog
 
Jessy & Vinny
Jessy & VinnyJessy & Vinny
Jessy & Vinny
 
Web2
Web2Web2
Web2
 

Similar a Tim Popl

Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]Chris Adamson
 
Introduction to Deep Learning and Tensorflow
Introduction to Deep Learning and TensorflowIntroduction to Deep Learning and Tensorflow
Introduction to Deep Learning and TensorflowOswald Campesato
 
The Ring programming language version 1.9 book - Part 58 of 210
The Ring programming language version 1.9 book - Part 58 of 210The Ring programming language version 1.9 book - Part 58 of 210
The Ring programming language version 1.9 book - Part 58 of 210Mahmoud Samir Fayed
 
Standardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for PythonStandardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for PythonRalf Gommers
 
Haskell for data science
Haskell for data scienceHaskell for data science
Haskell for data scienceJohn Cant
 
A well-typed program never goes wrong
A well-typed program never goes wrongA well-typed program never goes wrong
A well-typed program never goes wrongJulien Wetterwald
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial javaTpoint s
 
D3, TypeScript, and Deep Learning
D3, TypeScript, and Deep LearningD3, TypeScript, and Deep Learning
D3, TypeScript, and Deep LearningOswald Campesato
 
PythonStudyMaterialSTudyMaterial.pdf
PythonStudyMaterialSTudyMaterial.pdfPythonStudyMaterialSTudyMaterial.pdf
PythonStudyMaterialSTudyMaterial.pdfdata2businessinsight
 
Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeDmitri Nesteruk
 
IntroductionToCSharp.ppt
IntroductionToCSharp.pptIntroductionToCSharp.ppt
IntroductionToCSharp.pptRishikaRuhela
 
Introduction toc sharp
Introduction toc sharpIntroduction toc sharp
Introduction toc sharpSDFG5
 
IntroductionToCSharp.ppt
IntroductionToCSharp.pptIntroductionToCSharp.ppt
IntroductionToCSharp.pptReemaAsker1
 
IntroductionToCSharp.ppt
IntroductionToCSharp.pptIntroductionToCSharp.ppt
IntroductionToCSharp.pptReemaAsker1
 

Similar a Tim Popl (20)

Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
Oh Crap, I Forgot (Or Never Learned) C! [CodeMash 2010]
 
Introduction to Deep Learning and Tensorflow
Introduction to Deep Learning and TensorflowIntroduction to Deep Learning and Tensorflow
Introduction to Deep Learning and Tensorflow
 
C#
C#C#
C#
 
The Ring programming language version 1.9 book - Part 58 of 210
The Ring programming language version 1.9 book - Part 58 of 210The Ring programming language version 1.9 book - Part 58 of 210
The Ring programming language version 1.9 book - Part 58 of 210
 
MXNet Workshop
MXNet WorkshopMXNet Workshop
MXNet Workshop
 
Standardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for PythonStandardizing on a single N-dimensional array API for Python
Standardizing on a single N-dimensional array API for Python
 
Haskell for data science
Haskell for data scienceHaskell for data science
Haskell for data science
 
A well-typed program never goes wrong
A well-typed program never goes wrongA well-typed program never goes wrong
A well-typed program never goes wrong
 
unit 1 (1).pptx
unit 1 (1).pptxunit 1 (1).pptx
unit 1 (1).pptx
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
 
Python ppt
Python pptPython ppt
Python ppt
 
Modern C++
Modern C++Modern C++
Modern C++
 
D3, TypeScript, and Deep Learning
D3, TypeScript, and Deep LearningD3, TypeScript, and Deep Learning
D3, TypeScript, and Deep Learning
 
C language
C languageC language
C language
 
PythonStudyMaterialSTudyMaterial.pdf
PythonStudyMaterialSTudyMaterial.pdfPythonStudyMaterialSTudyMaterial.pdf
PythonStudyMaterialSTudyMaterial.pdf
 
Unmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/InvokeUnmanaged Parallelization via P/Invoke
Unmanaged Parallelization via P/Invoke
 
IntroductionToCSharp.ppt
IntroductionToCSharp.pptIntroductionToCSharp.ppt
IntroductionToCSharp.ppt
 
Introduction toc sharp
Introduction toc sharpIntroduction toc sharp
Introduction toc sharp
 
IntroductionToCSharp.ppt
IntroductionToCSharp.pptIntroductionToCSharp.ppt
IntroductionToCSharp.ppt
 
IntroductionToCSharp.ppt
IntroductionToCSharp.pptIntroductionToCSharp.ppt
IntroductionToCSharp.ppt
 

Último

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Último (20)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Tim Popl

  • 1. The Next Mainstream Programming Language: A Game Developer’s Perspective Tim Sweeney Epic Games
  • 2.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 10.
  • 11.
  • 12.
  • 14.
  • 16.
  • 17. Three Kinds of Code FPU Usage Lines of Code CPU Budget Languages 500 GFLOPS 5 GFLOPS 0.5 GFLOPS 10,000 250,000 250,000 n/a 90% 10% CG, HLSL C++ C++, Scripting Shading Numeric Computation Game Simulation
  • 18.
  • 20.
  • 22. Unreal’s game framework package UnrealEngine; class Actor { int Health; void TakeDamage(int Amount)‏ { Health = Health – Amount; if (Health<0)‏ Die(); } } class Player extends Actor { string PlayerName; socket NetworkConnection; } Gameplay module Base class of gameplay objects Members
  • 23. Game class hierarchy Actor Player Enemy InventoryItem Weapon Actor Player Enemy Dragon Troll InventoryItem Weapon Sword Crossbow Generic Game Framework Game-Specific Framework Extension
  • 24.
  • 25.
  • 26.
  • 27. Reliability Or: If the compiler doesn’t beep, my program should work
  • 28. Dynamic Failure in Mainstream Languages Vertex[] Transform (Vertex[] Vertices, int[] Indices, Matrix m) { Vertex[] Result = new Vertex[Indices.length]; for(int i=0; i<Indices.length; i++)‏ Result[i] = Transform(m,Vertices[Indices[i]]); return Result; }; Example (C#): Given a vertex array and an index array, we read and transform the indexed vertices into a new array. What can possibly go wrong?
  • 29. Dynamic Failure in Mainstream Languages Vertex[] Transform (Vertex[] Vertices, int[] Indices, Matrix m) { Vertex[] Result = new Vertex[Indices.length]; for(int i=0; i<Indices.length; i++)‏ Result[i] = Transform(m,Vertices[Indices[i]]); return Result; }; May be NULL May be NULL May contain indices outside of the range of the Vertex array May be NULL Array access might be out of bounds Will the compiler realize this can’t fail? Could dereference a null pointer Our code is littered with runtime failure cases, Yet the compiler remains silent!
  • 30.
  • 31. What we would like to write… Transform{n:nat}(Vertices:[n]Vertex, Indices:[]nat<n, m:Matrix):[]Vertex= for each(i in Indices) Transform(m,Vertices[i])‏ Universally quantify over all natural numbers An array of exactly known size An index buffer containing natural numbers less than n Haskell-style array comprehension The only possible failure mode: divergence, if the call to Transform diverges.
  • 32.
  • 33.
  • 34. How might this work? A guarded casting mechanism for cases where need a safe “escape”: All potential failure must be explicitly handled, but we lose no expressiveness. GetElement(as:[]string, i:int):string= if(n:nat<as.length=i) as[n] else “ Index Out of Bounds” Here, we cast i to type of natural numbers bounded by the length of as , and bind the result to n We can only access i within this context If the cast fails, we execute the else-branch
  • 35.
  • 36.
  • 37.
  • 38. Integer overflow The Natural Numbers Factoid: C# exposes more than 10 integer-like data types, none of which are those defined by (Pythagoras, 500BC). In the future, can we get integers right? data Nat = Zero | Succ Nat
  • 39.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51. Three Kinds of Code: Revisited 500 GFLOPS 5 GFLOPS 0.5 GFLOPS FPU Usage Implicit Data Parallelism Implicit Thread Parallelism Software Transactional Memory Parallelism Lines of Code CPU Budget Languages 10,000 250,000 250,000 n/a 90% 10% CG, HLSL C++ C++, Scripting Shading Numeric Computation Game Simulation
  • 52. Parallelism and purity Software Transactional Memory Purely functional core Physics, collision detection, scene traversal, path finding, .. Data Parallel Subset Graphics shader programs Game World State
  • 53. Musings On the Next Maintream Programming Language
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 60. A Brief History of Game Technology 1972 Pong (hardware)‏ 1980 Zork (high level interpretted language)‏ 1993 DOOM (C)‏ 1998 Unreal (C++, Java-style scripting)‏ 2005-6 Xbox 360, PlayStation 3 with 6-8 hardware threads 2009 Next console generation. Unification of the CPU, GPU. Massive multi-core, data parallelism, etc.
  • 61.
  • 64.
  • 65.
  • 66.
  • 67.