SlideShare una empresa de Scribd logo
1 de 62
Descargar para leer sin conexión
What’s next in Jul_
Jiahao Chen
MIT Computer Science and Artificial Intelligence Laboratory
julialang.org
Alan EdelmanJeff Bezanson Stefan Karpinski Viral B. Shah
What’s the big deal about Julia ?
julialang.org/benchmarks
It bridges the divide between computer science
and computational science
What’s the big deal about Julia ?
It bridges the divide between computer science
and computational science
What’s the big deal about Julia ?
data abstraction
performance
It bridges the divide between computer science
and computational science
What’s the big deal about Julia ?
data abstraction
performance
What if you didn’t have to choose between
data abstraction and performance?
It’s a programming language designed for technical computing
What’s the big deal about Julia ?
It’s a programming language designed for technical computing
What’s the big deal about Julia ?
The key ingredients
Multi-methods (multiple dispatch)
Dataflow type inference
together allow for cost-efficient data abstraction
Object-oriented programming with classes
What can I do with/to a thing?
Object-oriented programming with classes
What can I do with/to a thing?
Object-oriented programming with classes
What can I do with/to a thing?
top up
pay fare
lose
buy
Object-oriented programming with classes
What can I do with/to a thing?
top up
pay fare
lose
buy
top up
pay fare
lose
buy
Object-oriented programming with classes
What can I do with/to a thing?
top up
pay fare
lose
buy
top up
pay fare
lose
buy
Object-oriented programming with classes
What can I do with/to a thing?
top up
pay fare
lose
buy
top up
pay fare
lose
buy
pay fare
lose
buy
methods objects
Object-oriented programming with classes
What can I do with/to a thing?
top up
pay fare
lose
buy
top up
pay fare
lose
buy
pay fare
lose
buy
methods objects
Object-oriented programming with classes
What can I do with/to a thing?
top up
pay fare
lose
buy
top up
pay fare
lose
buy
pay fare
lose
buy
class-based OO
!
classes are more
fundamental
than methods
Object-oriented programming with multi-methods
What can I do with/to a thing?
top up
pay fare
lose
buy
generic
function
objectsmethods
Object-oriented programming with multi-methods
What can I do with/to a thing?
top up
pay fare
lose
buy
generic
function
objectsmethods
multimethods
!
relationships between
objects and functions
Multi-methods with type hierarchy
top up
pay fare
lose
buy
generic
function
objectsmethods
rechargeable
subway
pass
single-use
subway
ticket
is a subtype of
subway
ticket
abstract object
generic
function
objectsmethods
rechargeable
subway
pass
single-use
subway
ticket
is a subtype of
subway
ticket
top up
pay fare
lose
buy
abstract object
Multi-methods with type hierarchy
generic
function
objectsmethods
rechargeable
subway
pass
single-use
subway
ticket
is a subtype of
subway
ticket
top up
pay fare
lose
buy
abstract object
Multi-methods with type hierarchy
The Julia codebase is compact
5,774 lines of Scheme
32,707 lines of C
59727 lines of Julia
!
+LLVM, BLAS, LAPACK, SuiteSparse, ARPACK,
Rmath, GMP, MPFR, FFTW,…
Data types as a lattice
Dana Scott, Data types as lattices, SIAM J. Comput. 5: 522-87. 1976
Real
Number
FloatingPoint Rational
Complex
Float64 BigFloat…
…
Integer
is a parameter of
is a subtype of
Signed BigInt
Any
Int64…
…
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
no method here
try supertype
super(Int64) = Signed
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
no method here
try supertype
super(Int64) = Signed
no method here either
super(Signed) = Integer
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
no method here
try supertype
super(Int64) = Signed
no method here either
super(Signed) = Integer
found a method
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
Signed
Multiple dispatch with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
Julia
LLVM IR
Machine assembly
aggressive type specialization
!
compiler generates specialized
methods for different input types
to the same generic function
unitful computations with
essentially no runtime
overhead
Keno Fischer
Harvard
Physics and Mathematics
Type lattice of arrays
DenseArray{T, N}
AbstractArray{T, N}
Array{T, N}
…
is a subtype of
Any
Array{T,1}===Vector{T}	
Array{T,2}===Matrix{T}
A single parametric type defines many types
of matrices
Matrix{Float64}, Matrix{Int64},	
Matrix{BigFloat}, Matrix{Complex128},	
Matrix{Rational}, Matrix{Quaternion{Float64}},…
Type lattice of arrays
DenseArray{T, N}
AbstractArray{T, N}
Array{T, N}
…
is a subtype of
Any
Array{T,1}===Vector{T}	
Array{T,2}===Matrix{T}
A single parametric type defines many types
of matrices
Matrix{Float64}, Matrix{Int64},	
Matrix{BigFloat}, Matrix{Complex128},	
Matrix{Rational}, Matrix{Quaternion{Float64}},…
Type lattice of arrays
DenseArray{T, N}
AbstractArray{T, N}
Array{T, N}
…
is a subtype of
Any
Array{T,1}===Vector{T}	
Array{T,2}===Matrix{T}
rotation matrices
structured matrices
distributed arrays
A single parametric type defines many types
of matrices
Matrix{Float64}, Matrix{Int64},	
Matrix{BigFloat}, Matrix{Complex128},	
Matrix{Rational}, Matrix{Quaternion{Float64}},…
Multi-methods for linear algebra
What can I do with/to a thing?
find eigenvalues and eigenvectors
find singular values
find singular values and vectors
find eigenvalues
generic
function
objectsmethods
general matrix
symmetric tridiagonal matrix
bidiagonal matrix
Methods can take advantage of special matrix structures
eigvals
eigfact
svdvals
svdfact
Matrix
SymTridiagonal
Bidiagonal
So how does this help us with linear algebra?
So how does this help us with linear algebra?
Multi-method dispatch on special matrix types
So how does this help us with linear algebra?
Multi-method dispatch on special matrix types
So how does this help us with linear algebra?
Multi-method dispatch on special matrix types
stev!{T<:BlasFloat} calls sgestv	
dgestv	
cgestv	
zgestv	
and handles workspace
memory allocation
So how does this help us with linear algebra?
Multi-method dispatch with generic fallbacks
Matrix operations on general rings
So how does this help us with linear algebra?
Multi-method dispatch with generic fallbacks
Matrix operations on general rings textbook algorithm
So how does this help us with linear algebra?
Multi-method dispatch with generic fallbacks
Matrix operations on general rings
Matrix factorization types
Iterative algorithms as iterators
for item in iterable	
#body	
end	
!
#is equivalent to	
!
state = start(iterable) 	
while !done(iterable, state) 	
item, state = next(iterable, state) 	
# body	
end
Conjugate gradients (Hestenes-Stiefel)
http://en.wikipedia.org/wiki/Conjugate_gradient_method
Conjugate gradients (Hestenes-Stiefel)
http://en.wikipedia.org/wiki/Conjugate_gradient_method
Can we write this as an iterator?
Conjugate gradients (Hestenes-Stiefel)
http://en.wikipedia.org/wiki/Conjugate_gradient_method
Can we write this as an iterator?
state = start(iterable)
done(iterable, state)
Conjugate gradients (Hestenes-Stiefel)
http://en.wikipedia.org/wiki/Conjugate_gradient_method
state = start(iterable)
done(iterable, state)
state, dx = next(iterable, state)
immutable cg_hs #iterative solver	
K :: KrylovSpace #wraps A, v0, k	
t :: Terminator #termination criteria	
end	
	
