Download - An introduction to Julia
![Page 1: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/1.jpg)
A introduction to
Jiahao Chen MIT CSAIL
Alan EdelmanJeff Bezanson Stefan Karpinski Viral B. Shah Andreas Noack Jake Bolewski
![Page 2: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/2.jpg)
720 contributors + package writers
![Page 3: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/3.jpg)
https://github.com/jiahao/ijulia-notebooks
The world of557 packages, 720 authors
345 contributors to julia repo5,239 stargazers436 watchers
![Page 4: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/4.jpg)
What’s the big deal about Julia ?
A high level languagewith C-like speed
julialang.org/benchmarks
![Page 5: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/5.jpg)
What’s the big deal about Julia ?
Normalized average lines of code (shortest = 0, longest = 1)
Execution time (C = 1)
https://groups.google.com/d/msg/julia-users/BYRAeQJuvTw/O7VK7-vp1EEJ
fast and expressive
![Page 6: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/6.jpg)
A simple example
![Page 7: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/7.jpg)
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?
![Page 8: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/8.jpg)
Take home message
Types helps users express scientific computations and helps the compiler specialize code for performance
![Page 9: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/9.jpg)
methods objects
Object-oriented programming with classes
What can I do with/to a thing?
top uppay fare
lose
buyclasses are more fundamental than methods
top uppay fare
lose
buy
pay farelose
buy
![Page 10: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/10.jpg)
OOP with classes 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
![Page 11: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/11.jpg)
Multi-methods for linear algebra
What can I do with/to a thing?
compute spectral factorization
compute singular values
compute singular values and vectors
compute eigenvalues
generic function objectsmethods
Methods can take advantage of special matrix structures
eigvals
eigfact
svdvals
svdfact
Matrix
SymTridiagonal
Bidiagonal
![Page 12: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/12.jpg)
![Page 13: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/13.jpg)
![Page 14: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/14.jpg)
easy to call external C functions, e.g. CLAPACK
sstev, dstev…
![Page 15: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/15.jpg)
So how does this help us with linear algebra?
Multi-method dispatch with generic fallbacks
Matrix operations on general rings textbook algorithm
![Page 16: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/16.jpg)
So how does this help us with linear algebra?
Multi-method dispatch with generic fallbacks
Matrix operations on general rings
![Page 17: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/17.jpg)
Native parallelism constructs
![Page 18: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/18.jpg)
JuMP: a domain specific language
Iain Dunning Miles LubinMIT
Operations Research
![Page 20: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/20.jpg)
![Page 21: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/21.jpg)
In summary,
Types helps users express scientific computations and helps the compiler specialize code for performance
Other advanced features for performance: code generation, native parallel computing, …
try it today! juliabox.org
JuliaCon - June 24-28 at MIT juliacon.org
![Page 22: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/22.jpg)
![Page 23: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/23.jpg)
![Page 24: An introduction to Julia](https://reader033.vdocuments.mx/reader033/viewer/2022052218/55c4a22abb61eb27578b4689/html5/thumbnails/24.jpg)
Pure-‐Julia FFT performance
2 4 8 16 32 64 128
256
512
1024
2048
4096
8192
16384
32768
65536
131072
262144
0
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
11000
12000
13000
14000
spee
d (m
flops
)
intel-mkl-dfti in-placeintel-mkl-dfti out-of-placefftw3 out-of-placefftw3 in-placefftw3-no-simd out-of-placefftw3-no-simd in-placedfftpackemayerjuliabloodworthcrosscwplibesrfft
double-precision complex, 1d transformspowers of two
already comparable to FFTPACK
[ actually was even a bit better; some recent inlining regressions in Julia snapshots ]
Steven Johnson, 2014-06 Presented at NAIS Codegen workshop