immutable cg_hs_state	
r :: Vector #residual	
p :: Vector #search direction	
rnormsq :: Float64 #Squared norm of previous residual	
iter :: Int #iteration count	
end	
	
start(a::cg_hs) = cg_hs_state(a.K.v0,	
zeros(size(a.K.v0,1)), Inf, 0)	
	
function next(a::cg_hs, s::cg_hs_state)	
rnormsq = dot(s.r, s.r)	
p = s.r + (rnormsq/s.rnormsq)*s.p	
Ap = a.K.A*p	
α = rnormsq / dot(p, Ap)	
α*p, cg_hs_state(s.r-α*Ap, p, rnormsq, s.iter+1)	
end	
	
done(a::cg_hs, s::cg_hs_state) = done(a.t, s)	
!
K = method(KrylovSpace(A, b, k), Terminator())	
x += reduce(+, K) # for dx in K; x += dx; end
Hestenes-Stiefel CG
immutable cg_hs #iterative solver	
K :: KrylovSpace #wraps A, v0, k	
t :: Terminator #termination criteria	
end	
	
immutable cg_hs_state	
r :: Vector #residual	
p :: Vector #search direction	
rnormsq :: Float64 #Squared norm of previous residual	
iter :: Int #iteration count	
end	
	
start(a::cg_hs) = cg_hs_state(a.K.v0,	
zeros(size(a.K.v0,1)), Inf, 0)	
	
function next(a::cg_hs, s::cg_hs_state)	
rnormsq = dot(s.r, s.r)	
p = s.r + (rnormsq/s.rnormsq)*s.p	
Ap = a.K.A*p	
α = rnormsq / dot(p, Ap)	
α*p, cg_hs_state(s.r-α*Ap, p, rnormsq, s.iter+1)	
end	
	
done(a::cg_hs, s::cg_hs_state) = done(a.t, s)	
!
K = method(KrylovSpace(A, b, k), Terminator())	
x += reduce(+, K) # for dx in K; x += dx; end
Hestenes-Stiefel CG
Abstracts out termination check and solution update steps
Native parallelism constructs
Native parallelism constructs
Native parallelism constructs
Distributed arrays
IJulia: Julia in IPython Notebook
IJulia: Julia in IPython Notebook
JuMP: writing simple DSLs in Julia
Iain Dunning Miles Lubin
MIT
Operations Research
Andreas N. Jensen
U. Copenhagen
Economics
Alan EdelmanJeff Bezanson Stefan Karpinski Viral B. Shah
Carlo Baldassi
Poly. Torino
Neuroscience
Tim E. Holy
WUSTL
Anatomy
Douglas M. Bates
Wisconsin-Madison
Statistics
Steven G. Johnson
MIT
Mathematics

Más contenido relacionado

La actualidad más candente

Lecture 07 Data Structures - Basic Sorting
Lecture 07 Data Structures - Basic SortingLecture 07 Data Structures - Basic Sorting
Lecture 07 Data Structures - Basic Sorting
Haitham El-Ghareeb
 

La actualidad más candente (20)

Data handling CBSE PYTHON CLASS 11
Data handling CBSE PYTHON CLASS 11Data handling CBSE PYTHON CLASS 11
Data handling CBSE PYTHON CLASS 11
 
Smali语法
Smali语法Smali语法
Smali语法
 
An Introduction to the C++ Standard Library
An Introduction to the C++ Standard LibraryAn Introduction to the C++ Standard Library
An Introduction to the C++ Standard Library
 
Stl Containers
Stl ContainersStl Containers
Stl Containers
 
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objects
 
Data types in python lecture (2)
Data types in python lecture (2)Data types in python lecture (2)
Data types in python lecture (2)
 
Data types in python
Data types in pythonData types in python
Data types in python
 
Gleaning Types for Literals in RDF with Application to Entity Summarization
Gleaning Types for Literals in RDF with Application to Entity SummarizationGleaning Types for Literals in RDF with Application to Entity Summarization
Gleaning Types for Literals in RDF with Application to Entity Summarization
 
+2 Computer Science - Volume II Notes
+2 Computer Science - Volume II Notes+2 Computer Science - Volume II Notes
+2 Computer Science - Volume II Notes
 
Lect07
Lect07Lect07
Lect07
 
Chapter 10 data handling
Chapter 10 data handlingChapter 10 data handling
Chapter 10 data handling
 
Lecture 07 Data Structures - Basic Sorting
Lecture 07 Data Structures - Basic SortingLecture 07 Data Structures - Basic Sorting
Lecture 07 Data Structures - Basic Sorting
 
DSA - Lecture 04
DSA - Lecture 04DSA - Lecture 04
DSA - Lecture 04
 
Sharbani bhattacharya VB Structures
Sharbani bhattacharya VB StructuresSharbani bhattacharya VB Structures
Sharbani bhattacharya VB Structures
 
Oo ps exam answer2
Oo ps exam answer2Oo ps exam answer2
Oo ps exam answer2
 
Latent Semanctic Analysis Auro Tripathy
Latent Semanctic Analysis Auro TripathyLatent Semanctic Analysis Auro Tripathy
Latent Semanctic Analysis Auro Tripathy
 
DSA-Lecture-05
DSA-Lecture-05DSA-Lecture-05
DSA-Lecture-05
 
Standard template library
Standard template libraryStandard template library
Standard template library
 
Data Science as a Career and Intro to R
Data Science as a Career and Intro to RData Science as a Career and Intro to R
Data Science as a Career and Intro to R
 
Standard template library
Standard template libraryStandard template library
Standard template library
 

Destacado

A brief introduction to Hartree-Fock and TDDFT
A brief introduction to Hartree-Fock and TDDFTA brief introduction to Hartree-Fock and TDDFT
A brief introduction to Hartree-Fock and TDDFT
Jiahao Chen
 
Resolving the dissociation catastrophe in fluctuating-charge models
Resolving the dissociation catastrophe in fluctuating-charge modelsResolving the dissociation catastrophe in fluctuating-charge models
Resolving the dissociation catastrophe in fluctuating-charge models
Jiahao Chen
 
Excitation Energy Transfer In Photosynthetic Membranes
Excitation Energy Transfer In Photosynthetic MembranesExcitation Energy Transfer In Photosynthetic Membranes
Excitation Energy Transfer In Photosynthetic Membranes
Jiahao Chen
 
Group meeting 3/11 - sticky electrons
Group meeting 3/11 - sticky electronsGroup meeting 3/11 - sticky electrons
Group meeting 3/11 - sticky electrons
Jiahao Chen
 

Destacado (17)

Julia: compiler and community
Julia: compiler and communityJulia: compiler and community
Julia: compiler and community
 
Programming languages: history, relativity and design
Programming languages: history, relativity and designProgramming languages: history, relativity and design
Programming languages: history, relativity and design
 
An introduction to Julia
An introduction to JuliaAn introduction to Julia
An introduction to Julia
 
Julia? why a new language, an an application to genomics data analysis
Julia? why a new language, an an application to genomics data analysisJulia? why a new language, an an application to genomics data analysis
Julia? why a new language, an an application to genomics data analysis
 
Genomics data analysis in Julia
Genomics data analysis in JuliaGenomics data analysis in Julia
Genomics data analysis in Julia
 
Understanding ECG signals in the MIMIC II database
Understanding ECG signals in the MIMIC II databaseUnderstanding ECG signals in the MIMIC II database
Understanding ECG signals in the MIMIC II database
 
A brief introduction to Hartree-Fock and TDDFT
A brief introduction to Hartree-Fock and TDDFTA brief introduction to Hartree-Fock and TDDFT
A brief introduction to Hartree-Fock and TDDFT
 
Technical computing in Julia
Technical computing in JuliaTechnical computing in Julia
Technical computing in Julia
 
Julia: Multimethods for abstraction and performance
Julia: Multimethods for abstraction and performanceJulia: Multimethods for abstraction and performance
Julia: Multimethods for abstraction and performance
 
Resolving the dissociation catastrophe in fluctuating-charge models
Resolving the dissociation catastrophe in fluctuating-charge modelsResolving the dissociation catastrophe in fluctuating-charge models
Resolving the dissociation catastrophe in fluctuating-charge models
 
Julia, genomics data and their principal components
Julia, genomics data and their principal componentsJulia, genomics data and their principal components
Julia, genomics data and their principal components
 
Excitation Energy Transfer In Photosynthetic Membranes
Excitation Energy Transfer In Photosynthetic MembranesExcitation Energy Transfer In Photosynthetic Membranes
Excitation Energy Transfer In Photosynthetic Membranes
 
A Julia package for iterative SVDs with applications to genomics data analysis
A Julia package for iterative SVDs with applications to genomics data analysisA Julia package for iterative SVDs with applications to genomics data analysis
A Julia package for iterative SVDs with applications to genomics data analysis
 
Group meeting 3/11 - sticky electrons
Group meeting 3/11 - sticky electronsGroup meeting 3/11 - sticky electrons
Group meeting 3/11 - sticky electrons
 
Theory and application of fluctuating-charge models
Theory and application of fluctuating-charge modelsTheory and application of fluctuating-charge models
Theory and application of fluctuating-charge models
 
Python as number crunching code glue
Python as number crunching code gluePython as number crunching code glue
Python as number crunching code glue
 
High performance computing language,julia
High performance computing language,juliaHigh performance computing language,julia
High performance computing language,julia
 

Similar a What's next in Julia

Whats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPontoWhats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPonto
Paulo Morgado
 
computer notes - Data Structures - 1
computer notes - Data Structures - 1computer notes - Data Structures - 1
computer notes - Data Structures - 1
ecomputernotes
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
Mario Fusco
 
Roberto Trasarti PhD Thesis
Roberto Trasarti PhD ThesisRoberto Trasarti PhD Thesis
Roberto Trasarti PhD Thesis
Roberto Trasarti
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparation
sonu sharma
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparation
Kgr Sushmitha
 

Similar a What's next in Julia (20)

Types Working for You, Not Against You
Types Working for You, Not Against YouTypes Working for You, Not Against You
Types Working for You, Not Against You
 
Whats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPontoWhats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPonto
 
Lambdas: Myths and Mistakes
Lambdas: Myths and MistakesLambdas: Myths and Mistakes
Lambdas: Myths and Mistakes
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
 
An Answer Set Programming based framework for High-Utility Pattern Mining ext...
An Answer Set Programming based framework for High-Utility Pattern Mining ext...An Answer Set Programming based framework for High-Utility Pattern Mining ext...
An Answer Set Programming based framework for High-Utility Pattern Mining ext...
 
fds u1.docx
fds u1.docxfds u1.docx
fds u1.docx
 
unit 1 (1).pptx
unit 1 (1).pptxunit 1 (1).pptx
unit 1 (1).pptx
 
Monads and Monoids by Oleksiy Dyagilev
Monads and Monoids by Oleksiy DyagilevMonads and Monoids by Oleksiy Dyagilev
Monads and Monoids by Oleksiy Dyagilev
 
computer notes - Data Structures - 1
computer notes - Data Structures - 1computer notes - Data Structures - 1
computer notes - Data Structures - 1
 
devLink - What's New in C# 4?
devLink - What's New in C# 4?devLink - What's New in C# 4?
devLink - What's New in C# 4?
 
Bt0065
Bt0065Bt0065
Bt0065
 
B T0065
B T0065B T0065
B T0065
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
 
Nimrita koul Machine Learning
Nimrita koul  Machine LearningNimrita koul  Machine Learning
Nimrita koul Machine Learning
 
Data types
Data typesData types
Data types
 
Roberto Trasarti PhD Thesis
Roberto Trasarti PhD ThesisRoberto Trasarti PhD Thesis
Roberto Trasarti PhD Thesis
 
Computer notes - data structures
Computer notes - data structuresComputer notes - data structures
Computer notes - data structures
 
C Interview Questions for Fresher
C Interview Questions for FresherC Interview Questions for Fresher
C Interview Questions for Fresher
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparation
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparation
 

Último

Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
AroojKhan71
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
amitlee9823
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
amitlee9823
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
MarinCaroMartnezBerg
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 

Último (20)

Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
Week-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interactionWeek-01-2.ppt BBB human Computer interaction
Week-01-2.ppt BBB human Computer interaction
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
Thane Call Girls 7091864438 Call Girls in Thane Escort service book now -
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 

What's next in Julia

  • 1. What’s next in Jul_ Jiahao Chen MIT Computer Science and Artificial Intelligence Laboratory julialang.org Alan EdelmanJeff Bezanson Stefan Karpinski Viral B. Shah
  • 2. What’s the big deal about Julia ? julialang.org/benchmarks
  • 3. It bridges the divide between computer science and computational science What’s the big deal about Julia ?
  • 4. It bridges the divide between computer science and computational science What’s the big deal about Julia ? data abstraction performance
  • 5. It bridges the divide between computer science and computational science What’s the big deal about Julia ? data abstraction performance What if you didn’t have to choose between data abstraction and performance?
  • 6. It’s a programming language designed for technical computing What’s the big deal about Julia ?
  • 7. It’s a programming language designed for technical computing What’s the big deal about Julia ? The key ingredients Multi-methods (multiple dispatch) Dataflow type inference together allow for cost-efficient data abstraction
  • 8. Object-oriented programming with classes What can I do with/to a thing?
  • 9. Object-oriented programming with classes What can I do with/to a thing?
  • 10. Object-oriented programming with classes What can I do with/to a thing? top up pay fare lose buy
  • 11. Object-oriented programming with classes What can I do with/to a thing? top up pay fare lose buy top up pay fare lose buy
  • 12. Object-oriented programming with classes What can I do with/to a thing? top up pay fare lose buy top up pay fare lose buy
  • 13. Object-oriented programming with classes What can I do with/to a thing? top up pay fare lose buy top up pay fare lose buy pay fare lose buy
  • 14. methods objects Object-oriented programming with classes What can I do with/to a thing? top up pay fare lose buy top up pay fare lose buy pay fare lose buy
  • 15. methods objects Object-oriented programming with classes What can I do with/to a thing? top up pay fare lose buy top up pay fare lose buy pay fare lose buy class-based OO ! classes are more fundamental than methods
  • 16. Object-oriented programming with multi-methods What can I do with/to a thing? top up pay fare lose buy generic function objectsmethods
  • 17. Object-oriented programming with multi-methods What can I do with/to a thing? top up pay fare lose buy generic function objectsmethods multimethods ! relationships between objects and functions
  • 18. Multi-methods with type hierarchy top up pay fare lose buy generic function objectsmethods rechargeable subway pass single-use subway ticket is a subtype of subway ticket abstract object
  • 19. generic function objectsmethods rechargeable subway pass single-use subway ticket is a subtype of subway ticket top up pay fare lose buy abstract object Multi-methods with type hierarchy
  • 20. generic function objectsmethods rechargeable subway pass single-use subway ticket is a subtype of subway ticket top up pay fare lose buy abstract object Multi-methods with type hierarchy
  • 21. The Julia codebase is compact 5,774 lines of Scheme 32,707 lines of C 59727 lines of Julia ! +LLVM, BLAS, LAPACK, SuiteSparse, ARPACK, Rmath, GMP, MPFR, FFTW,…
  • 22. Data types as a lattice Dana Scott, Data types as lattices, SIAM J. Comput. 5: 522-87. 1976 Real Number FloatingPoint Rational Complex Float64 BigFloat… … Integer is a parameter of is a subtype of Signed BigInt Any Int64… …
  • 23. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… …
  • 24. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… …
  • 25. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… …
  • 26. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… … no method here try supertype super(Int64) = Signed
  • 27. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… … no method here try supertype super(Int64) = Signed no method here either super(Signed) = Integer
  • 28. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… … no method here try supertype super(Int64) = Signed no method here either super(Signed) = Integer found a method
  • 29. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… …
  • 30. Signed Multiple dispatch with type lattice traversal Real Number FloatingPoint Rational Float64 BigFloat… Integer is a parameter of is a subtype of BigInt Any Int64… …
  • 31.
  • 33.
  • 34. aggressive type specialization ! compiler generates specialized methods for different input types to the same generic function
  • 35. unitful computations with essentially no runtime overhead Keno Fischer Harvard Physics and Mathematics
  • 36. Type lattice of arrays DenseArray{T, N} AbstractArray{T, N} Array{T, N} … is a subtype of Any Array{T,1}===Vector{T} Array{T,2}===Matrix{T} A single parametric type defines many types of matrices Matrix{Float64}, Matrix{Int64}, Matrix{BigFloat}, Matrix{Complex128}, Matrix{Rational}, Matrix{Quaternion{Float64}},…
  • 37. Type lattice of arrays DenseArray{T, N} AbstractArray{T, N} Array{T, N} … is a subtype of Any Array{T,1}===Vector{T} Array{T,2}===Matrix{T} A single parametric type defines many types of matrices Matrix{Float64}, Matrix{Int64}, Matrix{BigFloat}, Matrix{Complex128}, Matrix{Rational}, Matrix{Quaternion{Float64}},…
  • 38. Type lattice of arrays DenseArray{T, N} AbstractArray{T, N} Array{T, N} … is a subtype of Any Array{T,1}===Vector{T} Array{T,2}===Matrix{T} rotation matrices structured matrices distributed arrays A single parametric type defines many types of matrices Matrix{Float64}, Matrix{Int64}, Matrix{BigFloat}, Matrix{Complex128}, Matrix{Rational}, Matrix{Quaternion{Float64}},…
  • 39. Multi-methods for linear algebra What can I do with/to a thing? find eigenvalues and eigenvectors find singular values find singular values and vectors find eigenvalues generic function objectsmethods general matrix symmetric tridiagonal matrix bidiagonal matrix Methods can take advantage of special matrix structures eigvals eigfact svdvals svdfact Matrix SymTridiagonal Bidiagonal
  • 40. So how does this help us with linear algebra?
  • 41. So how does this help us with linear algebra? Multi-method dispatch on special matrix types
  • 42. So how does this help us with linear algebra? Multi-method dispatch on special matrix types
  • 43. So how does this help us with linear algebra? Multi-method dispatch on special matrix types stev!{T<:BlasFloat} calls sgestv dgestv cgestv zgestv and handles workspace memory allocation
  • 44. So how does this help us with linear algebra? Multi-method dispatch with generic fallbacks Matrix operations on general rings
  • 45. So how does this help us with linear algebra? Multi-method dispatch with generic fallbacks Matrix operations on general rings textbook algorithm
  • 46. So how does this help us with linear algebra? Multi-method dispatch with generic fallbacks Matrix operations on general rings
  • 48. Iterative algorithms as iterators for item in iterable #body end ! #is equivalent to ! state = start(iterable) while !done(iterable, state) item, state = next(iterable, state) # body end
  • 51. Conjugate gradients (Hestenes-Stiefel) http://en.wikipedia.org/wiki/Conjugate_gradient_method Can we write this as an iterator? state = start(iterable) done(iterable, state)
  • 52. Conjugate gradients (Hestenes-Stiefel) http://en.wikipedia.org/wiki/Conjugate_gradient_method state = start(iterable) done(iterable, state) state, dx = next(iterable, state)
  • 53. immutable cg_hs #iterative solver K :: KrylovSpace #wraps A, v0, k t :: Terminator #termination criteria end immutable cg_hs_state r :: Vector #residual p :: Vector #search direction rnormsq :: Float64 #Squared norm of previous residual iter :: Int #iteration count end start(a::cg_hs) = cg_hs_state(a.K.v0, zeros(size(a.K.v0,1)), Inf, 0) function next(a::cg_hs, s::cg_hs_state) rnormsq = dot(s.r, s.r) p = s.r + (rnormsq/s.rnormsq)*s.p Ap = a.K.A*p α = rnormsq / dot(p, Ap) α*p, cg_hs_state(s.r-α*Ap, p, rnormsq, s.iter+1) end done(a::cg_hs, s::cg_hs_state) = done(a.t, s) ! K = method(KrylovSpace(A, b, k), Terminator()) x += reduce(+, K) # for dx in K; x += dx; end Hestenes-Stiefel CG
  • 54. immutable cg_hs #iterative solver K :: KrylovSpace #wraps A, v0, k t :: Terminator #termination criteria end immutable cg_hs_state r :: Vector #residual p :: Vector #search direction rnormsq :: Float64 #Squared norm of previous residual iter :: Int #iteration count end start(a::cg_hs) = cg_hs_state(a.K.v0, zeros(size(a.K.v0,1)), Inf, 0) function next(a::cg_hs, s::cg_hs_state) rnormsq = dot(s.r, s.r) p = s.r + (rnormsq/s.rnormsq)*s.p Ap = a.K.A*p α = rnormsq / dot(p, Ap) α*p, cg_hs_state(s.r-α*Ap, p, rnormsq, s.iter+1) end done(a::cg_hs, s::cg_hs_state) = done(a.t, s) ! K = method(KrylovSpace(A, b, k), Terminator()) x += reduce(+, K) # for dx in K; x += dx; end Hestenes-Stiefel CG Abstracts out termination check and solution update steps
  • 59. IJulia: Julia in IPython Notebook
  • 60. IJulia: Julia in IPython Notebook
  • 61. JuMP: writing simple DSLs in Julia Iain Dunning Miles Lubin MIT Operations Research
  • 62. Andreas N. Jensen U. Copenhagen Economics Alan EdelmanJeff Bezanson Stefan Karpinski Viral B. Shah Carlo Baldassi Poly. Torino Neuroscience Tim E. Holy WUSTL Anatomy Douglas M. Bates Wisconsin-Madison Statistics Steven G. Johnson MIT Mathematics