diff --git "a/6JcMuFgnA6U.txt" "b/6JcMuFgnA6U.txt" new file mode 100644--- /dev/null +++ "b/6JcMuFgnA6U.txt" @@ -0,0 +1,16139 @@ +align:start position:0% + +the following content is provided under + + align:start position:0% +the following content is provided under + + + align:start position:0% +the following content is provided under +a Creative Commons license your support + + align:start position:0% +a Creative Commons license your support + + + align:start position:0% +a Creative Commons license your support +will help MIT OpenCourseWare continue to + + align:start position:0% +will help MIT OpenCourseWare continue to + + + align:start position:0% +will help MIT OpenCourseWare continue to +offer high quality educational resources + + align:start position:0% +offer high quality educational resources + + + align:start position:0% +offer high quality educational resources +for free + + align:start position:0% +for free + + + align:start position:0% +for free +to make a donation or to view additional + + align:start position:0% +to make a donation or to view additional + + + align:start position:0% +to make a donation or to view additional +materials from hundreds of MIT courses + + align:start position:0% +materials from hundreds of MIT courses + + + align:start position:0% +materials from hundreds of MIT courses +visit MIT opencourseware at ocw.mit.edu + + align:start position:0% + + + + align:start position:0% + +hey everybody let's get going + + align:start position:0% + + + + align:start position:0% + +who here has heard of the FFT that's + + align:start position:0% +who here has heard of the FFT that's + + + align:start position:0% +who here has heard of the FFT that's +most of you + + align:start position:0% +most of you + + + align:start position:0% +most of you +so I first met Steve Johnson when he + + align:start position:0% +so I first met Steve Johnson when he + + + align:start position:0% +so I first met Steve Johnson when he +worked with one of my graduate students + + align:start position:0% +worked with one of my graduate students + + + align:start position:0% +worked with one of my graduate students +now former graduate student Mateo frigo + + align:start position:0% +now former graduate student Mateo frigo + + + align:start position:0% +now former graduate student Mateo frigo +yeah + + align:start position:0% +yeah + + + align:start position:0% +yeah +and they came up with a really + + align:start position:0% +and they came up with a really + + + align:start position:0% +and they came up with a really +spectacular piece of performance + + align:start position:0% +spectacular piece of performance + + + align:start position:0% +spectacular piece of performance +engineering for the FFT a system they + + align:start position:0% +engineering for the FFT a system they + + + align:start position:0% +engineering for the FFT a system they +call fftw for the fastest fourier + + align:start position:0% +call fftw for the fastest fourier + + + align:start position:0% +call fftw for the fastest fourier +transform in the West and it has for + + align:start position:0% +transform in the West and it has for + + + align:start position:0% +transform in the West and it has for +over years and years been you know a + + align:start position:0% +over years and years been you know a + + + align:start position:0% +over years and years been you know a +staple of anybody doing signal + + align:start position:0% +staple of anybody doing signal + + + align:start position:0% +staple of anybody doing signal +processing will know fftw + + align:start position:0% +processing will know fftw + + + align:start position:0% +processing will know fftw +so anyway it's a great pleasure to + + align:start position:0% +so anyway it's a great pleasure to + + + align:start position:0% +so anyway it's a great pleasure to +welcome Steve Johnson who is going to + + align:start position:0% +welcome Steve Johnson who is going to + + + align:start position:0% +welcome Steve Johnson who is going to +talk about some of the work that he's + + align:start position:0% +talk about some of the work that he's + + + align:start position:0% +talk about some of the work that he's +been doing on dynamic languages such as + + align:start position:0% +been doing on dynamic languages such as + + + align:start position:0% +been doing on dynamic languages such as +Giulia and Python so yes I said about + + align:start position:0% +Giulia and Python so yes I said about + + + align:start position:0% +Giulia and Python so yes I said about +high-level dynamic languages and how you + + align:start position:0% +high-level dynamic languages and how you + + + align:start position:0% +high-level dynamic languages and how you +get performance in these and so most of + + align:start position:0% +get performance in these and so most of + + + align:start position:0% +get performance in these and so most of +you probably use Python or our MATLAB + + align:start position:0% +you probably use Python or our MATLAB + + + align:start position:0% +you probably use Python or our MATLAB +and so these are really popular for + + align:start position:0% +and so these are really popular for + + + align:start position:0% +and so these are really popular for +people doing technical computing + + align:start position:0% +people doing technical computing + + + align:start position:0% +people doing technical computing +statistics and anything where you want + + align:start position:0% +statistics and anything where you want + + + align:start position:0% +statistics and anything where you want +kind of interactive exploration you'd + + align:start position:0% +kind of interactive exploration you'd + + + align:start position:0% +kind of interactive exploration you'd +like to have a dynamically typed + + align:start position:0% +like to have a dynamically typed + + + align:start position:0% +like to have a dynamically typed +language where you can just type x + + align:start position:0% +language where you can just type x + + + align:start position:0% +language where you can just type x +equals 3 and then three lines later said + + align:start position:0% +equals 3 and then three lines later said + + + align:start position:0% +equals 3 and then three lines later said +Oh X as an array because you're doing + + align:start position:0% +Oh X as an array because you're doing + + + align:start position:0% +Oh X as an array because you're doing +things interactively don't you don't + + align:start position:0% +things interactively don't you don't + + + align:start position:0% +things interactively don't you don't +have to be stuck with a particular set + + align:start position:0% +have to be stuck with a particular set + + + align:start position:0% +have to be stuck with a particular set +of types and there's a lot of choices + + align:start position:0% +of types and there's a lot of choices + + + align:start position:0% +of types and there's a lot of choices +for these but they usually hit a wall + + align:start position:0% +for these but they usually hit a wall + + + align:start position:0% +for these but they usually hit a wall +when it comes to writing performance + + align:start position:0% +when it comes to writing performance + + + align:start position:0% +when it comes to writing performance +critical code in these languages and so + + align:start position:0% +critical code in these languages and so + + + align:start position:0% +critical code in these languages and so +traditionally people doing some serious + + align:start position:0% +traditionally people doing some serious + + + align:start position:0% +traditionally people doing some serious +computing in these languages have a two + + align:start position:0% +computing in these languages have a two + + + align:start position:0% +computing in these languages have a two +language solution so they so they do + + align:start position:0% +language solution so they so they do + + + align:start position:0% +language solution so they so they do +high-level exploration and pro tippity + + align:start position:0% +high-level exploration and pro tippity + + + align:start position:0% +high-level exploration and pro tippity +and so forth and in Python or whatever + + align:start position:0% +and so forth and in Python or whatever + + + align:start position:0% +and so forth and in Python or whatever +but when they need to write performance + + align:start position:0% +but when they need to write performance + + + align:start position:0% +but when they need to write performance +critical code then you drop down to a + + align:start position:0% +critical code then you drop down to a + + + align:start position:0% +critical code then you drop down to a +lower level language Fortran or C or + + align:start position:0% +lower level language Fortran or C or + + + align:start position:0% +lower level language Fortran or C or +scythe on or one of these things and you + + align:start position:0% +scythe on or one of these things and you + + + align:start position:0% +scythe on or one of these things and you +use Python as the glue for these + + align:start position:0% +use Python as the glue for these + + + align:start position:0% +use Python as the glue for these +low-level kernels and the problem and + + align:start position:0% +low-level kernels and the problem and + + + align:start position:0% +low-level kernels and the problem and +this is this was work workable you know + + align:start position:0% +this is this was work workable you know + + + align:start position:0% +this is this was work workable you know +I've done this myself + + align:start position:0% +I've done this myself + + + align:start position:0% +I've done this myself +many of you probably done this but when + + align:start position:0% +many of you probably done this but when + + + align:start position:0% +many of you probably done this but when +you drop down from Python to see or even + + align:start position:0% +you drop down from Python to see or even + + + align:start position:0% +you drop down from Python to see or even +to scythe on there's a huge + + align:start position:0% +to scythe on there's a huge + + + align:start position:0% +to scythe on there's a huge +discontinuous jump in the complexity of + + align:start position:0% +discontinuous jump in the complexity of + + + align:start position:0% +discontinuous jump in the complexity of +the coding there and there's usually a + + align:start position:0% +the coding there and there's usually a + + + align:start position:0% +the coding there and there's usually a +loss of generality like you you know + + align:start position:0% +loss of generality like you you know + + + align:start position:0% +loss of generality like you you know +when you write code and C or something + + align:start position:0% +when you write code and C or something + + + align:start position:0% +when you write code and C or something +like that it's specific to a very small + + align:start position:0% +like that it's specific to a very small + + + align:start position:0% +like that it's specific to a very small +set of types whereas the nice thing + + align:start position:0% +set of types whereas the nice thing + + + align:start position:0% +set of types whereas the nice thing +about high-level languages is you can + + align:start position:0% +about high-level languages is you can + + + align:start position:0% +about high-level languages is you can +write generic code that works for a lot + + align:start position:0% +write generic code that works for a lot + + + align:start position:0% +write generic code that works for a lot +of different types so at this point + + align:start position:0% +of different types so at this point + + + align:start position:0% +of different types so at this point +there's often someone to pops up and + + align:start position:0% +there's often someone to pops up and + + + align:start position:0% +there's often someone to pops up and +says oh well you know I I knew + + align:start position:0% +says oh well you know I I knew + + + align:start position:0% +says oh well you know I I knew +performance programming in Python and it + + align:start position:0% +performance programming in Python and it + + + align:start position:0% +performance programming in Python and it +everyone knows you just need to + + align:start position:0% +everyone knows you just need to + + + align:start position:0% +everyone knows you just need to +vectorize your code right so basically + + align:start position:0% +vectorize your code right so basically + + + align:start position:0% +vectorize your code right so basically +what they mean is is you you rely on + + align:start position:0% +what they mean is is you you rely on + + + align:start position:0% +what they mean is is you you rely on +mature external libraries that you pass + + align:start position:0% +mature external libraries that you pass + + + align:start position:0% +mature external libraries that you pass +them a big block of data it does a huge + + align:start position:0% +them a big block of data it does a huge + + + align:start position:0% +them a big block of data it does a huge +amount of computation and comes back and + + align:start position:0% +amount of computation and comes back and + + + align:start position:0% +amount of computation and comes back and +so you never write your own loops and + + align:start position:0% +so you never write your own loops and + + + align:start position:0% +so you never write your own loops and +this is great you know this is good + + align:start position:0% +this is great you know this is good + + + align:start position:0% +this is great you know this is good +advice if you have a if there's someone + + align:start position:0% +advice if you have a if there's someone + + + align:start position:0% +advice if you have a if there's someone +who's already written the code that you + + align:start position:0% +who's already written the code that you + + + align:start position:0% +who's already written the code that you +need you know you should try and + + align:start position:0% +need you know you should try and + + + align:start position:0% +need you know you should try and +leverage that as much as possible but + + align:start position:0% +leverage that as much as possible but + + + align:start position:0% +leverage that as much as possible but +somebody has to write those and + + align:start position:0% +somebody has to write those and + + + align:start position:0% +somebody has to write those and +eventually that person will be you and + + align:start position:0% +eventually that person will be you and + + + align:start position:0% +eventually that person will be you and +and because eventually if you do + + align:start position:0% +and because eventually if you do + + + align:start position:0% +and because eventually if you do +scientific computing there's a prop you + + align:start position:0% +scientific computing there's a prop you + + + align:start position:0% +scientific computing there's a prop you +went into a problem inevitably that you + + align:start position:0% +went into a problem inevitably that you + + + align:start position:0% +went into a problem inevitably that you +just can't express in terms of existing + + align:start position:0% +just can't express in terms of existing + + + align:start position:0% +just can't express in terms of existing +libraries very very easily or at all + + align:start position:0% +libraries very very easily or at all + + + align:start position:0% +libraries very very easily or at all +so so this was the state of affairs for + + align:start position:0% +so so this was the state of affairs for + + + align:start position:0% +so so this was the state of affairs for +a long time a few years ago starting in + + align:start position:0% +a long time a few years ago starting in + + + align:start position:0% +a long time a few years ago starting in +Ella needleman's group at MIT there was + + align:start position:0% +Ella needleman's group at MIT there was + + + align:start position:0% +Ella needleman's group at MIT there was +a proposal for a new language called + + align:start position:0% +a proposal for a new language called + + + align:start position:0% +a proposal for a new language called +Giulia which tries to be as high-level + + align:start position:0% +Giulia which tries to be as high-level + + + align:start position:0% +Giulia which tries to be as high-level +and interactive is it's a dynamically + + align:start position:0% +and interactive is it's a dynamically + + + align:start position:0% +and interactive is it's a dynamically +typed language you know as my MATLAB or + + align:start position:0% +typed language you know as my MATLAB or + + + align:start position:0% +typed language you know as my MATLAB or +Python and so forth but you know + + align:start position:0% +Python and so forth but you know + + + align:start position:0% +Python and so forth but you know +general-purpose language like Python + + align:start position:0% +general-purpose language like Python + + + align:start position:0% +general-purpose language like Python +very productive for technical works are + + align:start position:0% +very productive for technical works are + + + align:start position:0% +very productive for technical works are +really oriented towards scientific + + align:start position:0% +really oriented towards scientific + + + align:start position:0% +really oriented towards scientific +numerical computing but you can write a + + align:start position:0% +numerical computing but you can write a + + + align:start position:0% +numerical computing but you can write a +loop and you write low-level code in + + align:start position:0% +loop and you write low-level code in + + + align:start position:0% +loop and you write low-level code in +that that's as fast as C that's that was + + align:start position:0% +that that's as fast as C that's that was + + + align:start position:0% +that that's as fast as C that's that was +the goal the first release was in 2013 + + align:start position:0% +the goal the first release was in 2013 + + + align:start position:0% +the goal the first release was in 2013 +sits pretty not you language the 1.0 + + align:start position:0% +sits pretty not you language the 1.0 + + + align:start position:0% +sits pretty not you language the 1.0 +release was in august of this year so + + align:start position:0% +release was in august of this year so + + + align:start position:0% +release was in august of this year so +before that point every year there was a + + align:start position:0% +before that point every year there was a + + + align:start position:0% +before that point every year there was a +new release point 1 point 2 point 3 and + + align:start position:0% +new release point 1 point 2 point 3 and + + + align:start position:0% +new release point 1 point 2 point 3 and +every year would like break all your old + + align:start position:0% +every year would like break all your old + + + align:start position:0% +every year would like break all your old +old code and you have to update + + align:start position:0% +old code and you have to update + + + align:start position:0% +old code and you have to update +everything to keep it working so now + + align:start position:0% +everything to keep it working so now + + + align:start position:0% +everything to keep it working so now +they said ok it's stable we'll add new + + align:start position:0% +they said ok it's stable we'll add new + + + align:start position:0% +they said ok it's stable we'll add new +features will make it faster but + + align:start position:0% +features will make it faster but + + + align:start position:0% +features will make it faster but +well from this point onwards for at + + align:start position:0% +well from this point onwards for at + + + align:start position:0% +well from this point onwards for at +least until 2.0 of many years in the + + align:start position:0% +least until 2.0 of many years in the + + + align:start position:0% +least until 2.0 of many years in the +future the it'll be backwards compatible + + align:start position:0% +future the it'll be backwards compatible + + + align:start position:0% +future the it'll be backwards compatible +so there's lots of it so in my + + align:start position:0% +so there's lots of it so in my + + + align:start position:0% +so there's lots of it so in my +experience this pretty much holds up I + + align:start position:0% +experience this pretty much holds up I + + + align:start position:0% +experience this pretty much holds up I +haven't found any problem where I could + + align:start position:0% +haven't found any problem where I could + + + align:start position:0% +haven't found any problem where I could +you know where there was a heist nice + + align:start position:0% +you know where there was a heist nice + + + align:start position:0% +you know where there was a heist nice +highly optimized C or Fortran code where + + align:start position:0% +highly optimized C or Fortran code where + + + align:start position:0% +highly optimized C or Fortran code where +I couldn't write equivalent code in or + + align:start position:0% +I couldn't write equivalent code in or + + + align:start position:0% +I couldn't write equivalent code in or +equivalent performance equivalently + + align:start position:0% +equivalent performance equivalently + + + align:start position:0% +equivalent performance equivalently +performing code and Julia you know given + + align:start position:0% +performing code and Julia you know given + + + align:start position:0% +performing code and Julia you know given +enough time right obviously if something + + align:start position:0% +enough time right obviously if something + + + align:start position:0% +enough time right obviously if something +is there's a library with a hundred + + align:start position:0% +is there's a library with a hundred + + + align:start position:0% +is there's a library with a hundred +thousand lines of code you know it's + + align:start position:0% +thousand lines of code you know it's + + + align:start position:0% +thousand lines of code you know it's +quite a long time to rewrite that in any + + align:start position:0% +quite a long time to rewrite that in any + + + align:start position:0% +quite a long time to rewrite that in any +other language so there's lots of + + align:start position:0% +other language so there's lots of + + + align:start position:0% +other language so there's lots of +benchmarks that that illustrate this the + + align:start position:0% +benchmarks that that illustrate this the + + + align:start position:0% +benchmarks that that illustrate this the +goal of Julia is usually to stay within + + align:start position:0% +goal of Julia is usually to stay within + + + align:start position:0% +goal of Julia is usually to stay within +a factor of two of C and my my + + align:start position:0% +a factor of two of C and my my + + + align:start position:0% +a factor of two of C and my my +experience is usually with an effector a + + align:start position:0% +experience is usually with an effector a + + + align:start position:0% +experience is usually with an effector a +few percent that you can get if you know + + align:start position:0% +few percent that you can get if you know + + + align:start position:0% +few percent that you can get if you know +what you're doing so here's a very + + align:start position:0% +what you're doing so here's a very + + + align:start position:0% +what you're doing so here's a very +simple example that I like to use it it + + align:start position:0% +simple example that I like to use it it + + + align:start position:0% +simple example that I like to use it it +is generating a vandermonde matrix so + + align:start position:0% +is generating a vandermonde matrix so + + + align:start position:0% +is generating a vandermonde matrix so +given a vector of values alpha 1 alpha 2 + + align:start position:0% +given a vector of values alpha 1 alpha 2 + + + align:start position:0% +given a vector of values alpha 1 alpha 2 +alpha alpha m and you want to make an M + + align:start position:0% +alpha alpha m and you want to make an M + + + align:start position:0% +alpha alpha m and you want to make an M +by n matrix whose columns are just those + + align:start position:0% +by n matrix whose columns are just those + + + align:start position:0% +by n matrix whose columns are just those +entries to you know due to the power + + align:start position:0% +entries to you know due to the power + + + align:start position:0% +entries to you know due to the power +first power squared cubed and so forth + + align:start position:0% +first power squared cubed and so forth + + + align:start position:0% +first power squared cubed and so forth +element wise I said this this this kind + + align:start position:0% +element wise I said this this this kind + + + align:start position:0% +element wise I said this this this kind +of matrix shows up at a lot of problems + + align:start position:0% +of matrix shows up at a lot of problems + + + align:start position:0% +of matrix shows up at a lot of problems +so most you know matrix and vector + + align:start position:0% +so most you know matrix and vector + + + align:start position:0% +so most you know matrix and vector +libraries have a built-in function to do + + align:start position:0% +libraries have a built-in function to do + + + align:start position:0% +libraries have a built-in function to do +this on Python in numpy there is a + + align:start position:0% +this on Python in numpy there is a + + + align:start position:0% +this on Python in numpy there is a +function called num pi dot Vander to do + + align:start position:0% +function called num pi dot Vander to do + + + align:start position:0% +function called num pi dot Vander to do +this and if you look at the it's + + align:start position:0% +this and if you look at the it's + + + align:start position:0% +this and if you look at the it's +generating a big matrix it could be + + align:start position:0% +generating a big matrix it could be + + + align:start position:0% +generating a big matrix it could be +performance critical so they can't + + align:start position:0% +performance critical so they can't + + + align:start position:0% +performance critical so they can't +implement it in Python so if you look at + + align:start position:0% +implement it in Python so if you look at + + + align:start position:0% +implement it in Python so if you look at +the numpad limitation it's a little + + align:start position:0% +the numpad limitation it's a little + + + align:start position:0% +the numpad limitation it's a little +python shim that calls immediately to + + align:start position:0% +python shim that calls immediately to + + + align:start position:0% +python shim that calls immediately to +see and then if you look at the C code I + + align:start position:0% +see and then if you look at the C code I + + + align:start position:0% +see and then if you look at the C code I +won't scroll through it but several + + align:start position:0% +won't scroll through it but several + + + align:start position:0% +won't scroll through it but several +hundred lines of code it's quite long + + align:start position:0% +hundred lines of code it's quite long + + + align:start position:0% +hundred lines of code it's quite long +and complicated and all about 100 + + align:start position:0% +and complicated and all about 100 + + + align:start position:0% +and complicated and all about 100 +several hundred lines of code is doing + + align:start position:0% +several hundred lines of code is doing + + + align:start position:0% +several hundred lines of code is doing +is just figuring out what types and to + + align:start position:0% +is just figuring out what types and to + + + align:start position:0% +is just figuring out what types and to +work with but like what kernels to + + align:start position:0% +work with but like what kernels to + + + align:start position:0% +work with but like what kernels to +dispatch to at the end of that it + + align:start position:0% +dispatch to at the end of that it + + + align:start position:0% +dispatch to at the end of that it +dispatches to a kernel that does the + + align:start position:0% +dispatches to a kernel that does the + + + align:start position:0% +dispatches to a kernel that does the +actual work and that kernel is also C + + align:start position:0% +actual work and that kernel is also C + + + align:start position:0% +actual work and that kernel is also C +code but that that C code was generated + + align:start position:0% +code but that that C code was generated + + + align:start position:0% +code but that that C code was generated +by a special purpose code generation so + + align:start position:0% +by a special purpose code generation so + + + align:start position:0% +by a special purpose code generation so +it's quite you know involved to get to + + align:start position:0% +it's quite you know involved to get to + + + align:start position:0% +it's quite you know involved to get to +to get good performance for this while + + align:start position:0% +to get good performance for this while + + + align:start position:0% +to get good performance for this while +still being somewhat type generic so + + align:start position:0% +still being somewhat type generic so + + + align:start position:0% +still being somewhat type generic so +that their goal was to have something + + align:start position:0% +that their goal was to have something + + + align:start position:0% +that their goal was to have something +that works for basically any numpy array + + align:start position:0% +that works for basically any numpy array + + + align:start position:0% +that works for basically any numpy array +and any numpy type which is like there's + + align:start position:0% +and any numpy type which is like there's + + + align:start position:0% +and any numpy type which is like there's +a handful like maybe a dozen scalar + + align:start position:0% +a handful like maybe a dozen scalar + + + align:start position:0% +a handful like maybe a dozen scalar +types that it should work with right so + + align:start position:0% +types that it should work with right so + + + align:start position:0% +types that it should work with right so +if you're implementing this in C it's + + align:start position:0% +if you're implementing this in C it's + + + align:start position:0% +if you're implementing this in C it's +really trivial to write you know 20 + + align:start position:0% +really trivial to write you know 20 + + + align:start position:0% +really trivial to write you know 20 +lines of code that implements this but + + align:start position:0% +lines of code that implements this but + + + align:start position:0% +lines of code that implements this but +only for double precision you know a + + align:start position:0% +only for double precision you know a + + + align:start position:0% +only for double precision you know a +pointer to double position array I know + + align:start position:0% +pointer to double position array I know + + + align:start position:0% +pointer to double position array I know +so the difficulty is getting typed into + + align:start position:0% +so the difficulty is getting typed into + + + align:start position:0% +so the difficulty is getting typed into +generic in C so in in Julia here's the + + align:start position:0% +generic in C so in in Julia here's the + + + align:start position:0% +generic in C so in in Julia here's the +implementation in Julia it looks at + + align:start position:0% +implementation in Julia it looks at + + + align:start position:0% +implementation in Julia it looks at +first glance much like what us roughly + + align:start position:0% +first glance much like what us roughly + + + align:start position:0% +first glance much like what us roughly +about like a C or Fortran implementation + + align:start position:0% +about like a C or Fortran implementation + + + align:start position:0% +about like a C or Fortran implementation +would look like it's just I just + + align:start position:0% +would look like it's just I just + + + align:start position:0% +would look like it's just I just +implement in the most simple way it's + + align:start position:0% +implement in the most simple way it's + + + align:start position:0% +implement in the most simple way it's +just two nested loops I suggest just for + + align:start position:0% +just two nested loops I suggest just for + + + align:start position:0% +just two nested loops I suggest just for +it from basically you loop across and as + + align:start position:0% +it from basically you loop across and as + + + align:start position:0% +it from basically you loop across and as +you go across you know you accumulate + + align:start position:0% +you go across you know you accumulate + + + align:start position:0% +you go across you know you accumulate +powers by multiplying repeatedly by + + align:start position:0% +powers by multiplying repeatedly by + + + align:start position:0% +powers by multiplying repeatedly by +Vioxx right that's that's all it is and + + align:start position:0% +Vioxx right that's that's all it is and + + + align:start position:0% +Vioxx right that's that's all it is and +it just fills in the array the + + align:start position:0% +it just fills in the array the + + + align:start position:0% +it just fills in the array the +performance of the graph here is the + + align:start position:0% +performance of the graph here is the + + + align:start position:0% +performance of the graph here is the +time for the numpy implementation + + align:start position:0% +time for the numpy implementation + + + align:start position:0% +time for the numpy implementation +divided by the time for the julie + + align:start position:0% +divided by the time for the julie + + + align:start position:0% +divided by the time for the julie +implementation as a function of n for an + + align:start position:0% +implementation as a function of n for an + + + align:start position:0% +implementation as a function of n for an +N by n matrix the first data point I + + align:start position:0% +N by n matrix the first data point I + + + align:start position:0% +N by n matrix the first data point I +think that's there's something funny + + align:start position:0% +think that's there's something funny + + + align:start position:0% +think that's there's something funny +going on it's not ten thousand times + + align:start position:0% +going on it's not ten thousand times + + + align:start position:0% +going on it's not ten thousand times +slower but you know for fur like a ten + + align:start position:0% +slower but you know for fur like a ten + + + align:start position:0% +slower but you know for fur like a ten +by ten twenty five twenty array the non + + align:start position:0% +by ten twenty five twenty array the non + + + align:start position:0% +by ten twenty five twenty array the non +pipe version is actually ten times + + align:start position:0% +pipe version is actually ten times + + + align:start position:0% +pipe version is actually ten times +slower because it's basically the + + align:start position:0% +slower because it's basically the + + + align:start position:0% +slower because it's basically the +overhead that's imposed by all going + + align:start position:0% +overhead that's imposed by all going + + + align:start position:0% +overhead that's imposed by all going +through all those layers once you get to + + align:start position:0% +through all those layers once you get to + + + align:start position:0% +through all those layers once you get to +like 100 hundred matrix that overhead + + align:start position:0% +like 100 hundred matrix that overhead + + + align:start position:0% +like 100 hundred matrix that overhead +doesn't matter and then it's all this + + align:start position:0% +doesn't matter and then it's all this + + + align:start position:0% +doesn't matter and then it's all this +optimized C code code generated hundred + + align:start position:0% +optimized C code code generated hundred + + + align:start position:0% +optimized C code code generated hundred +code generation and so forth it's pretty + + align:start position:0% +code generation and so forth it's pretty + + + align:start position:0% +code generation and so forth it's pretty +much the same speed as the juliek code + + align:start position:0% +much the same speed as the juliek code + + + align:start position:0% +much the same speed as the juliek code +except the Juliet code there as I said + + align:start position:0% +except the Juliet code there as I said + + + align:start position:0% +except the Juliet code there as I said +it looks much like C code would except + + align:start position:0% +it looks much like C code would except + + + align:start position:0% +it looks much like C code would except +there's no types its Vandor X there's no + + align:start position:0% +there's no types its Vandor X there's no + + + align:start position:0% +there's no types its Vandor X there's no +type declaration that X can be anything + + align:start position:0% +type declaration that X can be anything + + + align:start position:0% +type declaration that X can be anything +and if it's in fact this works with any + + align:start position:0% +and if it's in fact this works with any + + + align:start position:0% +and if it's in fact this works with any +container type as long as it has an + + align:start position:0% +container type as long as it has an + + + align:start position:0% +container type as long as it has an +indexing operation and any numeric type + + align:start position:0% +indexing operation and any numeric type + + + align:start position:0% +indexing operation and any numeric type +could be real numbers could be complex + + align:start position:0% +could be real numbers could be complex + + + align:start position:0% +could be real numbers could be complex +numbers could be quaternions anything + + align:start position:0% +numbers could be quaternions anything + + + align:start position:0% +numbers could be quaternions anything +that supports the x operation and + + align:start position:0% +that supports the x operation and + + + align:start position:0% +that supports the x operation and +there's also a call to one so one + + align:start position:0% +there's also a call to one so one + + + align:start position:0% +there's also a call to one so one +returns the multiplicative identity for + + align:start position:0% +returns the multiplicative identity for + + + align:start position:0% +returns the multiplicative identity for +whatever so whatever group you're in you + + align:start position:0% +whatever so whatever group you're in you + + + align:start position:0% +whatever so whatever group you're in you +need to have a one alright that's the + + align:start position:0% +need to have a one alright that's the + + + align:start position:0% +need to have a one alright that's the +first column and that might be a + + align:start position:0% +first column and that might be a + + + align:start position:0% +first column and that might be a +different type of one for for a + + align:start position:0% +different type of one for for a + + + align:start position:0% +different type of one for for a +different object right might be an array + + align:start position:0% +different object right might be an array + + + align:start position:0% +different object right might be an array +of matrices for example and then one is + + align:start position:0% +of matrices for example and then one is + + + align:start position:0% +of matrices for example and then one is +the identity matrix + + align:start position:0% +the identity matrix + + + align:start position:0% +the identity matrix +so in fact there are even cases where + + align:start position:0% +so in fact there are even cases where + + + align:start position:0% +so in fact there are even cases where +you can do get significantly faster and + + align:start position:0% +you can do get significantly faster and + + + align:start position:0% +you can do get significantly faster and +then then it's optimized seen Fortran + + align:start position:0% +then then it's optimized seen Fortran + + + align:start position:0% +then then it's optimized seen Fortran +code so I found this when I was + + align:start position:0% +code so I found this when I was + + + align:start position:0% +code so I found this when I was +implementing special functions so things + + align:start position:0% +implementing special functions so things + + + align:start position:0% +implementing special functions so things +like the error function or polygamous + + align:start position:0% +like the error function or polygamous + + + align:start position:0% +like the error function or polygamous +unction or the inverse the error + + align:start position:0% +unction or the inverse the error + + + align:start position:0% +unction or the inverse the error +function I've consistently found that I + + align:start position:0% +function I've consistently found that I + + + align:start position:0% +function I've consistently found that I +can get often two to three times faster + + align:start position:0% +can get often two to three times faster + + + align:start position:0% +can get often two to three times faster +than then like optimize C and Fortran + + align:start position:0% +than then like optimize C and Fortran + + + align:start position:0% +than then like optimize C and Fortran +libraries out there partly because I'm + + align:start position:0% +libraries out there partly because I'm + + + align:start position:0% +libraries out there partly because I'm +just smarter than the people who wrote + + align:start position:0% +just smarter than the people who wrote + + + align:start position:0% +just smarter than the people who wrote +those libraries but no mainly because in + + align:start position:0% +those libraries but no mainly because in + + + align:start position:0% +those libraries but no mainly because in +in julia i'm using basically the same + + align:start position:0% +in julia i'm using basically the same + + + align:start position:0% +in julia i'm using basically the same +expansions the same series rational + + align:start position:0% +expansions the same series rational + + + align:start position:0% +expansions the same series rational +functions that everyone else is using + + align:start position:0% +functions that everyone else is using + + + align:start position:0% +functions that everyone else is using +the difference is that in julia has + + align:start position:0% +the difference is that in julia has + + + align:start position:0% +the difference is that in julia has +built-in techniques for what's called + + align:start position:0% +built-in techniques for what's called + + + align:start position:0% +built-in techniques for what's called +meta programming or cogeneration so in + + align:start position:0% +meta programming or cogeneration so in + + + align:start position:0% +meta programming or cogeneration so in +usually the special functions involve + + align:start position:0% +usually the special functions involve + + + align:start position:0% +usually the special functions involve +lots of polynomial evaluations that's + + align:start position:0% +lots of polynomial evaluations that's + + + align:start position:0% +lots of polynomial evaluations that's +the way they boil down to and you can + + align:start position:0% +the way they boil down to and you can + + + align:start position:0% +the way they boil down to and you can +basically write cogeneration that + + align:start position:0% +basically write cogeneration that + + + align:start position:0% +basically write cogeneration that +generates very optimized in-line + + align:start position:0% +generates very optimized in-line + + + align:start position:0% +generates very optimized in-line +valuation of the specific polynomials + + align:start position:0% +valuation of the specific polynomials + + + align:start position:0% +valuation of the specific polynomials +for these functions that would be really + + align:start position:0% +for these functions that would be really + + + align:start position:0% +for these functions that would be really +awkward to write in Fortran you do that + + align:start position:0% +awkward to write in Fortran you do that + + + align:start position:0% +awkward to write in Fortran you do that +to write it all by hand or write like a + + align:start position:0% +to write it all by hand or write like a + + + align:start position:0% +to write it all by hand or write like a +separate routine separate program that + + align:start position:0% +separate routine separate program that + + + align:start position:0% +separate routine separate program that +wrote Fortran code for you so you can do + + align:start position:0% +wrote Fortran code for you so you can do + + + align:start position:0% +wrote Fortran code for you so you can do +this it's a high level languages allow + + align:start position:0% +this it's a high level languages allow + + + align:start position:0% +this it's a high level languages allow +you to do tricks for performance that it + + align:start position:0% +you to do tricks for performance that it + + + align:start position:0% +you to do tricks for performance that it +would be really hard to do in low level + + align:start position:0% +would be really hard to do in low level + + + align:start position:0% +would be really hard to do in low level +languages so mainly what I want to talk + + align:start position:0% +languages so mainly what I want to talk + + + align:start position:0% +languages so mainly what I want to talk +about it's give some idea of why Julia + + align:start position:0% +about it's give some idea of why Julia + + + align:start position:0% +about it's give some idea of why Julia +can be fast and to understand this you + + align:start position:0% +can be fast and to understand this you + + + align:start position:0% +can be fast and to understand this you +also need to understand why is is Python + + align:start position:0% +also need to understand why is is Python + + + align:start position:0% +also need to understand why is is Python +slow and and in general what's going on + + align:start position:0% +slow and and in general what's going on + + + align:start position:0% +slow and and in general what's going on +in determining the performance in a + + align:start position:0% +in determining the performance in a + + + align:start position:0% +in determining the performance in a +language like this what do you need in a + + align:start position:0% +language like this what do you need in a + + + align:start position:0% +language like this what do you need in a +language to enable you to compile it to + + align:start position:0% +language to enable you to compile it to + + + align:start position:0% +language to enable you to compile it to +fast code it while still still being + + align:start position:0% +fast code it while still still being + + + align:start position:0% +fast code it while still still being +completely generic like like this this + + align:start position:0% +completely generic like like this this + + + align:start position:0% +completely generic like like this this +van der function which works on any any + + align:start position:0% +van der function which works on any any + + + align:start position:0% +van der function which works on any any +type any user even user-defined in + + align:start position:0% +type any user even user-defined in + + + align:start position:0% +type any user even user-defined in +numeric type user-defined container type + + align:start position:0% +numeric type user-defined container type + + + align:start position:0% +numeric type user-defined container type +will be just as fast as there's no + + align:start position:0% +will be just as fast as there's no + + + align:start position:0% +will be just as fast as there's no +privileged in fact if you look at julia + + align:start position:0% +privileged in fact if you look at julia + + + align:start position:0% +privileged in fact if you look at julia +almost all of duo's Julia's implemented + + align:start position:0% +almost all of duo's Julia's implemented + + + align:start position:0% +almost all of duo's Julia's implemented +in julia like integer operations and + + align:start position:0% +in julia like integer operations and + + + align:start position:0% +in julia like integer operations and +things like the really basic types most + + align:start position:0% +things like the really basic types most + + + align:start position:0% +things like the really basic types most +of that is implemented in julia right + + align:start position:0% +of that is implemented in julia right + + + align:start position:0% +of that is implemented in julia right +obviously it if you're multiplying two + + align:start position:0% +obviously it if you're multiplying two + + + align:start position:0% +obviously it if you're multiplying two +32-bit integers at some point it's + + align:start position:0% +32-bit integers at some point it's + + + align:start position:0% +32-bit integers at some point it's +calling a assembly language instruction + + align:start position:0% +calling a assembly language instruction + + + align:start position:0% +calling a assembly language instruction +but but even not calling out to this + + align:start position:0% +but but even not calling out to this + + + align:start position:0% +but but even not calling out to this +assembly is actually in julia so + + align:start position:0% +assembly is actually in julia so + + + align:start position:0% +assembly is actually in julia so +so at this point I want to switch over + + align:start position:0% +so at this point I want to switch over + + + align:start position:0% +so at this point I want to switch over +to sort of a live calculation so this is + + align:start position:0% +to sort of a live calculation so this is + + + align:start position:0% +to sort of a live calculation so this is +from a notebook that I developed as part + + align:start position:0% +from a notebook that I developed as part + + + align:start position:0% +from a notebook that I developed as part +of a short course with Alan Adelman is + + align:start position:0% +of a short course with Alan Adelman is + + + align:start position:0% +of a short course with Alan Adelman is +sitting over there like you know 9 6 on + + align:start position:0% +sitting over there like you know 9 6 on + + + align:start position:0% +sitting over there like you know 9 6 on +performance optimization high level + + align:start position:0% +performance optimization high level + + + align:start position:0% +performance optimization high level +languages and so I'm gonna go through + + align:start position:0% +languages and so I'm gonna go through + + + align:start position:0% +languages and so I'm gonna go through +this is a very simple calculation of + + align:start position:0% +this is a very simple calculation of + + + align:start position:0% +this is a very simple calculation of +course you would never I mean in any + + align:start position:0% +course you would never I mean in any + + + align:start position:0% +course you would never I mean in any +language usually you would have a built + + align:start position:0% +language usually you would have a built + + + align:start position:0% +language usually you would have a built +often have a built in function for this + + align:start position:0% +often have a built in function for this + + + align:start position:0% +often have a built in function for this +but it's just a son function it's just + + align:start position:0% +but it's just a son function it's just + + + align:start position:0% +but it's just a son function it's just +written written up there so we need to + + align:start position:0% +written written up there so we need to + + + align:start position:0% +written written up there so we need to +know about we just have a list an array + + align:start position:0% +know about we just have a list an array + + + align:start position:0% +know about we just have a list an array +of n numbers we're just gonna add them + + align:start position:0% +of n numbers we're just gonna add them + + + align:start position:0% +of n numbers we're just gonna add them +up right and if we can't make this fast + + align:start position:0% +up right and if we can't make this fast + + + align:start position:0% +up right and if we can't make this fast +right then then we have real problems + + align:start position:0% +right then then we have real problems + + + align:start position:0% +right then then we have real problems +and you know we're not gonna be able to + + align:start position:0% +and you know we're not gonna be able to + + + align:start position:0% +and you know we're not gonna be able to +do anything in this list so so this is + + align:start position:0% +do anything in this list so so this is + + + align:start position:0% +do anything in this list so so this is +the simple sort of thing where if + + align:start position:0% +the simple sort of thing where if + + + align:start position:0% +the simple sort of thing where if +someone didn't doesn't provide this for + + align:start position:0% +someone didn't doesn't provide this for + + + align:start position:0% +someone didn't doesn't provide this for +you you're gonna have to write a loop to + + align:start position:0% +you you're gonna have to write a loop to + + + align:start position:0% +you you're gonna have to write a loop to +do this so I'm gonna look at it not just + + align:start position:0% +do this so I'm gonna look at it not just + + + align:start position:0% +do this so I'm gonna look at it not just +in Julia but also in Python in C and set + + align:start position:0% +in Julia but also in Python in C and set + + + align:start position:0% +in Julia but also in Python in C and set +some set some in Python with numpy and + + align:start position:0% +some set some in Python with numpy and + + + align:start position:0% +some set some in Python with numpy and +so forth so this document that I'm + + align:start position:0% +so forth so this document that I'm + + + align:start position:0% +so forth so this document that I'm +showing you here is is a Jupiter + + align:start position:0% +showing you here is is a Jupiter + + + align:start position:0% +showing you here is is a Jupiter +notebook some of you may have seen this + + align:start position:0% +notebook some of you may have seen this + + + align:start position:0% +notebook some of you may have seen this +kind of thing so Jupiter is this really + + align:start position:0% +kind of thing so Jupiter is this really + + + align:start position:0% +kind of thing so Jupiter is this really +nice they provide this really nice + + align:start position:0% +nice they provide this really nice + + + align:start position:0% +nice they provide this really nice +browser-based front-end where I can put + + align:start position:0% +browser-based front-end where I can put + + + align:start position:0% +browser-based front-end where I can put +in equations and text and code and + + align:start position:0% +in equations and text and code and + + + align:start position:0% +in equations and text and code and +results and graphs all in like one set + + align:start position:0% +results and graphs all in like one set + + + align:start position:0% +results and graphs all in like one set +of Mathematica notebook like document + + align:start position:0% +of Mathematica notebook like document + + + align:start position:0% +of Mathematica notebook like document +and they can plug in different languages + + align:start position:0% +and they can plug in different languages + + + align:start position:0% +and they can plug in different languages +so initially was for Python but we + + align:start position:0% +so initially was for Python but we + + + align:start position:0% +so initially was for Python but we +plugged in julia and now there's our and + + align:start position:0% +plugged in julia and now there's our and + + + align:start position:0% +plugged in julia and now there's our and +there's 30 different undred different + + align:start position:0% +there's 30 different undred different + + + align:start position:0% +there's 30 different undred different +languages that you can plug in to the + + align:start position:0% +languages that you can plug in to the + + + align:start position:0% +languages that you can plug in to the +same front end okay so I'll start with + + align:start position:0% +same front end okay so I'll start with + + + align:start position:0% +same front end okay so I'll start with +the C implementation of this so this is + + align:start position:0% +the C implementation of this so this is + + + align:start position:0% +the C implementation of this so this is +a Julia notebook but I can easily + + align:start position:0% +a Julia notebook but I can easily + + + align:start position:0% +a Julia notebook but I can easily +compile and call it to see so I just + + align:start position:0% +compile and call it to see so I just + + + align:start position:0% +compile and call it to see so I just +made a string that has just you know + + align:start position:0% +made a string that has just you know + + + align:start position:0% +made a string that has just you know +there's a ten line C implementation it's + + align:start position:0% +there's a ten line C implementation it's + + + align:start position:0% +there's a ten line C implementation it's +just the most obvious function that just + + align:start position:0% +just the most obvious function that just + + + align:start position:0% +just the most obvious function that just +takes in a pointer to an array of + + align:start position:0% +takes in a pointer to an array of + + + align:start position:0% +takes in a pointer to an array of +doubles and its length and it just loops + + align:start position:0% +doubles and its length and it just loops + + + align:start position:0% +doubles and its length and it just loops +over them and sums them up might just + + align:start position:0% +over them and sums them up might just + + + align:start position:0% +over them and sums them up might just +wait what you would what you would do + + align:start position:0% +wait what you would what you would do + + + align:start position:0% +wait what you would what you would do +and then I'll call I'll compile it with + + align:start position:0% +and then I'll call I'll compile it with + + + align:start position:0% +and then I'll call I'll compile it with +GCC - o3 and link it to a shared library + + align:start position:0% +GCC - o3 and link it to a shared library + + + align:start position:0% +GCC - o3 and link it to a shared library +and load that shared library and Julia + + align:start position:0% +and load that shared library and Julia + + + align:start position:0% +and load that shared library and Julia +and just call it so there's a function + + align:start position:0% +and just call it so there's a function + + + align:start position:0% +and just call it so there's a function +called + + align:start position:0% +called + + + align:start position:0% +called +in Julia where I can just call out to a + + align:start position:0% +in Julia where I can just call out to a + + + align:start position:0% +in Julia where I can just call out to a +sea library with zero zero overhead + + align:start position:0% +sea library with zero zero overhead + + + align:start position:0% +sea library with zero zero overhead +basically so which is nice because you + + align:start position:0% +basically so which is nice because you + + + align:start position:0% +basically so which is nice because you +have lots of existing sea libraries out + + align:start position:0% +have lots of existing sea libraries out + + + align:start position:0% +have lots of existing sea libraries out +there you don't want to lose them so I + + align:start position:0% +there you don't want to lose them so I + + + align:start position:0% +there you don't want to lose them so I +just say seek call I recall this see + + align:start position:0% +just say seek call I recall this see + + + align:start position:0% +just say seek call I recall this see +some function in my library it returns a + + align:start position:0% +some function in my library it returns a + + + align:start position:0% +some function in my library it returns a +float 64 it takes two to two parameters + + align:start position:0% +float 64 it takes two to two parameters + + + align:start position:0% +float 64 it takes two to two parameters +a size T to float 64 and I'm going to + + align:start position:0% +a size T to float 64 and I'm going to + + + align:start position:0% +a size T to float 64 and I'm going to +pass the length of my array and the + + align:start position:0% +pass the length of my array and the + + + align:start position:0% +pass the length of my array and the +array and it will automatically a julia + + align:start position:0% +array and it will automatically a julia + + + align:start position:0% +array and it will automatically a julia +array of course it is just a bunch of + + align:start position:0% +array of course it is just a bunch of + + + align:start position:0% +array of course it is just a bunch of +numbers and it'll pass a pointer to that + + align:start position:0% +numbers and it'll pass a pointer to that + + + align:start position:0% +numbers and it'll pass a pointer to that +under the hood so do that and write a + + align:start position:0% +under the hood so do that and write a + + + align:start position:0% +under the hood so do that and write a +little function to call rail rail air + + align:start position:0% +little function to call rail rail air + + + align:start position:0% +little function to call rail rail air +that computes the relative error between + + align:start position:0% +that computes the relative error between + + + align:start position:0% +that computes the relative error between +the fractional difference between x and + + align:start position:0% +the fractional difference between x and + + + align:start position:0% +the fractional difference between x and +y and I'll just check it I'll just + + align:start position:0% +y and I'll just check it I'll just + + + align:start position:0% +y and I'll just check it I'll just +generate ten to the seventh random + + align:start position:0% +generate ten to the seventh random + + + align:start position:0% +generate ten to the seventh random +numbers and zero one and compare that to + + align:start position:0% +numbers and zero one and compare that to + + + align:start position:0% +numbers and zero one and compare that to +the Julia because julie has a built-in + + align:start position:0% +the Julia because julie has a built-in + + + align:start position:0% +the Julia because julie has a built-in +function called sum that sums an array + + align:start position:0% +function called sum that sums an array + + + align:start position:0% +function called sum that sums an array +and it's giving the same answer to + + align:start position:0% +and it's giving the same answer to + + + align:start position:0% +and it's giving the same answer to +thirteen dot some places that you know + + align:start position:0% +thirteen dot some places that you know + + + align:start position:0% +thirteen dot some places that you know +so not quite machine precision but + + align:start position:0% +so not quite machine precision but + + + align:start position:0% +so not quite machine precision but +there's ten of the seven numbers of the + + align:start position:0% +there's ten of the seven numbers of the + + + align:start position:0% +there's ten of the seven numbers of the +errors kind of accumulated when you add + + align:start position:0% +errors kind of accumulated when you add + + + align:start position:0% +errors kind of accumulated when you add +it across okay so it's I'm calling it + + align:start position:0% +it across okay so it's I'm calling it + + + align:start position:0% +it across okay so it's I'm calling it +it's giving the right answer and now I + + align:start position:0% +it's giving the right answer and now I + + + align:start position:0% +it's giving the right answer and now I +want to just benchmark this + + align:start position:0% +want to just benchmark this + + + align:start position:0% +want to just benchmark this +implementation use that as kind of a + + align:start position:0% +implementation use that as kind of a + + + align:start position:0% +implementation use that as kind of a +baseline for this this is the this + + align:start position:0% +baseline for this this is the this + + + align:start position:0% +baseline for this this is the this +should be pretty fast for an array of + + align:start position:0% +should be pretty fast for an array of + + + align:start position:0% +should be pretty fast for an array of +floating point values so there's a Julia + + align:start position:0% +floating point values so there's a Julia + + + align:start position:0% +floating point values so there's a Julia +package called benchmark tools as you + + align:start position:0% +package called benchmark tools as you + + + align:start position:0% +package called benchmark tools as you +probably know from this class + + align:start position:0% +probably know from this class + + + align:start position:0% +probably know from this class +benchmarking is a little bit tricky so + + align:start position:0% +benchmarking is a little bit tricky so + + + align:start position:0% +benchmarking is a little bit tricky so +this this will take something run it + + align:start position:0% +this this will take something run it + + + align:start position:0% +this this will take something run it +lots of times + + align:start position:0% +lots of times + + + align:start position:0% +lots of times +collect some statistics return the + + align:start position:0% +collect some statistics return the + + + align:start position:0% +collect some statistics return the +minimum Tyne or you can also get the + + align:start position:0% +minimum Tyne or you can also get the + + + align:start position:0% +minimum Tyne or you can also get the +variance and other other things so so + + align:start position:0% +variance and other other things so so + + + align:start position:0% +variance and other other things so so +I'm gonna get the number be time is + + align:start position:0% +I'm gonna get the number be time is + + + align:start position:0% +I'm gonna get the number be time is +something called a macro and Julia so it + + align:start position:0% +something called a macro and Julia so it + + + align:start position:0% +something called a macro and Julia so it +takes takes an expression rewrites it + + align:start position:0% +takes takes an expression rewrites it + + + align:start position:0% +takes takes an expression rewrites it +into something that basically has a loop + + align:start position:0% +into something that basically has a loop + + + align:start position:0% +into something that basically has a loop +and times it and does all that stuff + + align:start position:0% +and times it and does all that stuff + + + align:start position:0% +and times it and does all that stuff +okay + + align:start position:0% +okay + + + align:start position:0% +okay +so it takes eleven milliseconds to some + + align:start position:0% +so it takes eleven milliseconds to some + + + align:start position:0% +so it takes eleven milliseconds to some +ten to the seventh numbers rooster with + + align:start position:0% +ten to the seventh numbers rooster with + + + align:start position:0% +ten to the seventh numbers rooster with +this straight seedless e loop compiled + + align:start position:0% +this straight seedless e loop compiled + + + align:start position:0% +this straight seedless e loop compiled +with GCC - oh three you know no special + + align:start position:0% +with GCC - oh three you know no special + + + align:start position:0% +with GCC - oh three you know no special +tricks okay and so that's you know so + + align:start position:0% +tricks okay and so that's you know so + + + align:start position:0% +tricks okay and so that's you know so +that's one gigaflop basically billion + + align:start position:0% +that's one gigaflop basically billion + + + align:start position:0% +that's one gigaflop basically billion +operations per second so it's not + + align:start position:0% +operations per second so it's not + + + align:start position:0% +operations per second so it's not +hitting my the the peak rate of the CPU + + align:start position:0% +hitting my the the peak rate of the CPU + + + align:start position:0% +hitting my the the peak rate of the CPU +but of course this this you know there's + + align:start position:0% +but of course this this you know there's + + + align:start position:0% +but of course this this you know there's +additional calculations this this + + align:start position:0% +additional calculations this this + + + align:start position:0% +additional calculations this this +doesn't + + align:start position:0% +doesn't + + + align:start position:0% +doesn't +this way doesn't fit in cash and so + + align:start position:0% +this way doesn't fit in cash and so + + + align:start position:0% +this way doesn't fit in cash and so +forth okay so now let's before I do + + align:start position:0% +forth okay so now let's before I do + + + align:start position:0% +forth okay so now let's before I do +anything Julie let's do some Python but + + align:start position:0% +anything Julie let's do some Python but + + + align:start position:0% +anything Julie let's do some Python but +I'll do a trick I can call Python from + + align:start position:0% +I'll do a trick I can call Python from + + + align:start position:0% +I'll do a trick I can call Python from +Julia so that way I can just do all + + align:start position:0% +Julia so that way I can just do all + + + align:start position:0% +Julia so that way I can just do all +everything from one notebook using a + + align:start position:0% +everything from one notebook using a + + + align:start position:0% +everything from one notebook using a +package call I wrote called pike haul + + align:start position:0% +package call I wrote called pike haul + + + align:start position:0% +package call I wrote called pike haul +and pike call just calls directly out to + + align:start position:0% +and pike call just calls directly out to + + + align:start position:0% +and pike call just calls directly out to +lib Python + + align:start position:0% +lib Python + + + align:start position:0% +lib Python +so with myth you know no it virtually no + + align:start position:0% +so with myth you know no it virtually no + + + align:start position:0% +so with myth you know no it virtually no +overheads it's just like calling Python + + align:start position:0% +overheads it's just like calling Python + + + align:start position:0% +overheads it's just like calling Python +from within Python I'm calling directly + + align:start position:0% +from within Python I'm calling directly + + + align:start position:0% +from within Python I'm calling directly +after the to lib Python functions to + + align:start position:0% +after the to lib Python functions to + + + align:start position:0% +after the to lib Python functions to +call I can and I can pass any type I + + align:start position:0% +call I can and I can pass any type I + + + align:start position:0% +call I can and I can pass any type I +want and call any function and do + + align:start position:0% +want and call any function and do + + + align:start position:0% +want and call any function and do +conversions back and forth ok so I take + + align:start position:0% +conversions back and forth ok so I take + + + align:start position:0% +conversions back and forth ok so I take +that array I'll kind of I'll convert it + + align:start position:0% +that array I'll kind of I'll convert it + + + align:start position:0% +that array I'll kind of I'll convert it +to a Python list object so I I don't + + align:start position:0% +to a Python list object so I I don't + + + align:start position:0% +to a Python list object so I I don't +want any time the overhead of converting + + align:start position:0% +want any time the overhead of converting + + + align:start position:0% +want any time the overhead of converting +that my array to a Python array so I'll + + align:start position:0% +that my array to a Python array so I'll + + + align:start position:0% +that my array to a Python array so I'll +just convert ahead of time get and just + + align:start position:0% +just convert ahead of time get and just + + + align:start position:0% +just convert ahead of time get and just +start with the built Python has a + + align:start position:0% +start with the built Python has a + + + align:start position:0% +start with the built Python has a +built-in function called sum so I'll use + + align:start position:0% +built-in function called sum so I'll use + + + align:start position:0% +built-in function called sum so I'll use +the built-in sum function and I'll get + + align:start position:0% +the built-in sum function and I'll get + + + align:start position:0% +the built-in sum function and I'll get +this PI object for it + + align:start position:0% +this PI object for it + + + align:start position:0% +this PI object for it +I'll call it PI sum on this list and + + align:start position:0% +I'll call it PI sum on this list and + + + align:start position:0% +I'll call it PI sum on this list and +make sure it's giving the right answer + + align:start position:0% +make sure it's giving the right answer + + + align:start position:0% +make sure it's giving the right answer +okay there's the differences 10-13 again + + align:start position:0% +okay there's the differences 10-13 again + + + align:start position:0% +okay there's the differences 10-13 again +and now let's benchmark it oops so it + + align:start position:0% +and now let's benchmark it oops so it + + + align:start position:0% +and now let's benchmark it oops so it +takes a few seconds because it it has to + + align:start position:0% +takes a few seconds because it it has to + + + align:start position:0% +takes a few seconds because it it has to +run it a few times and custard + + align:start position:0% +run it a few times and custard + + + align:start position:0% +run it a few times and custard +statistics okay so take 40 milliseconds + + align:start position:0% +statistics okay so take 40 milliseconds + + + align:start position:0% +statistics okay so take 40 milliseconds +that's not bad it's actually it's four + + align:start position:0% +that's not bad it's actually it's four + + + align:start position:0% +that's not bad it's actually it's four +or five times slower than C but it's + + align:start position:0% +or five times slower than C but it's + + + align:start position:0% +or five times slower than C but it's +it's pretty good so misil is it five + + align:start position:0% +it's pretty good so misil is it five + + + align:start position:0% +it's pretty good so misil is it five +times slower than C is it is it because + + align:start position:0% +times slower than C is it is it because + + + align:start position:0% +times slower than C is it is it because +PI Lib answer is oh well python is slow + + align:start position:0% +PI Lib answer is oh well python is slow + + + align:start position:0% +PI Lib answer is oh well python is slow +because it's interpreted but the sum + + align:start position:0% +because it's interpreted but the sum + + + align:start position:0% +because it's interpreted but the sum +function is actually written in C here's + + align:start position:0% +function is actually written in C here's + + + align:start position:0% +function is actually written in C here's +the here's the C implementation of the + + align:start position:0% +the here's the C implementation of the + + + align:start position:0% +the here's the C implementation of the +some function that I'm calling you know + + align:start position:0% +some function that I'm calling you know + + + align:start position:0% +some function that I'm calling you know +I'm just blinking to the github code + + align:start position:0% +I'm just blinking to the github code + + + align:start position:0% +I'm just blinking to the github code +there's a whole bunch of boilerplate + + align:start position:0% +there's a whole bunch of boilerplate + + + align:start position:0% +there's a whole bunch of boilerplate +that just checks with the type of the + + align:start position:0% +that just checks with the type of the + + + align:start position:0% +that just checks with the type of the +object and then it has some loops and so + + align:start position:0% +object and then it has some loops and so + + + align:start position:0% +object and then it has some loops and so +forth and so if you look look carefully + + align:start position:0% +forth and so if you look look carefully + + + align:start position:0% +forth and so if you look look carefully +it turns out it's actually doing really + + align:start position:0% +it turns out it's actually doing really + + + align:start position:0% +it turns out it's actually doing really +well and the reason it does really well + + align:start position:0% +well and the reason it does really well + + + align:start position:0% +well and the reason it does really well +is it has a fast path if you have a list + + align:start position:0% +is it has a fast path if you have a list + + + align:start position:0% +is it has a fast path if you have a list +where everything is a number type so + + align:start position:0% +where everything is a number type so + + + align:start position:0% +where everything is a number type so +that then it can you know it has a an + + align:start position:0% +that then it can you know it has a an + + + align:start position:0% +that then it can you know it has a an +optimized implementation for that case + + align:start position:0% +optimized implementation for that case + + + align:start position:0% +optimized implementation for that case +but it's still five times slower than C + + align:start position:0% +but it's still five times slower than C + + + align:start position:0% +but it's still five times slower than C +and they've spent a lot of work on it + + align:start position:0% +and they've spent a lot of work on it + + + align:start position:0% +and they've spent a lot of work on it +used to be ten times slower than C so a + + align:start position:0% +used to be ten times slower than C so a + + + align:start position:0% +used to be ten times slower than C so a +couple years ago so that they do a lot + + align:start position:0% +couple years ago so that they do a lot + + + align:start position:0% +couple years ago so that they do a lot +of work on optimizing this and so why + + align:start position:0% +of work on optimizing this and so why + + + align:start position:0% +of work on optimizing this and so why +aren't they able to get C speed since + + align:start position:0% +aren't they able to get C speed since + + + align:start position:0% +aren't they able to get C speed since +they have a simplement ation of a some + + align:start position:0% +they have a simplement ation of a some + + + align:start position:0% +they have a simplement ation of a some +are they just done you know no it's + + align:start position:0% +are they just done you know no it's + + + align:start position:0% +are they just done you know no it's +because the the semantics of the + + align:start position:0% +because the the semantics of the + + + align:start position:0% +because the the semantics of the +datatype prevent them from getting + + align:start position:0% +datatype prevent them from getting + + + align:start position:0% +datatype prevent them from getting +anything anything faster than that so + + align:start position:0% +anything anything faster than that so + + + align:start position:0% +anything anything faster than that so +and this is one of the the things you + + align:start position:0% +and this is one of the the things you + + + align:start position:0% +and this is one of the the things you +when you learn when you do you know high + + align:start position:0% +when you learn when you do you know high + + + align:start position:0% +when you learn when you do you know high +level performance in high level + + align:start position:0% +level performance in high level + + + align:start position:0% +level performance in high level +languages you have to think about + + align:start position:0% +languages you have to think about + + + align:start position:0% +languages you have to think about +datatypes you need to think about what + + align:start position:0% +datatypes you need to think about what + + + align:start position:0% +datatypes you need to think about what +the semantics are and that that that + + align:start position:0% +the semantics are and that that that + + + align:start position:0% +the semantics are and that that that +greatly constrains what any conceivable + + align:start position:0% +greatly constrains what any conceivable + + + align:start position:0% +greatly constrains what any conceivable +compiler can do and if the language is + + align:start position:0% +compiler can do and if the language is + + + align:start position:0% +compiler can do and if the language is +if the language doesn't provide you with + + align:start position:0% +if the language doesn't provide you with + + + align:start position:0% +if the language doesn't provide you with +the with the ability to express the + + align:start position:0% +the with the ability to express the + + + align:start position:0% +the with the ability to express the +semantics so you want then you're dead + + align:start position:0% +semantics so you want then you're dead + + + align:start position:0% +semantics so you want then you're dead +and that's that's one of the basic + + align:start position:0% +and that's that's one of the basic + + + align:start position:0% +and that's that's one of the basic +things that julia does so what is a + + align:start position:0% +things that julia does so what is a + + + align:start position:0% +things that julia does so what is a +Python list right so yeah you know you + + align:start position:0% +Python list right so yeah you know you + + + align:start position:0% +Python list right so yeah you know you +can have three four all right all right + + align:start position:0% +can have three four all right all right + + + align:start position:0% +can have three four all right all right +yep I thought unless it's a bunch of + + align:start position:0% +yep I thought unless it's a bunch of + + + align:start position:0% +yep I thought unless it's a bunch of +objects Python objects but the Python + + align:start position:0% +objects Python objects but the Python + + + align:start position:0% +objects Python objects but the Python +hundreds can be anything they can be any + + align:start position:0% +hundreds can be anything they can be any + + + align:start position:0% +hundreds can be anything they can be any +type so it's completely heterogeneous + + align:start position:0% +type so it's completely heterogeneous + + + align:start position:0% +type so it's completely heterogeneous +types okay so of course a particular + + align:start position:0% +types okay so of course a particular + + + align:start position:0% +types okay so of course a particular +list like in this case can be + + align:start position:0% +list like in this case can be + + + align:start position:0% +list like in this case can be +homogeneous but the data structure has + + align:start position:0% +homogeneous but the data structure has + + + align:start position:0% +homogeneous but the data structure has +to be hit Oh genius because in fact I + + align:start position:0% +to be hit Oh genius because in fact I + + + align:start position:0% +to be hit Oh genius because in fact I +can take that homogeneous thing at any + + align:start position:0% +can take that homogeneous thing at any + + + align:start position:0% +can take that homogeneous thing at any +point I could assign the third element + + align:start position:0% +point I could assign the third element + + + align:start position:0% +point I could assign the third element +to a string right it has to it has to + + align:start position:0% +to a string right it has to it has to + + + align:start position:0% +to a string right it has to it has to +support that so think about what that + + align:start position:0% +support that so think about what that + + + align:start position:0% +support that so think about what that +means for how it has to be implemented + + align:start position:0% +means for how it has to be implemented + + + align:start position:0% +means for how it has to be implemented +in memory so so what this has to be so + + align:start position:0% +in memory so so what this has to be so + + + align:start position:0% +in memory so so what this has to be so +this is a list of this case three items + + align:start position:0% +this is a list of this case three items + + + align:start position:0% +this is a list of this case three items +but what are those items so that's if + + align:start position:0% +but what are those items so that's if + + + align:start position:0% +but what are those items so that's if +they can be an item of any type right + + align:start position:0% +they can be an item of any type right + + + align:start position:0% +they can be an item of any type right +they could be things that it could be + + align:start position:0% +they could be things that it could be + + + align:start position:0% +they could be things that it could be +another array right it could be of + + align:start position:0% +another array right it could be of + + + align:start position:0% +another array right it could be of +different sizes and so forth you don't + + align:start position:0% +different sizes and so forth you don't + + + align:start position:0% +different sizes and so forth you don't +want to have an array where everything + + align:start position:0% +want to have an array where everything + + + align:start position:0% +want to have an array where everything +is a different size first well so so it + + align:start position:0% +is a different size first well so so it + + + align:start position:0% +is a different size first well so so it +has to be this an array of pointers + + align:start position:0% + + + + align:start position:0% + +all right we're the first pointer is + + align:start position:0% +all right we're the first pointer is + + + align:start position:0% +all right we're the first pointer is +three it's to not pick three the next + + align:start position:0% +three it's to not pick three the next + + + align:start position:0% +three it's to not pick three the next +one is for the next one is to fine but + + align:start position:0% +one is for the next one is to fine but + + + align:start position:0% +one is for the next one is to fine but +it can't just be that it can't just be + + align:start position:0% +it can't just be that it can't just be + + + align:start position:0% +it can't just be that it can't just be +pointer to like if this is a you know + + align:start position:0% +pointer to like if this is a you know + + + align:start position:0% +pointer to like if this is a you know +64-bit number it's can't just be pointer + + align:start position:0% +64-bit number it's can't just be pointer + + + align:start position:0% +64-bit number it's can't just be pointer +to you know to one 64-bit value in + + align:start position:0% +to you know to one 64-bit value in + + + align:start position:0% +to you know to one 64-bit value in +memory because it has to know it has to + + align:start position:0% +memory because it has to know it has to + + + align:start position:0% +memory because it has to know it has to +similar store what type is subject is so + + align:start position:0% +similar store what type is subject is so + + + align:start position:0% +similar store what type is subject is so +it has to there has to be a type tag + + align:start position:0% +it has to there has to be a type tag + + + align:start position:0% +it has to there has to be a type tag +this says this is an integer and this + + align:start position:0% +this says this is an integer and this + + + align:start position:0% +this says this is an integer and this +one has to have a type tag that says + + align:start position:0% +one has to have a type tag that says + + + align:start position:0% +one has to have a type tag that says +it's a string so this is sometimes + + align:start position:0% +it's a string so this is sometimes + + + align:start position:0% +it's a string so this is sometimes +called a box see have a value you have a + + align:start position:0% +called a box see have a value you have a + + + align:start position:0% +called a box see have a value you have a +type tag plus the value and so imagine + + align:start position:0% +type tag plus the value and so imagine + + + align:start position:0% +type tag plus the value and so imagine +what even the most optimized seek + + align:start position:0% +what even the most optimized seek + + + align:start position:0% +what even the most optimized seek +implementation has to do given this kind + + align:start position:0% +implementation has to do given this kind + + + align:start position:0% +implementation has to do given this kind +of data structure okay here's the first + + align:start position:0% +of data structure okay here's the first + + + align:start position:0% +of data structure okay here's the first +time it has to chase the pointer and + + align:start position:0% +time it has to chase the pointer and + + + align:start position:0% +time it has to chase the pointer and +then ask what type of object is it okay + + align:start position:0% +then ask what type of object is it okay + + + align:start position:0% +then ask what type of object is it okay +then depending on what type of object is + + align:start position:0% +then depending on what type of object is + + + align:start position:0% +then depending on what type of object is +it is okay though I initialize my some + + align:start position:0% +it is okay though I initialize my some + + + align:start position:0% +it is okay though I initialize my some +to that then I read the next object I + + align:start position:0% +to that then I read the next object I + + + align:start position:0% +to that then I read the next object I +have to change the second pointer read + + align:start position:0% +have to change the second pointer read + + + align:start position:0% +have to change the second pointer read +the type tag figure out the type this + + align:start position:0% +the type tag figure out the type this + + + align:start position:0% +the type tag figure out the type this +all then at runtime right and then oh + + align:start position:0% +all then at runtime right and then oh + + + align:start position:0% +all then at runtime right and then oh +this is another integer that tells me I + + align:start position:0% +this is another integer that tells me I + + + align:start position:0% +this is another integer that tells me I +want to use the plus function for two + + align:start position:0% +want to use the plus function for two + + + align:start position:0% +want to use the plus function for two +integers okay and then I read the next + + align:start position:0% +integers okay and then I read the next + + + align:start position:0% +integers okay and then I read the next +value which may be but it's a 48 is it + + align:start position:0% +value which may be but it's a 48 is it + + + align:start position:0% +value which may be but it's a 48 is it +so that the Plus which plus function + + align:start position:0% +so that the Plus which plus function + + + align:start position:0% +so that the Plus which plus function +that's using depends upon the type of + + align:start position:0% +that's using depends upon the type of + + + align:start position:0% +that's using depends upon the type of +the object it's not drawing language I + + align:start position:0% +the object it's not drawing language I + + + align:start position:0% +the object it's not drawing language I +can define my own type and which has its + + align:start position:0% +can define my own type and which has its + + + align:start position:0% +can define my own type and which has its +own plus function it should work with + + align:start position:0% +own plus function it should work with + + + align:start position:0% +own plus function it should work with +some so it's looking at the types of the + + align:start position:0% +some so it's looking at the types of the + + + align:start position:0% +some so it's looking at the types of the +objects at runtime it's looking at the + + align:start position:0% +objects at runtime it's looking at the + + + align:start position:0% +objects at runtime it's looking at the +plus function at runtime and not only + + align:start position:0% +plus function at runtime and not only + + + align:start position:0% +plus function at runtime and not only +that but each time it does a loop + + align:start position:0% +that but each time it does a loop + + + align:start position:0% +that but each time it does a loop +iteration it has to add two things and + + align:start position:0% +iteration it has to add two things and + + + align:start position:0% +iteration it has to add two things and +allocate a result that result in general + + align:start position:0% +allocate a result that result in general + + + align:start position:0% +allocate a result that result in general +might be another has to be a box because + + align:start position:0% +might be another has to be a box because + + + align:start position:0% +might be another has to be a box because +it might type my changes you're summing + + align:start position:0% +it might type my changes you're summing + + + align:start position:0% +it might type my changes you're summing +through if you start with integers and + + align:start position:0% +through if you start with integers and + + + align:start position:0% +through if you start with integers and +then you get a floating point value and + + align:start position:0% +then you get a floating point value and + + + align:start position:0% +then you get a floating point value and +then you get an array right the the the + + align:start position:0% +then you get an array right the the the + + + align:start position:0% +then you get an array right the the the +type will change so sorry each time you + + align:start position:0% +type will change so sorry each time you + + + align:start position:0% +type will change so sorry each time you +do a loop iteration it allocates another + + align:start position:0% +do a loop iteration it allocates another + + + align:start position:0% +do a loop iteration it allocates another +box so what happens is this + + align:start position:0% +box so what happens is this + + + align:start position:0% +box so what happens is this +implementation is a fast path if they're + + align:start position:0% +implementation is a fast path if they're + + + align:start position:0% +implementation is a fast path if they're +all like integer types it doesn't I + + align:start position:0% +all like integer types it doesn't I + + + align:start position:0% +all like integer types it doesn't I +think it doesn't reallocate that box for + + align:start position:0% +think it doesn't reallocate that box for + + + align:start position:0% +think it doesn't reallocate that box for +the the summits accumulating all the + + align:start position:0% +the the summits accumulating all the + + + align:start position:0% +the the summits accumulating all the +time + + align:start position:0% +time + + + align:start position:0% +time +cassia's the value of the plus function + + align:start position:0% +cassia's the value of the plus function + + + align:start position:0% +cassia's the value of the plus function +it's using so it's a little bit faster + + align:start position:0% +it's using so it's a little bit faster + + + align:start position:0% +it's using so it's a little bit faster +but still it has to inspect every type + + align:start position:0% +but still it has to inspect every type + + + align:start position:0% +but still it has to inspect every type +tag and and chase all these pointers for + + align:start position:0% +tag and and chase all these pointers for + + + align:start position:0% +tag and and chase all these pointers for +every element of the array whereas the C + + align:start position:0% +every element of the array whereas the C + + + align:start position:0% +every element of the array whereas the C +implementation this of some if you + + align:start position:0% +implementation this of some if you + + + align:start position:0% +implementation this of some if you +imagine what this is this compiles down + + align:start position:0% +imagine what this is this compiles down + + + align:start position:0% +imagine what this is this compiles down +to write each loop iteration who has to + + align:start position:0% +to write each loop iteration who has to + + + align:start position:0% +to write each loop iteration who has to +do it increments a pointer to the next + + align:start position:0% +do it increments a pointer to the next + + + align:start position:0% +do it increments a pointer to the next +element fetches it knows that at compile + + align:start position:0% +element fetches it knows that at compile + + + align:start position:0% +element fetches it knows that at compile +time the types are all focused before so + + align:start position:0% +time the types are all focused before so + + + align:start position:0% +time the types are all focused before so +it flushes closely to for value into a + + align:start position:0% +it flushes closely to for value into a + + + align:start position:0% +it flushes closely to for value into a +register and then as it keeps has it + + align:start position:0% +register and then as it keeps has it + + + align:start position:0% +register and then as it keeps has it +running some in another register calls + + align:start position:0% +running some in another register calls + + + align:start position:0% +running some in another register calls +one machine instruction to add that + + align:start position:0% +one machine instruction to add that + + + align:start position:0% +one machine instruction to add that +running Sun sum and then goes to checks + + align:start position:0% +running Sun sum and then goes to checks + + + align:start position:0% +running Sun sum and then goes to checks +to see if we're done has a you know an + + align:start position:0% +to see if we're done has a you know an + + + align:start position:0% +to see if we're done has a you know an +if statement there and then goes on all + + align:start position:0% +if statement there and then goes on all + + + align:start position:0% +if statement there and then goes on all +right so just a few instructions and in + + align:start position:0% +right so just a few instructions and in + + + align:start position:0% +right so just a few instructions and in +a very tight loop here where as each + + align:start position:0% +a very tight loop here where as each + + + align:start position:0% +a very tight loop here where as each +loop iteration here has to be lots and + + align:start position:0% +loop iteration here has to be lots and + + + align:start position:0% +loop iteration here has to be lots and +lots of instructions to chase all these + + align:start position:0% +lots of instructions to chase all these + + + align:start position:0% +lots of instructions to chase all these +pointers to get the type tag and that's + + align:start position:0% +pointers to get the type tag and that's + + + align:start position:0% +pointers to get the type tag and that's +in the fast case where they're all the + + align:start position:0% +in the fast case where they're all the + + + align:start position:0% +in the fast case where they're all the +same type and it's optimized for that so + + align:start position:0% +same type and it's optimized for that so + + + align:start position:0% +same type and it's optimized for that so +oh where was I wrong wrong thing so + + align:start position:0% +oh where was I wrong wrong thing so + + + align:start position:0% +oh where was I wrong wrong thing so +that's the Python sum function now most + + align:start position:0% +that's the Python sum function now most + + + align:start position:0% +that's the Python sum function now most +many of you use Python know that there's + + align:start position:0% +many of you use Python know that there's + + + align:start position:0% +many of you use Python know that there's +another type of array and there's a + + align:start position:0% +another type of array and there's a + + + align:start position:0% +another type of array and there's a +whole library called numpy for working + + align:start position:0% +whole library called numpy for working + + + align:start position:0% +whole library called numpy for working +with the Marek's so what problem is that + + align:start position:0% +with the Marek's so what problem is that + + + align:start position:0% +with the Marek's so what problem is that +addressing so the basic problem is this + + align:start position:0% +addressing so the basic problem is this + + + align:start position:0% +addressing so the basic problem is this +data structure this data structure is as + + align:start position:0% +data structure this data structure is as + + + align:start position:0% +data structure this data structure is as +soon as you have a list of items that + + align:start position:0% +soon as you have a list of items that + + + align:start position:0% +soon as you have a list of items that +can be any type you're dead right + + align:start position:0% +can be any type you're dead right + + + align:start position:0% +can be any type you're dead right +there's no way to make this as fast as a + + align:start position:0% +there's no way to make this as fast as a + + + align:start position:0% +there's no way to make this as fast as a +c loop over a double pointer so to make + + align:start position:0% +c loop over a double pointer so to make + + + align:start position:0% +c loop over a double pointer so to make +it fast what you need but we haven't + + align:start position:0% +it fast what you need but we haven't + + + align:start position:0% +it fast what you need but we haven't +have as a way to say oh every element of + + align:start position:0% +have as a way to say oh every element of + + + align:start position:0% +have as a way to say oh every element of +this array is the same type so I don't + + align:start position:0% +this array is the same type so I don't + + + align:start position:0% +this array is the same type so I don't +need to store type tags for every + + align:start position:0% +need to store type tags for every + + + align:start position:0% +need to store type tags for every +element I just our type tag once for the + + align:start position:0% +element I just our type tag once for the + + + align:start position:0% +element I just our type tag once for the +whole array + + align:start position:0% + + + + align:start position:0% + +so that so there there is a tag for the + + align:start position:0% +so that so there there is a tag for the + + + align:start position:0% +so that so there there is a tag for the +before that there's a type wait to say + + align:start position:0% +before that there's a type wait to say + + + align:start position:0% +before that there's a type wait to say +float64 okay there is maybe a length of + + align:start position:0% +float64 okay there is maybe a length of + + + align:start position:0% +float64 okay there is maybe a length of +the array and then there's just a bunch + + align:start position:0% +the array and then there's just a bunch + + + align:start position:0% +the array and then there's just a bunch +of values went after the other + + align:start position:0% +of values went after the other + + + align:start position:0% +of values went after the other +so this is just a you know 1.0 three + + align:start position:0% +so this is just a you know 1.0 three + + + align:start position:0% +so this is just a you know 1.0 three +point seven eight point nine and each of + + align:start position:0% +point seven eight point nine and each of + + + align:start position:0% +point seven eight point nine and each of +these are just eight bytes an 8 byte + + align:start position:0% +these are just eight bytes an 8 byte + + + align:start position:0% +these are just eight bytes an 8 byte +double in c notation right so it's just + + align:start position:0% +double in c notation right so it's just + + + align:start position:0% +double in c notation right so it's just +one after the other so it reads this + + align:start position:0% +one after the other so it reads this + + + align:start position:0% +one after the other so it reads this +once reads the length and then it + + align:start position:0% +once reads the length and then it + + + align:start position:0% +once reads the length and then it +dispatches to code that says okay now + + align:start position:0% +dispatches to code that says okay now + + + align:start position:0% +dispatches to code that says okay now +basically dispatches the equivalent of + + align:start position:0% +basically dispatches the equivalent of + + + align:start position:0% +basically dispatches the equivalent of +my C code alright so now once it knows + + align:start position:0% +my C code alright so now once it knows + + + align:start position:0% +my C code alright so now once it knows +the type in the length then okay says it + + align:start position:0% +the type in the length then okay says it + + + align:start position:0% +the type in the length then okay says it +runs this okay and that can be quite + + align:start position:0% +runs this okay and that can be quite + + + align:start position:0% +runs this okay and that can be quite +fast and the only problem is you cannot + + align:start position:0% +fast and the only problem is you cannot + + + align:start position:0% +fast and the only problem is you cannot +write implement this in Python so Python + + align:start position:0% +write implement this in Python so Python + + + align:start position:0% +write implement this in Python so Python +doesn't provide you a way to to have + + align:start position:0% +doesn't provide you a way to to have + + + align:start position:0% +doesn't provide you a way to to have +that semantics to have a list of objects + + align:start position:0% +that semantics to have a list of objects + + + align:start position:0% +that semantics to have a list of objects +we say they all have to be the same type + + align:start position:0% +we say they all have to be the same type + + + align:start position:0% +we say they all have to be the same type +there's no way to enforce that or to + + align:start position:0% +there's no way to enforce that or to + + + align:start position:0% +there's no way to enforce that or to +inform the language of that in in Python + + align:start position:0% +inform the language of that in in Python + + + align:start position:0% +inform the language of that in in Python +and then and then they tell it Oh + + align:start position:0% +and then and then they tell it Oh + + + align:start position:0% +and then and then they tell it Oh +for this test these are all the same + + align:start position:0% +for this test these are all the same + + + align:start position:0% +for this test these are all the same +type you can throw away the boxes like + + align:start position:0% +type you can throw away the boxes like + + + align:start position:0% +type you can throw away the boxes like +every Python object looks like this you + + align:start position:0% +every Python object looks like this you + + + align:start position:0% +every Python object looks like this you +can see there's no way to tell Python oh + + align:start position:0% +can see there's no way to tell Python oh + + + align:start position:0% +can see there's no way to tell Python oh +well these are these are all the same + + align:start position:0% +well these are these are all the same + + + align:start position:0% +well these are these are all the same +type so you don't need to store the type + + align:start position:0% +type so you don't need to store the type + + + align:start position:0% +type so you don't need to store the type +tags you don't need that pointers you + + align:start position:0% +tags you don't need that pointers you + + + align:start position:0% +tags you don't need that pointers you +don't need to have reference counting + + align:start position:0% +don't need to have reference counting + + + align:start position:0% +don't need to have reference counting +you can just slam the values into memory + + align:start position:0% +you can just slam the values into memory + + + align:start position:0% +you can just slam the values into memory +one after the other it doesn't provide + + align:start position:0% +one after the other it doesn't provide + + + align:start position:0% +one after the other it doesn't provide +you that with that facility and so + + align:start position:0% +you that with that facility and so + + + align:start position:0% +you that with that facility and so +there's no way to like you can make a + + align:start position:0% +there's no way to like you can make a + + + align:start position:0% +there's no way to like you can make a +fast Python compiler that will do this + + align:start position:0% +fast Python compiler that will do this + + + align:start position:0% +fast Python compiler that will do this +so nothing is implemented didn't see + + align:start position:0% +so nothing is implemented didn't see + + + align:start position:0% +so nothing is implemented didn't see +even with some of you are familiar with + + align:start position:0% +even with some of you are familiar with + + + align:start position:0% +even with some of you are familiar with +pi PI which is an attempt to make a fast + + align:start position:0% +pi PI which is an attempt to make a fast + + + align:start position:0% +pi PI which is an attempt to make a fast +like a tracing JIT for Python so they + + align:start position:0% +like a tracing JIT for Python so they + + + align:start position:0% +like a tracing JIT for Python so they +when they poured it to Mata num PI to 2 + + align:start position:0% +when they poured it to Mata num PI to 2 + + + align:start position:0% +when they poured it to Mata num PI to 2 +pi PI or they attempted to even then you + + align:start position:0% +pi PI or they attempted to even then you + + + align:start position:0% +pi PI or they attempted to even then you +know they could they could implement + + align:start position:0% +know they could they could implement + + + align:start position:0% +know they could they could implement +more of it in Python but they had to + + align:start position:0% +more of it in Python but they had to + + + align:start position:0% +more of it in Python but they had to +implement the core in C ok but given + + align:start position:0% +implement the core in C ok but given + + + align:start position:0% +implement the core in C ok but given +that I can do this I can I can I can I + + align:start position:0% +that I can do this I can I can I can I + + + align:start position:0% +that I can do this I can I can I can I +can import the numpy module into julia + + align:start position:0% +can import the numpy module into julia + + + align:start position:0% +can import the numpy module into julia +get it's some function and benchmark the + + align:start position:0% +get it's some function and benchmark the + + + align:start position:0% +get it's some function and benchmark the +numpy some function and + + align:start position:0% + + + + align:start position:0% + +okay it's good again it takes a few + + align:start position:0% +okay it's good again it takes a few + + + align:start position:0% +okay it's good again it takes a few +seconds to run okay and it takes three + + align:start position:0% +seconds to run okay and it takes three + + + align:start position:0% +seconds to run okay and it takes three +point eight milliseconds so this C was + + align:start position:0% +point eight milliseconds so this C was + + + align:start position:0% +point eight milliseconds so this C was +ten milliseconds so it's actually it's + + align:start position:0% +ten milliseconds so it's actually it's + + + align:start position:0% +ten milliseconds so it's actually it's +actually doing faster than the C code + + align:start position:0% +actually doing faster than the C code + + + align:start position:0% +actually doing faster than the C code +almost a little over twice as fast + + align:start position:0% +almost a little over twice as fast + + + align:start position:0% +almost a little over twice as fast +actually and and what's going on is it's + + align:start position:0% +actually and and what's going on is it's + + + align:start position:0% +actually and and what's going on is it's +is there's there C code is better than + + align:start position:0% +is there's there C code is better than + + + align:start position:0% +is there's there C code is better than +my C code there C code is using assembly + + align:start position:0% +my C code there C code is using assembly + + + align:start position:0% +my C code there C code is using assembly +instructions so you party and at this + + align:start position:0% +instructions so you party and at this + + + align:start position:0% +instructions so you party and at this +point I'm sure that you guys all know + + align:start position:0% +point I'm sure that you guys all know + + + align:start position:0% +point I'm sure that you guys all know +about these things well you you can + + align:start position:0% +about these things well you you can + + + align:start position:0% +about these things well you you can +leave read in two numbers or four + + align:start position:0% +leave read in two numbers or four + + + align:start position:0% +leave read in two numbers or four +numbers into like one giant register and + + align:start position:0% +numbers into like one giant register and + + + align:start position:0% +numbers into like one giant register and +one instruction had all four numbers at + + align:start position:0% +one instruction had all four numbers at + + + align:start position:0% +one instruction had all four numbers at +once okay so what about if we go in the + + align:start position:0% +once okay so what about if we go in the + + + align:start position:0% +once okay so what about if we go in the +other direction we write our own Python + + align:start position:0% +other direction we write our own Python + + + align:start position:0% +other direction we write our own Python +some function so we don't use the Python + + align:start position:0% +some function so we don't use the Python + + + align:start position:0% +some function so we don't use the Python +some implemented in C I write our own in + + align:start position:0% +some implemented in C I write our own in + + + align:start position:0% +some implemented in C I write our own in +Python so here's a little my some + + align:start position:0% +Python so here's a little my some + + + align:start position:0% +Python so here's a little my some +function in Python only works for + + align:start position:0% +function in Python only works for + + + align:start position:0% +function in Python only works for +floating-point I initialize X to zero + + align:start position:0% +floating-point I initialize X to zero + + + align:start position:0% +floating-point I initialize X to zero +point zero so really only is accumulates + + align:start position:0% +point zero so really only is accumulates + + + align:start position:0% +point zero so really only is accumulates +floating point values but that's okay + + align:start position:0% +floating point values but that's okay + + + align:start position:0% +floating point values but that's okay +and then I just loop for X in a s equals + + align:start position:0% +and then I just loop for X in a s equals + + + align:start position:0% +and then I just loop for X in a s equals +s plus X return s is the most obvious + + align:start position:0% +s plus X return s is the most obvious + + + align:start position:0% +s plus X return s is the most obvious +thing you would write in Python okay and + + align:start position:0% +thing you would write in Python okay and + + + align:start position:0% +thing you would write in Python okay and +check that it works and yet arrows to + + align:start position:0% +check that it works and yet arrows to + + + align:start position:0% +check that it works and yet arrows to +the minus 13th it's giving the right + + align:start position:0% +the minus 13th it's giving the right + + + align:start position:0% +the minus 13th it's giving the right +answer and now let's climb it + + align:start position:0% + + + + align:start position:0% + +so remember C was 10 milliseconds numpy + + align:start position:0% +so remember C was 10 milliseconds numpy + + + align:start position:0% +so remember C was 10 milliseconds numpy +was full it's like 5 milliseconds and + + align:start position:0% +was full it's like 5 milliseconds and + + + align:start position:0% +was full it's like 5 milliseconds and +then the built-in Python was like if + + align:start position:0% +then the built-in Python was like if + + + align:start position:0% +then the built-in Python was like if +some was 50 milliseconds operating on + + align:start position:0% +some was 50 milliseconds operating on + + + align:start position:0% +some was 50 milliseconds operating on +this on this list now so we now we have + + align:start position:0% +this on this list now so we now we have + + + align:start position:0% +this on this list now so we now we have +this a C code operate on this list with + + align:start position:0% +this a C code operate on this list with + + + align:start position:0% +this a C code operate on this list with +50 milliseconds and now we have Python + + align:start position:0% +50 milliseconds and now we have Python + + + align:start position:0% +50 milliseconds and now we have Python +code operating on this list and that is + + align:start position:0% + + + + align:start position:0% + +230 milliseconds I so it's it's quite a + + align:start position:0% +230 milliseconds I so it's it's quite a + + + align:start position:0% +230 milliseconds I so it's it's quite a +bit slower and it's because basically in + + align:start position:0% +bit slower and it's because basically in + + + align:start position:0% +bit slower and it's because basically in +Python there's in the pure Python code + + align:start position:0% +Python there's in the pure Python code + + + align:start position:0% +Python there's in the pure Python code +there's no way to implement this fast + + align:start position:0% +there's no way to implement this fast + + + align:start position:0% +there's no way to implement this fast +path that checks oh they're all the same + + align:start position:0% +path that checks oh they're all the same + + + align:start position:0% +path that checks oh they're all the same +type so I can cash the plus function and + + align:start position:0% +type so I can cash the plus function and + + + align:start position:0% +type so I can cash the plus function and +so far I don't think it's it's feasible + + align:start position:0% +so far I don't think it's it's feasible + + + align:start position:0% +so far I don't think it's it's feasible +to implement that and so so basically + + align:start position:0% +to implement that and so so basically + + + align:start position:0% +to implement that and so so basically +then on every loop iteration has to look + + align:start position:0% +then on every loop iteration has to look + + + align:start position:0% +then on every loop iteration has to look +up the plus function dynamically and + + align:start position:0% +up the plus function dynamically and + + + align:start position:0% +up the plus function dynamically and +allocate a new box for the result and + + align:start position:0% +allocate a new box for the result and + + + align:start position:0% +allocate a new box for the result and +and do that 10 to the seventh times cuz + + align:start position:0% +and do that 10 to the seventh times cuz + + + align:start position:0% +and do that 10 to the seventh times cuz +now so there's a built in some function + + align:start position:0% +now so there's a built in some function + + + align:start position:0% +now so there's a built in some function +in Julia I saw this distant benchmark + + align:start position:0% +in Julia I saw this distant benchmark + + + align:start position:0% +in Julia I saw this distant benchmark +that is a it's actually implemented in + + align:start position:0% +that is a it's actually implemented in + + + align:start position:0% +that is a it's actually implemented in +Julia it's not implemented in C I won't + + align:start position:0% +Julia it's not implemented in C I won't + + + align:start position:0% +Julia it's not implemented in C I won't +show you the code for the built in one + + align:start position:0% +show you the code for the built in one + + + align:start position:0% +show you the code for the built in one +because it's it's a little messy because + + align:start position:0% +because it's it's a little messy because + + + align:start position:0% +because it's it's a little messy because +it's actually computing this some more + + align:start position:0% +it's actually computing this some more + + + align:start position:0% +it's actually computing this some more +accurately than than the loop that I've + + align:start position:0% +accurately than than the loop that I've + + + align:start position:0% +accurately than than the loop that I've +done it is its uses so that's three + + align:start position:0% +done it is its uses so that's three + + + align:start position:0% +done it is its uses so that's three +point nine milliseconds so it's + + align:start position:0% +point nine milliseconds so it's + + + align:start position:0% +point nine milliseconds so it's +comparable to the to the numpy code okay + + align:start position:0% +comparable to the to the numpy code okay + + + align:start position:0% +comparable to the to the numpy code okay +so it's also using sim D but it's it's + + align:start position:0% +so it's also using sim D but it's it's + + + align:start position:0% +so it's also using sim D but it's it's +so this is also fast so now it's so why + + align:start position:0% +so this is also fast so now it's so why + + + align:start position:0% +so this is also fast so now it's so why +can Julie do that so it has to be that + + align:start position:0% +can Julie do that so it has to be that + + + align:start position:0% +can Julie do that so it has to be that +the array type first of all has the type + + align:start position:0% +the array type first of all has the type + + + align:start position:0% +the array type first of all has the type +attached to it so you can see the type + + align:start position:0% +attached to it so you can see the type + + + align:start position:0% +attached to it so you can see the type +of the array is an array of low 64 so + + align:start position:0% +of the array is an array of low 64 so + + + align:start position:0% +of the array is an array of low 64 so +there's a type tag attached to the array + + align:start position:0% +there's a type tag attached to the array + + + align:start position:0% +there's a type tag attached to the array +itself so somehow that that's involved + + align:start position:0% +itself so somehow that that's involved + + + align:start position:0% +itself so somehow that that's involved +so it looks more like a numpy array in + + align:start position:0% +so it looks more like a numpy array in + + + align:start position:0% +so it looks more like a numpy array in +memory than then this is then a Python + + align:start position:0% +memory than then this is then a Python + + + align:start position:0% +memory than then this is then a Python +list you can make the equivalent of a + + align:start position:0% +list you can make the equivalent of a + + + align:start position:0% +list you can make the equivalent of a +Python list that's called an array of + + align:start position:0% +Python list that's called an array of + + + align:start position:0% +Python list that's called an array of +any so if I convert this to an array of + + align:start position:0% +any so if I convert this to an array of + + + align:start position:0% +any so if I convert this to an array of +any so that an array of any is something + + align:start position:0% +any so that an array of any is something + + + align:start position:0% +any so that an array of any is something +where the elements types can be any any + + align:start position:0% +where the elements types can be any any + + + align:start position:0% +where the elements types can be any any +julia type and so that it has to be + + align:start position:0% +julia type and so that it has to be + + + align:start position:0% +julia type and so that it has to be +stored as something like this as an + + align:start position:0% +stored as something like this as an + + + align:start position:0% +stored as something like this as an +array of pointers to boxes and when I do + + align:start position:0% +array of pointers to boxes and when I do + + + align:start position:0% +array of pointers to boxes and when I do +that let's see there it is + + align:start position:0% +that let's see there it is + + + align:start position:0% +that let's see there it is +then it's 355 milliseconds so it's + + align:start position:0% +then it's 355 milliseconds so it's + + + align:start position:0% +then it's 355 milliseconds so it's +actually it's actually even worse than + + align:start position:0% +actually it's actually even worse than + + + align:start position:0% +actually it's actually even worse than +Python so the Julia the Python they + + align:start position:0% +Python so the Julia the Python they + + + align:start position:0% +Python so the Julia the Python they +spent a lot of time optimizing their + + align:start position:0% +spent a lot of time optimizing their + + + align:start position:0% +spent a lot of time optimizing their +code paths for things that had to + + align:start position:0% +code paths for things that had to + + + align:start position:0% +code paths for things that had to +allocate lots of boxes all the time so + + align:start position:0% +allocate lots of boxes all the time so + + + align:start position:0% +allocate lots of boxes all the time so +and Julia it's usually understood that + + align:start position:0% +and Julia it's usually understood that + + + align:start position:0% +and Julia it's usually understood that +if you're writing optimized code you're + + align:start position:0% +if you're writing optimized code you're + + + align:start position:0% +if you're writing optimized code you're +gonna do it not on a raise of pointers + + align:start position:0% +gonna do it not on a raise of pointers + + + align:start position:0% +gonna do it not on a raise of pointers +to boxes like if you're you're gonna + + align:start position:0% +to boxes like if you're you're gonna + + + align:start position:0% +to boxes like if you're you're gonna +write it on homogeneous arrays or things + + align:start position:0% +write it on homogeneous arrays or things + + + align:start position:0% +write it on homogeneous arrays or things +where the types are known at compile + + align:start position:0% +where the types are known at compile + + + align:start position:0% +where the types are known at compile +time okay so so let's write our own + + align:start position:0% +time okay so so let's write our own + + + align:start position:0% +time okay so so let's write our own +julia some function this is the julia + + align:start position:0% +julia some function this is the julia + + + align:start position:0% +julia some function this is the julia +some function there's no type + + align:start position:0% +some function there's no type + + + align:start position:0% +some function there's no type +declaration it works on any container + + align:start position:0% +declaration it works on any container + + + align:start position:0% +declaration it works on any container +type i initialize s2 to for this + + align:start position:0% +type i initialize s2 to for this + + + align:start position:0% +type i initialize s2 to for this +function call zero for the element type + + align:start position:0% +function call zero for the element type + + + align:start position:0% +function call zero for the element type +of a so it initializes it to the add + + align:start position:0% +of a so it initializes it to the add + + + align:start position:0% +of a so it initializes it to the add +of identity so to work on any container + + align:start position:0% +of identity so to work on any container + + + align:start position:0% +of identity so to work on any container +of anything that supports a plus + + align:start position:0% +of anything that supports a plus + + + align:start position:0% +of anything that supports a plus +function that hasn't added has an + + align:start position:0% +function that hasn't added has an + + + align:start position:0% +function that hasn't added has an +additive identity so it's completely + + align:start position:0% +additive identity so it's completely + + + align:start position:0% +additive identity so it's completely +generic it looks a lot like the Python + + align:start position:0% +generic it looks a lot like the Python + + + align:start position:0% +generic it looks a lot like the Python +code except for this there's no there's + + align:start position:0% +code except for this there's no there's + + + align:start position:0% +code except for this there's no there's +no zero function in Python and this make + + align:start position:0% +no zero function in Python and this make + + + align:start position:0% +no zero function in Python and this make +sure gives the right answer it does and + + align:start position:0% +sure gives the right answer it does and + + + align:start position:0% +sure gives the right answer it does and +that's benchmark it all right so this is + + align:start position:0% +that's benchmark it all right so this is + + + align:start position:0% +that's benchmark it all right so this is +the code you'd like to be able to write + + align:start position:0% +the code you'd like to be able to write + + + align:start position:0% +the code you'd like to be able to write +you like to be able to write high-level + + align:start position:0% +you like to be able to write high-level + + + align:start position:0% +you like to be able to write high-level +code that's a straight level straight + + align:start position:0% +code that's a straight level straight + + + align:start position:0% +code that's a straight level straight +loop unlike the C code it's completely + + align:start position:0% +loop unlike the C code it's completely + + + align:start position:0% +loop unlike the C code it's completely +generic right it works on any any + + align:start position:0% +generic right it works on any any + + + align:start position:0% +generic right it works on any any +container to anything you can loop over + + align:start position:0% +container to anything you can loop over + + + align:start position:0% +container to anything you can loop over +and anything that has a plus function + + align:start position:0% +and anything that has a plus function + + + align:start position:0% +and anything that has a plus function +right so an array of quaternions or + + align:start position:0% +right so an array of quaternions or + + + align:start position:0% +right so an array of quaternions or +whatever and a benchmark it it's 11 + + align:start position:0% +whatever and a benchmark it it's 11 + + + align:start position:0% +whatever and a benchmark it it's 11 +milliseconds it's the same as the C code + + align:start position:0% +milliseconds it's the same as the C code + + + align:start position:0% +milliseconds it's the same as the C code +I wrote in the beginning it's not using + + align:start position:0% +I wrote in the beginning it's not using + + + align:start position:0% +I wrote in the beginning it's not using +Cindy says instruction sorry that's + + align:start position:0% +Cindy says instruction sorry that's + + + align:start position:0% +Cindy says instruction sorry that's +where the additional factors are to come + + align:start position:0% +where the additional factors are to come + + + align:start position:0% +where the additional factors are to come +but it's it's the same as the nonce MD C + + align:start position:0% +but it's it's the same as the nonce MD C + + + align:start position:0% +but it's it's the same as the nonce MD C +code and in fact if I want to use Cindy + + align:start position:0% +code and in fact if I want to use Cindy + + + align:start position:0% +code and in fact if I want to use Cindy +there's a little tag you can put in a + + align:start position:0% +there's a little tag you can put in a + + + align:start position:0% +there's a little tag you can put in a +loop to tell it's compiling this with + + align:start position:0% +loop to tell it's compiling this with + + + align:start position:0% +loop to tell it's compiling this with +LLVM you can say tell LLVM to try and + + align:start position:0% +LLVM you can say tell LLVM to try and + + + align:start position:0% +LLVM you can say tell LLVM to try and +vectorize the loop sometimes it can + + align:start position:0% +vectorize the loop sometimes it can + + + align:start position:0% +vectorize the loop sometimes it can +sometimes it can't but something like + + align:start position:0% +sometimes it can't but something like + + + align:start position:0% +sometimes it can't but something like +this it should be able to vectorize it's + + align:start position:0% +this it should be able to vectorize it's + + + align:start position:0% +this it should be able to vectorize it's +simple enough you don't need to hand + + align:start position:0% +simple enough you don't need to hand + + + align:start position:0% +simple enough you don't need to hand +code 70 instructions for a loop this + + align:start position:0% +code 70 instructions for a loop this + + + align:start position:0% +code 70 instructions for a loop this +simple yeah osya why isn't it the + + align:start position:0% +simple yeah osya why isn't it the + + + align:start position:0% +simple yeah osya why isn't it the +default because in most of the code like + + align:start position:0% +default because in most of the code like + + + align:start position:0% +default because in most of the code like +most code the compiler cannot auto auto + + align:start position:0% +most code the compiler cannot auto auto + + + align:start position:0% +most code the compiler cannot auto auto +vectorize so it increases the + + align:start position:0% +vectorize so it increases the + + + align:start position:0% +vectorize so it increases the +compilation time and like bloats that + + align:start position:0% +compilation time and like bloats that + + + align:start position:0% +compilation time and like bloats that +often blows the code size for no benefit + + align:start position:0% +often blows the code size for no benefit + + + align:start position:0% +often blows the code size for no benefit +so it's only really it's really only + + align:start position:0% +so it's only really it's really only + + + align:start position:0% +so it's only really it's really only +relatively simple loops on operating and + + align:start position:0% +relatively simple loops on operating and + + + align:start position:0% +relatively simple loops on operating and +doing simple operations and arrays that + + align:start position:0% +doing simple operations and arrays that + + + align:start position:0% +doing simple operations and arrays that +benefit from sim days so you don't want + + align:start position:0% +benefit from sim days so you don't want + + + align:start position:0% +benefit from sim days so you don't want +it to be there yeah so now it's it's 4.3 + + align:start position:0% +it to be there yeah so now it's it's 4.3 + + + align:start position:0% +it to be there yeah so now it's it's 4.3 +milliseconds so it's about the same as + + align:start position:0% +milliseconds so it's about the same as + + + align:start position:0% +milliseconds so it's about the same as +the as the the numpy and so forth it's a + + align:start position:0% +the as the the numpy and so forth it's a + + + align:start position:0% +the as the the numpy and so forth it's a +little slower than the numpy it's + + align:start position:0% +little slower than the numpy it's + + + align:start position:0% +little slower than the numpy it's +interesting a year ago when I tried this + + align:start position:0% +interesting a year ago when I tried this + + + align:start position:0% +interesting a year ago when I tried this +it was almost exactly the same speed as + + align:start position:0% +it was almost exactly the same speed as + + + align:start position:0% +it was almost exactly the same speed as +the numpy and then since then both the + + align:start position:0% +the numpy and then since then both the + + + align:start position:0% +the numpy and then since then both the +numpy and the julie have gotten better + + align:start position:0% +numpy and the julie have gotten better + + + align:start position:0% +numpy and the julie have gotten better +but the number I got better more so + + align:start position:0% +but the number I got better more so + + + align:start position:0% +but the number I got better more so +there's something going on with + + align:start position:0% +there's something going on with + + + align:start position:0% +there's something going on with +basically how well the compiler can use + + align:start position:0% +basically how well the compiler can use + + + align:start position:0% +basically how well the compiler can use +AVX instructions by it seems like we're + + align:start position:0% +AVX instructions by it seems like we're + + + align:start position:0% +AVX instructions by it seems like we're +still investigating what that is but + + align:start position:0% +still investigating what that is but + + + align:start position:0% +still investigating what that is but +it's an LOV M limitation looks like so + + align:start position:0% +it's an LOV M limitation looks like so + + + align:start position:0% +it's an LOV M limitation looks like so +and is it + + align:start position:0% +and is it + + + align:start position:0% +and is it +still completely tech generic so if I + + align:start position:0% +still completely tech generic so if I + + + align:start position:0% +still completely tech generic so if I +make a random array of complex numbers + + align:start position:0% +make a random array of complex numbers + + + align:start position:0% +make a random array of complex numbers +and that I I sum them to call it my + + align:start position:0% +and that I I sum them to call it my + + + align:start position:0% +and that I I sum them to call it my +which one am i calling now am i calling + + align:start position:0% +which one am i calling now am i calling + + + align:start position:0% +which one am i calling now am i calling +the vector my son is the vectorized one + + align:start position:0% +the vector my son is the vectorized one + + + align:start position:0% +the vector my son is the vectorized one +right so complex numbers each complex + + align:start position:0% +right so complex numbers each complex + + + align:start position:0% +right so complex numbers each complex +number is two floating point numbers it + + align:start position:0% +number is two floating point numbers it + + + align:start position:0% +number is two floating point numbers it +should take about twice the time you two + + align:start position:0% +should take about twice the time you two + + + align:start position:0% +should take about twice the time you two +naively think right so twice the number + + align:start position:0% +naively think right so twice the number + + + align:start position:0% +naively think right so twice the number +of operations to add the same number of + + align:start position:0% +of operations to add the same number of + + + align:start position:0% +of operations to add the same number of +complex numbers as seen over real + + align:start position:0% +complex numbers as seen over real + + + align:start position:0% +complex numbers as seen over real +numbers yeah and it does it takes about + + align:start position:0% +numbers yeah and it does it takes about + + + align:start position:0% +numbers yeah and it does it takes about +11 milliseconds so for 10 to the seventh + + align:start position:0% +11 milliseconds so for 10 to the seventh + + + align:start position:0% +11 milliseconds so for 10 to the seventh +which is about twice the 5 milliseconds + + align:start position:0% +which is about twice the 5 milliseconds + + + align:start position:0% +which is about twice the 5 milliseconds +it took four for the same number of real + + align:start position:0% +it took four for the same number of real + + + align:start position:0% +it took four for the same number of real +numbers and the code works for + + align:start position:0% +numbers and the code works for + + + align:start position:0% +numbers and the code works for +everything so why okay so so what's + + align:start position:0% +everything so why okay so so what's + + + align:start position:0% +everything so why okay so so what's +going on here so okay so we saw this my + + align:start position:0% +going on here so okay so we saw this my + + + align:start position:0% +going on here so okay so we saw this my +sum function I'll just take out the + + align:start position:0% +sum function I'll just take out the + + + align:start position:0% +sum function I'll just take out the +Simbi for now and we did all that okay + + align:start position:0% + + + + align:start position:0% + +okay so we're and it works for any type + + align:start position:0% +okay so we're and it works for any type + + + align:start position:0% +okay so we're and it works for any type +it doesn't even have to be an array so + + align:start position:0% +it doesn't even have to be an array so + + + align:start position:0% +it doesn't even have to be an array so +for example there's a another container + + align:start position:0% +for example there's a another container + + + align:start position:0% +for example there's a another container +type called a set in Julia which is just + + align:start position:0% +type called a set in Julia which is just + + + align:start position:0% +type called a set in Julia which is just +an unordered collection of unique + + align:start position:0% +an unordered collection of unique + + + align:start position:0% +an unordered collection of unique +elements but you can also loop over it + + align:start position:0% +elements but you can also loop over it + + + align:start position:0% +elements but you can also loop over it +if it's a set of integers you you can + + align:start position:0% +if it's a set of integers you you can + + + align:start position:0% +if it's a set of integers you you can +also sum it and I'm waiting for the + + align:start position:0% +also sum it and I'm waiting for the + + + align:start position:0% +also sum it and I'm waiting for the +benchmarks to complete so let me Alec + + align:start position:0% +benchmarks to complete so let me Alec + + + align:start position:0% +benchmarks to complete so let me Alec +ate a set and there's no type + + align:start position:0% +ate a set and there's no type + + + align:start position:0% +ate a set and there's no type +declarations here they like mine some a + + align:start position:0% +declarations here they like mine some a + + + align:start position:0% +declarations here they like mine some a +there was no a has to be an array of + + align:start position:0% +there was no a has to be an array of + + + align:start position:0% +there was no a has to be an array of +particular type or even it doesn't even + + align:start position:0% +particular type or even it doesn't even + + + align:start position:0% +particular type or even it doesn't even +have to be an array all right so a set + + align:start position:0% +have to be an array all right so a set + + + align:start position:0% +have to be an array all right so a set +is a different data structure and it's + + align:start position:0% +is a different data structure and it's + + + align:start position:0% +is a different data structure and it's +and so it's a set of integers I can it's + + align:start position:0% +and so it's a set of integers I can it's + + + align:start position:0% +and so it's a set of integers I can it's +a sets are unique so if I add if I add + + align:start position:0% +a sets are unique so if I add if I add + + + align:start position:0% +a sets are unique so if I add if I add +something to already this set it's in + + align:start position:0% +something to already this set it's in + + + align:start position:0% +something to already this set it's in +there it won't it won't add it twice and + + align:start position:0% +there it won't it won't add it twice and + + + align:start position:0% +there it won't it won't add it twice and +it supports the fast + + align:start position:0% +it supports the fast + + + align:start position:0% +it supports the fast +checking if you know is two in the set + + align:start position:0% +checking if you know is two in the set + + + align:start position:0% +checking if you know is two in the set +is three in the set doesn't have to look + + align:start position:0% +is three in the set doesn't have to look + + + align:start position:0% +is three in the set doesn't have to look +through all the elements it's a hash + + align:start position:0% +through all the elements it's a hash + + + align:start position:0% +through all the elements it's a hash +internally but I can call my my sum + + align:start position:0% +internally but I can call my my sum + + + align:start position:0% +internally but I can call my my sum +function on it and it sums up to plus + + align:start position:0% +function on it and it sums up to plus + + + align:start position:0% +function on it and it sums up to plus +seventeen plus six but 24 which is + + align:start position:0% +seventeen plus six but 24 which is + + + align:start position:0% +seventeen plus six but 24 which is +hopefully 49 + + align:start position:0% +hopefully 49 + + + align:start position:0% +hopefully 49 +all right so okay so what's going on + + align:start position:0% +all right so okay so what's going on + + + align:start position:0% +all right so okay so what's going on +here so suppose you two find the key one + + align:start position:0% +here so suppose you two find the key one + + + align:start position:0% +here so suppose you two find the key one +of the keys to several things are going + + align:start position:0% +of the keys to several things are going + + + align:start position:0% +of the keys to several things are going +on to make Julia fess so what one key + + align:start position:0% +on to make Julia fess so what one key + + + align:start position:0% +on to make Julia fess so what one key +thing is that when you have a function + + align:start position:0% +thing is that when you have a function + + + align:start position:0% +thing is that when you have a function +like this my sum or even here's a + + align:start position:0% +like this my sum or even here's a + + + align:start position:0% +like this my sum or even here's a +simpler function f of x equals x plus + + align:start position:0% +simpler function f of x equals x plus + + + align:start position:0% +simpler function f of x equals x plus +one when I call it with a particular + + align:start position:0% +one when I call it with a particular + + + align:start position:0% +one when I call it with a particular +type of argument like an integer or an + + align:start position:0% +type of argument like an integer or an + + + align:start position:0% +type of argument like an integer or an +array of integers or whatever then it it + + align:start position:0% +array of integers or whatever then it it + + + align:start position:0% +array of integers or whatever then it it +compiles a specialized version of that + + align:start position:0% +compiles a specialized version of that + + + align:start position:0% +compiles a specialized version of that +for that type + + align:start position:0% +for that type + + + align:start position:0% +for that type +so here's f of x equals x plus one it + + align:start position:0% +so here's f of x equals x plus one it + + + align:start position:0% +so here's f of x equals x plus one it +works on any type supporting plus so if + + align:start position:0% +works on any type supporting plus so if + + + align:start position:0% +works on any type supporting plus so if +I call F of three so here I'm passing a + + align:start position:0% +I call F of three so here I'm passing a + + + align:start position:0% +I call F of three so here I'm passing a +64-bit integer when it did that it says + + align:start position:0% +64-bit integer when it did that it says + + + align:start position:0% +64-bit integer when it did that it says +okay X is a 64-bit integer I mean I want + + align:start position:0% +okay X is a 64-bit integer I mean I want + + + align:start position:0% +okay X is a 64-bit integer I mean I want +to sit on a compiled a specialized + + align:start position:0% +to sit on a compiled a specialized + + + align:start position:0% +to sit on a compiled a specialized +version of F with that with that + + align:start position:0% +version of F with that with that + + + align:start position:0% +version of F with that with that +knowledge and then when I call with a + + align:start position:0% +knowledge and then when I call with a + + + align:start position:0% +knowledge and then when I call with a +different type 3.10 now X is a + + align:start position:0% +different type 3.10 now X is a + + + align:start position:0% +different type 3.10 now X is a +floating-point number it'll compile a + + align:start position:0% +floating-point number it'll compile a + + + align:start position:0% +floating-point number it'll compile a +specialized version with that value if I + + align:start position:0% +specialized version with that value if I + + + align:start position:0% +specialized version with that value if I +call with another integer it says oh + + align:start position:0% +call with another integer it says oh + + + align:start position:0% +call with another integer it says oh +that version was already compiled as + + align:start position:0% +that version was already compiled as + + + align:start position:0% +that version was already compiled as +well we use it so it only composite the + + align:start position:0% +well we use it so it only composite the + + + align:start position:0% +well we use it so it only composite the +first time you call it with a particular + + align:start position:0% +first time you call it with a particular + + + align:start position:0% +first time you call it with a particular +type if I call with a string it'll give + + align:start position:0% +type if I call with a string it'll give + + + align:start position:0% +type if I call with a string it'll give +an error because it doesn't know how to + + align:start position:0% +an error because it doesn't know how to + + + align:start position:0% +an error because it doesn't know how to +add plus to a string so it's in + + align:start position:0% +add plus to a string so it's in + + + align:start position:0% +add plus to a string so it's in +particular okay so what is it what is + + align:start position:0% +particular okay so what is it what is + + + align:start position:0% +particular okay so what is it what is +going on so we can actually look at the + + align:start position:0% +going on so we can actually look at the + + + align:start position:0% +going on so we can actually look at the +compiled code system called code this + + align:start position:0% +compiled code system called code this + + + align:start position:0% +compiled code system called code this +function is called code these macros + + align:start position:0% +function is called code these macros + + + align:start position:0% +function is called code these macros +called cold LLVM and code native let's + + align:start position:0% +called cold LLVM and code native let's + + + align:start position:0% +called cold LLVM and code native let's +say okay when I call F of 1 + + align:start position:0% +say okay when I call F of 1 + + + align:start position:0% +say okay when I call F of 1 +what's the lm-2 people know what LLVM is + + align:start position:0% +what's the lm-2 people know what LLVM is + + + align:start position:0% +what's the lm-2 people know what LLVM is +you guys okay so so LVM right compiles + + align:start position:0% +you guys okay so so LVM right compiles + + + align:start position:0% +you guys okay so so LVM right compiles +to bytecode first and that goes to + + align:start position:0% +to bytecode first and that goes to + + + align:start position:0% +to bytecode first and that goes to +machine code so you can see the LLVM bit + + align:start position:0% +machine code so you can see the LLVM bit + + + align:start position:0% +machine code so you can see the LLVM bit +code or bytecode or whatever it's called + + align:start position:0% +code or bytecode or whatever it's called + + + align:start position:0% +code or bytecode or whatever it's called +and you can sell to see the native + + align:start position:0% +and you can sell to see the native + + + align:start position:0% +and you can sell to see the native +machine code so here's the LVM bytecode + + align:start position:0% +machine code so here's the LVM bytecode + + + align:start position:0% +machine code so here's the LVM bytecode +for it compels to if everyone so it's a + + align:start position:0% +for it compels to if everyone so it's a + + + align:start position:0% +for it compels to if everyone so it's a +it's bit called a die 64 0 it caused one + + align:start position:0% +it's bit called a die 64 0 it caused one + + + align:start position:0% +it's bit called a die 64 0 it caused one +basically one nella VM instruction which + + align:start position:0% +basically one nella VM instruction which + + + align:start position:0% +basically one nella VM instruction which +turns into one machine instruction l + + align:start position:0% +turns into one machine instruction l + + + align:start position:0% +turns into one machine instruction l +load effective address is actually a + + align:start position:0% +load effective address is actually a + + + align:start position:0% +load effective address is actually a +64-bit Edition function is an + + align:start position:0% +64-bit Edition function is an + + + align:start position:0% +64-bit Edition function is an +instruction + + align:start position:0% +instruction + + + align:start position:0% +instruction +so let's think about what had to happen + + align:start position:0% +so let's think about what had to happen + + + align:start position:0% +so let's think about what had to happen +there so if you have f of x equals x + + align:start position:0% +there so if you have f of x equals x + + + align:start position:0% +there so if you have f of x equals x +plus 1 now compile if I don't compile + + align:start position:0% +plus 1 now compile if I don't compile + + + align:start position:0% +plus 1 now compile if I don't compile +for X is is a in 64 so 60 64 bit integer + + align:start position:0% +for X is is a in 64 so 60 64 bit integer + + + align:start position:0% +for X is is a in 64 so 60 64 bit integer +or a Julia we'd say X : : in 64 that's + + align:start position:0% +or a Julia we'd say X : : in 64 that's + + + align:start position:0% +or a Julia we'd say X : : in 64 that's +the : call means this is this is of this + + align:start position:0% +the : call means this is this is of this + + + align:start position:0% +the : call means this is this is of this +type okay so this is 64-bit integer type + + align:start position:0% +type okay so this is 64-bit integer type + + + align:start position:0% +type okay so this is 64-bit integer type +so what I just have to do it first has + + align:start position:0% +so what I just have to do it first has + + + align:start position:0% +so what I just have to do it first has +to figure out what plus function to + + align:start position:0% +to figure out what plus function to + + + align:start position:0% +to figure out what plus function to +cause a plus MIDI there's a plus for two + + align:start position:0% +cause a plus MIDI there's a plus for two + + + align:start position:0% +cause a plus MIDI there's a plus for two +matrices a plus for a lots of different + + align:start position:0% +matrices a plus for a lots of different + + + align:start position:0% +matrices a plus for a lots of different +things and so depending on the types of + + align:start position:0% +things and so depending on the types of + + + align:start position:0% +things and so depending on the types of +the arguments it decides on which plus + + align:start position:0% +the arguments it decides on which plus + + + align:start position:0% +the arguments it decides on which plus +function to call so so it first realizes + + align:start position:0% +function to call so so it first realizes + + + align:start position:0% +function to call so so it first realizes +oh this is an integer oh this is an + + align:start position:0% +oh this is an integer oh this is an + + + align:start position:0% +oh this is an integer oh this is an +integer this is also a suitable integer + + align:start position:0% +integer this is also a suitable integer + + + align:start position:0% +integer this is also a suitable integer +so that means a sound a call the plus + + align:start position:0% +so that means a sound a call the plus + + + align:start position:0% +so that means a sound a call the plus +function for two integers so I'm gonna + + align:start position:0% +function for two integers so I'm gonna + + + align:start position:0% +function for two integers so I'm gonna +look into that function and then oh that + + align:start position:0% +look into that function and then oh that + + + align:start position:0% +look into that function and then oh that +one returns and in 64 so that's the + + align:start position:0% +one returns and in 64 so that's the + + + align:start position:0% +one returns and in 64 so that's the +return value for my function and oh by + + align:start position:0% +return value for my function and oh by + + + align:start position:0% +return value for my function and oh by +the way this function is so simple that + + align:start position:0% +the way this function is so simple that + + + align:start position:0% +the way this function is so simple that +I'm gonna inline it so it's it's its + + align:start position:0% +I'm gonna inline it so it's it's its + + + align:start position:0% +I'm gonna inline it so it's it's its +type specializing and this process of + + align:start position:0% +type specializing and this process of + + + align:start position:0% +type specializing and this process of +going from X is an integer to that to + + align:start position:0% +going from X is an integer to that to + + + align:start position:0% +going from X is an integer to that to +figuring out the type of the output is + + align:start position:0% +figuring out the type of the output is + + + align:start position:0% +figuring out the type of the output is +called type inference okay so in general + + align:start position:0% +called type inference okay so in general + + + align:start position:0% +called type inference okay so in general +for type inference + + align:start position:0% + + + + align:start position:0% + +is is you know given the types of the + + align:start position:0% +is is you know given the types of the + + + align:start position:0% +is is you know given the types of the +inputs it tries to infer the types of + + align:start position:0% +inputs it tries to infer the types of + + + align:start position:0% +inputs it tries to infer the types of +the outputs and in fact all intermediate + + align:start position:0% +the outputs and in fact all intermediate + + + align:start position:0% +the outputs and in fact all intermediate +values as well now what makes it a + + align:start position:0% +values as well now what makes it a + + + align:start position:0% +values as well now what makes it a +dynamic language is this can fail so in + + align:start position:0% +dynamic language is this can fail so in + + + align:start position:0% +dynamic language is this can fail so in +some languages like ml or some of the + + align:start position:0% +some languages like ml or some of the + + + align:start position:0% +some languages like ml or some of the +languages you don't really declare types + + align:start position:0% +languages you don't really declare types + + + align:start position:0% +languages you don't really declare types +but their designs so that you give the + + align:start position:0% +but their designs so that you give the + + + align:start position:0% +but their designs so that you give the +types of the inputs it can figure it + + align:start position:0% +types of the inputs it can figure it + + + align:start position:0% +types of the inputs it can figure it +everything and if it can't figure out + + align:start position:0% +everything and if it can't figure out + + + align:start position:0% +everything and if it can't figure out +everything it gives it gives an error + + align:start position:0% +everything it gives it gives an error + + + align:start position:0% +everything it gives it gives an error +basically it has to it has to do it for + + align:start position:0% +basically it has to it has to do it for + + + align:start position:0% +basically it has to it has to do it for +everything so Julia is a dynamic + + align:start position:0% +everything so Julia is a dynamic + + + align:start position:0% +everything so Julia is a dynamic +language this can fail and it have a + + align:start position:0% +language this can fail and it have a + + + align:start position:0% +language this can fail and it have a +fallback of C if it doesn't know the + + align:start position:0% +fallback of C if it doesn't know the + + + align:start position:0% +fallback of C if it doesn't know the +type it gets six things in a box but + + align:start position:0% +type it gets six things in a box but + + + align:start position:0% +type it gets six things in a box but +obviously the fast path is when it + + align:start position:0% +obviously the fast path is when it + + + align:start position:0% +obviously the fast path is when it +exceeds the succeeds and one of the key + + align:start position:0% +exceeds the succeeds and one of the key + + + align:start position:0% +exceeds the succeeds and one of the key +things is you have to try and make this + + align:start position:0% +things is you have to try and make this + + + align:start position:0% +things is you have to try and make this +kind of thing work in a language you + + align:start position:0% +kind of thing work in a language you + + + align:start position:0% +kind of thing work in a language you +have to design the language so that the + + align:start position:0% +have to design the language so that the + + + align:start position:0% +have to design the language so that the +release further all the built in + + align:start position:0% +release further all the built in + + + align:start position:0% +release further all the built in +constructs the standard library or in + + align:start position:0% +constructs the standard library or in + + + align:start position:0% +constructs the standard library or in +general in the culture for people + + align:start position:0% +general in the culture for people + + + align:start position:0% +general in the culture for people +designing designing packages and so + + align:start position:0% +designing designing packages and so + + + align:start position:0% +designing designing packages and so +forth that you think to to to design + + align:start position:0% +forth that you think to to to design + + + align:start position:0% +forth that you think to to to design +things so that this type inference can + + align:start position:0% +things so that this type inference can + + + align:start position:0% +things so that this type inference can +succeed and I'll give a counter example + + align:start position:0% +succeed and I'll give a counter example + + + align:start position:0% +succeed and I'll give a counter example +to that in a minute right so and this + + align:start position:0% +to that in a minute right so and this + + + align:start position:0% +to that in a minute right so and this +works recursively so it's not suppose I + + align:start position:0% +works recursively so it's not suppose I + + + align:start position:0% +works recursively so it's not suppose I +define a function G of x equals f of X + + align:start position:0% +define a function G of x equals f of X + + + align:start position:0% +define a function G of x equals f of X +times 2 okay and then I call G of 1 so + + align:start position:0% +times 2 okay and then I call G of 1 so + + + align:start position:0% +times 2 okay and then I call G of 1 so +it's gonna say okay X here is an integer + + align:start position:0% +it's gonna say okay X here is an integer + + + align:start position:0% +it's gonna say okay X here is an integer +okay I'm gonna call F with an integer + + align:start position:0% +okay I'm gonna call F with an integer + + + align:start position:0% +okay I'm gonna call F with an integer +argument oh I should compile F for an + + align:start position:0% +argument oh I should compile F for an + + + align:start position:0% +argument oh I should compile F for an +integer argument figure it's return type + + align:start position:0% +integer argument figure it's return type + + + align:start position:0% +integer argument figure it's return type +use its return to have to figure out + + align:start position:0% +use its return to have to figure out + + + align:start position:0% +use its return to have to figure out +what x function to call and and it had + + align:start position:0% +what x function to call and and it had + + + align:start position:0% +what x function to call and and it had +doing and do all this at compile time + + align:start position:0% +doing and do all this at compile time + + + align:start position:0% +doing and do all this at compile time +right not at not at run time ideally so + + align:start position:0% +right not at not at run time ideally so + + + align:start position:0% +right not at not at run time ideally so +we can look at the elleven code for this + + align:start position:0% +we can look at the elleven code for this + + + align:start position:0% +we can look at the elleven code for this +and in fact so so this is remember f of + + align:start position:0% +and in fact so so this is remember f of + + + align:start position:0% +and in fact so so this is remember f of +X adds 1 to X and then we're telling x 2 + + align:start position:0% +X adds 1 to X and then we're telling x 2 + + + align:start position:0% +X adds 1 to X and then we're telling x 2 +so the result computes 2 X plus 2 and + + align:start position:0% +so the result computes 2 X plus 2 and + + + align:start position:0% +so the result computes 2 X plus 2 and +LLVM is smart enough so in F is so + + align:start position:0% +LLVM is smart enough so in F is so + + + align:start position:0% +LLVM is smart enough so in F is so +simple that it in lines it and then LLVM + + align:start position:0% +simple that it in lines it and then LLVM + + + align:start position:0% +simple that it in lines it and then LLVM +is smart enough that I don't have to + + align:start position:0% +is smart enough that I don't have to + + + align:start position:0% +is smart enough that I don't have to +well I know it does it by one shift + + align:start position:0% +well I know it does it by one shift + + + align:start position:0% +well I know it does it by one shift +instruction to multiply X by two and + + align:start position:0% +instruction to multiply X by two and + + + align:start position:0% +instruction to multiply X by two and +then it adds two so it actually combines + + align:start position:0% +then it adds two so it actually combines + + + align:start position:0% +then it adds two so it actually combines +the x two and the plus one it does + + align:start position:0% +the x two and the plus one it does + + + align:start position:0% +the x two and the plus one it does +constant folding okay + + align:start position:0% +constant folding okay + + + align:start position:0% +constant folding okay +and you can continue on if you look at H + + align:start position:0% +and you can continue on if you look at H + + + align:start position:0% +and you can continue on if you look at H +of X equals G of X tends to then it that + + align:start position:0% +of X equals G of X tends to then it that + + + align:start position:0% +of X equals G of X tends to then it that +compiles to shift one shift instruction + + align:start position:0% +compiles to shift one shift instruction + + + align:start position:0% +compiles to shift one shift instruction +to multiply X by four and then adding + + align:start position:0% +to multiply X by four and then adding + + + align:start position:0% +to multiply X by four and then adding +four so you see you want this so this + + align:start position:0% +four so you see you want this so this + + + align:start position:0% +four so you see you want this so this +process Cascades so and you can even do + + align:start position:0% +process Cascades so and you can even do + + + align:start position:0% +process Cascades so and you can even do +it for a recursive function so here's a + + align:start position:0% +it for a recursive function so here's a + + + align:start position:0% +it for a recursive function so here's a +stupid implementation of a Fibonacci + + align:start position:0% +stupid implementation of a Fibonacci + + + align:start position:0% +stupid implementation of a Fibonacci +number calculation and recursive + + align:start position:0% +number calculation and recursive + + + align:start position:0% +number calculation and recursive +implementation right so this is given n + + align:start position:0% +implementation right so this is given n + + + align:start position:0% +implementation right so this is given n +that's must be it's an integer okay if n + + align:start position:0% +that's must be it's an integer okay if n + + + align:start position:0% +that's must be it's an integer okay if n +is less than three returns one otherwise + + align:start position:0% +is less than three returns one otherwise + + + align:start position:0% +is less than three returns one otherwise +it adds the previous two numbers I can + + align:start position:0% +it adds the previous two numbers I can + + + align:start position:0% +it adds the previous two numbers I can +compute the first call this in the first + + align:start position:0% +compute the first call this in the first + + + align:start position:0% +compute the first call this in the first +ten integers here's the first 10 + + align:start position:0% +ten integers here's the first 10 + + + align:start position:0% +ten integers here's the first 10 +Fibonacci numbers there's also in that + + align:start position:0% +Fibonacci numbers there's also in that + + + align:start position:0% +Fibonacci numbers there's also in that +acute notation and Julia can say fib dot + + align:start position:0% +acute notation and Julia can say fib dot + + + align:start position:0% +acute notation and Julia can say fib dot +so if you do F dot arguments it calls + + align:start position:0% +so if you do F dot arguments it calls + + + align:start position:0% +so if you do F dot arguments it calls +the function element wise on a + + align:start position:0% +the function element wise on a + + + align:start position:0% +the function element wise on a +collection and returns a collection so f + + align:start position:0% +collection and returns a collection so f + + + align:start position:0% +collection and returns a collection so f +dot 1 to 10 where it turns the first 10 + + align:start position:0% +dot 1 to 10 where it turns the first 10 + + + align:start position:0% +dot 1 to 10 where it turns the first 10 +Fibonacci numbers and I can call there's + + align:start position:0% +Fibonacci numbers and I can call there's + + + align:start position:0% +Fibonacci numbers and I can call there's +a function called code warren type + + align:start position:0% +a function called code warren type + + + align:start position:0% +a function called code warren type +that'll tell me what it'll tell me the + + align:start position:0% +that'll tell me what it'll tell me the + + + align:start position:0% +that'll tell me what it'll tell me the +output of type interface a type + + align:start position:0% +output of type interface a type + + + align:start position:0% +output of type interface a type +inference so a 10 is a 1 and it goes + + align:start position:0% +inference so a 10 is a 1 and it goes + + + align:start position:0% +inference so a 10 is a 1 and it goes +through this is this kind of a hard to + + align:start position:0% +through this is this kind of a hard to + + + align:start position:0% +through this is this kind of a hard to +read format but this is like the after + + align:start position:0% +read format but this is like the after + + + align:start position:0% +read format but this is like the after +like one of the compiler passes called + + align:start position:0% +like one of the compiler passes called + + + align:start position:0% +like one of the compiler passes called +lowering but yeah it's figuring out the + + align:start position:0% +lowering but yeah it's figuring out the + + + align:start position:0% +lowering but yeah it's figuring out the +types of every of every intermediate + + align:start position:0% +types of every of every intermediate + + + align:start position:0% +types of every of every intermediate +call so here is it's invoking main dot + + align:start position:0% +call so here is it's invoking main dot + + + align:start position:0% +call so here is it's invoking main dot +fib it's recursively and it's figured + + align:start position:0% +fib it's recursively and it's figured + + + align:start position:0% +fib it's recursively and it's figured +out that the type return type is Austin + + align:start position:0% +out that the type return type is Austin + + + align:start position:0% +out that the type return type is Austin +in 64 so it knows everything okay so + + align:start position:0% +in 64 so it knows everything okay so + + + align:start position:0% +in 64 so it knows everything okay so +you'll notice that I here I declared a + + align:start position:0% +you'll notice that I here I declared a + + + align:start position:0% +you'll notice that I here I declared a +type I call I said that this is an + + align:start position:0% +type I call I said that this is an + + + align:start position:0% +type I call I said that this is an +integer okay I don't have to do that for + + align:start position:0% +integer okay I don't have to do that for + + + align:start position:0% +integer okay I don't have to do that for +type in first inference this doesn't + + align:start position:0% +type in first inference this doesn't + + + align:start position:0% +type in first inference this doesn't +this doesn't help the compiler at all + + align:start position:0% +this doesn't help the compiler at all + + + align:start position:0% +this doesn't help the compiler at all +because it it does type inference + + align:start position:0% +because it it does type inference + + + align:start position:0% +because it it does type inference +depending on what I pass so what this is + + align:start position:0% +depending on what I pass so what this is + + + align:start position:0% +depending on what I pass so what this is +is it more like a filter it says that if + + align:start position:0% +is it more like a filter it says that if + + + align:start position:0% +is it more like a filter it says that if +I pass that this function only accepts + + align:start position:0% +I pass that this function only accepts + + + align:start position:0% +I pass that this function only accepts +integers if you pass something else you + + align:start position:0% +integers if you pass something else you + + + align:start position:0% +integers if you pass something else you +should throw an error like so I don't + + align:start position:0% +should throw an error like so I don't + + + align:start position:0% +should throw an error like so I don't +want this function because if I pass + + align:start position:0% +want this function because if I pass + + + align:start position:0% +want this function because if I pass +three point seven right if I don't fill + + align:start position:0% +three point seven right if I don't fill + + + align:start position:0% +three point seven right if I don't fill +out any number if you look at the you + + align:start position:0% +out any number if you look at the you + + + align:start position:0% +out any number if you look at the you +know three point seven I can check + + align:start position:0% +know three point seven I can check + + + align:start position:0% +know three point seven I can check +whether it's less than three it can call + + align:start position:0% +whether it's less than three it can call + + + align:start position:0% +whether it's less than three it can call +it recursively I mean + + align:start position:0% +it recursively I mean + + + align:start position:0% +it recursively I mean +the the function would run it would just + + align:start position:0% +the the function would run it would just + + + align:start position:0% +the the function would run it would just +give nonsense all right side i want to + + align:start position:0% +give nonsense all right side i want to + + + align:start position:0% +give nonsense all right side i want to +prevent someone from passing nonsense + + align:start position:0% +prevent someone from passing nonsense + + + align:start position:0% +prevent someone from passing nonsense +for this so that's one reason to do a + + align:start position:0% +for this so that's one reason to do a + + + align:start position:0% +for this so that's one reason to do a +type declaration but another region + + align:start position:0% +type declaration but another region + + + align:start position:0% +type declaration but another region +reason is to do something called + + align:start position:0% +reason is to do something called + + + align:start position:0% +reason is to do something called +dispatch so what we can do is we can + + align:start position:0% +dispatch so what we can do is we can + + + align:start position:0% +dispatch so what we can do is we can +define different versions of a function + + align:start position:0% +define different versions of a function + + + align:start position:0% +define different versions of a function +for different arguments so for example + + align:start position:0% +for different arguments so for example + + + align:start position:0% +for different arguments so for example +another nicer version of that is a + + align:start position:0% +another nicer version of that is a + + + align:start position:0% +another nicer version of that is a +factorial function so here is a stupid + + align:start position:0% +factorial function so here is a stupid + + + align:start position:0% +factorial function so here is a stupid +stupid recursive implementation of a + + align:start position:0% +stupid recursive implementation of a + + + align:start position:0% +stupid recursive implementation of a +vectorial function it takes an integer + + align:start position:0% +vectorial function it takes an integer + + + align:start position:0% +vectorial function it takes an integer +argument and just recursively calls + + align:start position:0% +argument and just recursively calls + + + align:start position:0% +argument and just recursively calls +itself on n minus 1 so you can call it + + align:start position:0% +itself on n minus 1 so you can call it + + + align:start position:0% +itself on n minus 1 so you can call it +on 10 factorial okay if I want a hundred + + align:start position:0% +on 10 factorial okay if I want a hundred + + + align:start position:0% +on 10 factorial okay if I want a hundred +factorial I need to use a different type + + align:start position:0% +factorial I need to use a different type + + + align:start position:0% +factorial I need to use a different type +that 64-bit integers I need some + + align:start position:0% +that 64-bit integers I need some + + + align:start position:0% +that 64-bit integers I need some +arbitrary precision integer and and + + align:start position:0% +arbitrary precision integer and and + + + align:start position:0% +arbitrary precision integer and and +since since I said it was an integer if + + align:start position:0% +since since I said it was an integer if + + + align:start position:0% +since since I said it was an integer if +I call it 3.7 it'll give and it'll give + + align:start position:0% +I call it 3.7 it'll give and it'll give + + + align:start position:0% +I call it 3.7 it'll give and it'll give +an error that's good but now I can + + align:start position:0% +an error that's good but now I can + + + align:start position:0% +an error that's good but now I can +define a different version of this so + + align:start position:0% +define a different version of this so + + + align:start position:0% +define a different version of this so +actually there isn't definitely there is + + align:start position:0% +actually there isn't definitely there is + + + align:start position:0% +actually there isn't definitely there is +a generalization of factorial to two + + align:start position:0% +a generalization of factorial to two + + + align:start position:0% +a generalization of factorial to two +arbitrary real in fact even complex + + align:start position:0% +arbitrary real in fact even complex + + + align:start position:0% +arbitrary real in fact even complex +numbers call the gamut function and so I + + align:start position:0% +numbers call the gamut function and so I + + + align:start position:0% +numbers call the gamut function and so I +can define a fallback that works for any + + align:start position:0% +can define a fallback that works for any + + + align:start position:0% +can define a fallback that works for any +type of number and it calls a gamma + + align:start position:0% +type of number and it calls a gamma + + + align:start position:0% +type of number and it calls a gamma +function from someplace else and then + + align:start position:0% +function from someplace else and then + + + align:start position:0% +function from someplace else and then +then if I can pass it a floating point + + align:start position:0% +then if I can pass it a floating point + + + align:start position:0% +then if I can pass it a floating point +value I can if you if you take the + + align:start position:0% +value I can if you if you take the + + + align:start position:0% +value I can if you if you take the +factorial of minus minus 1/2 it turns + + align:start position:0% +factorial of minus minus 1/2 it turns + + + align:start position:0% +factorial of minus minus 1/2 it turns +out that's actually square root of pi so + + align:start position:0% +out that's actually square root of pi so + + + align:start position:0% +out that's actually square root of pi so +if I square it it gives PI all right so + + align:start position:0% +if I square it it gives PI all right so + + + align:start position:0% +if I square it it gives PI all right so +so now I have one function and I have + + align:start position:0% +so now I have one function and I have + + + align:start position:0% +so now I have one function and I have +two methods all right so so these types + + align:start position:0% +two methods all right so so these types + + + align:start position:0% +two methods all right so so these types +here so there's a hierarchy of type so + + align:start position:0% +here so there's a hierarchy of type so + + + align:start position:0% +here so there's a hierarchy of type so +so this is this is what's called an + + align:start position:0% +so this is this is what's called an + + + align:start position:0% +so this is this is what's called an +abstract type it's most of you probably + + align:start position:0% +abstract type it's most of you probably + + + align:start position:0% +abstract type it's most of you probably +seen like so there's a type called + + align:start position:0% +seen like so there's a type called + + + align:start position:0% +seen like so there's a type called +number and underneath there's a class of + + align:start position:0% +number and underneath there's a class of + + + align:start position:0% +number and underneath there's a class of +subtypes called integer and underneath + + align:start position:0% +subtypes called integer and underneath + + + align:start position:0% +subtypes called integer and underneath +there's for example 8 64 or int 8 for 8 + + align:start position:0% +there's for example 8 64 or int 8 for 8 + + + align:start position:0% +there's for example 8 64 or int 8 for 8 +bit or 64 bit integers underneath number + + align:start position:0% +bit or 64 bit integers underneath number + + + align:start position:0% +bit or 64 bit integers underneath number +there's there's actually another sub + + align:start position:0% +there's there's actually another sub + + + align:start position:0% +there's there's actually another sub +type Pole real and underneath that + + align:start position:0% +type Pole real and underneath that + + + align:start position:0% +type Pole real and underneath that +there's a couple sub types and then + + align:start position:0% +there's a couple sub types and then + + + align:start position:0% +there's a couple sub types and then +there's + + align:start position:0% +there's + + + align:start position:0% +there's +they say float64 our or float32 + + align:start position:0% +they say float64 our or float32 + + + align:start position:0% +they say float64 our or float32 +for for a a single precision 32-bit + + align:start position:0% +for for a a single precision 32-bit + + + align:start position:0% +for for a a single precision 32-bit +floating-point number and so forth so + + align:start position:0% +floating-point number and so forth so + + + align:start position:0% +floating-point number and so forth so +there's a hierarchy of these things when + + align:start position:0% +there's a hierarchy of these things when + + + align:start position:0% +there's a hierarchy of these things when +I specify something can take integer I'm + + align:start position:0% +I specify something can take integer I'm + + + align:start position:0% +I specify something can take integer I'm +just saying it so this type has not + + align:start position:0% +just saying it so this type has not + + + align:start position:0% +just saying it so this type has not +helped the compilers to help it's to + + align:start position:0% +helped the compilers to help it's to + + + align:start position:0% +helped the compilers to help it's to +provide a filter says this vert this + + align:start position:0% +provide a filter says this vert this + + + align:start position:0% +provide a filter says this vert this +method only works for these types and + + align:start position:0% +method only works for these types and + + + align:start position:0% +method only works for these types and +then this this other method only where + + align:start position:0% +then this this other method only where + + + align:start position:0% +then this this other method only where +it works this my second method works for + + align:start position:0% +it works this my second method works for + + + align:start position:0% +it works this my second method works for +any number type so I have one Martha + + align:start position:0% +any number type so I have one Martha + + + align:start position:0% +any number type so I have one Martha +that works for any number type of series + + align:start position:0% +that works for any number type of series + + + align:start position:0% +that works for any number type of series +one method that works for any number + + align:start position:0% +one method that works for any number + + + align:start position:0% +one method that works for any number +type and one metric method that only + + align:start position:0% +type and one metric method that only + + + align:start position:0% +type and one metric method that only +works for integers so when I call it for + + align:start position:0% +works for integers so when I call it for + + + align:start position:0% +works for integers so when I call it for +3 which ones does it call because + + align:start position:0% +3 which ones does it call because + + + align:start position:0% +3 which ones does it call because +they're actually called both methods and + + align:start position:0% +they're actually called both methods and + + + align:start position:0% +they're actually called both methods and +what it does is it calls the most + + align:start position:0% +what it does is it calls the most + + + align:start position:0% +what it does is it calls the most +specific one it calls the one that's + + align:start position:0% +specific one it calls the one that's + + + align:start position:0% +specific one it calls the one that's +sort of farthest down the tree so fair + + align:start position:0% +sort of farthest down the tree so fair + + + align:start position:0% +sort of farthest down the tree so fair +so if the so if I have a method is + + align:start position:0% +so if the so if I have a method is + + + align:start position:0% +so if the so if I have a method is +defined for a number and one for defined + + align:start position:0% +defined for a number and one for defined + + + align:start position:0% +defined for a number and one for defined +for integer if I passed an energy little + + align:start position:0% +for integer if I passed an energy little + + + align:start position:0% +for integer if I passed an energy little +do this if I've one that's defined for + + align:start position:0% +do this if I've one that's defined for + + + align:start position:0% +do this if I've one that's defined for +number one that's defined by integer and + + align:start position:0% +number one that's defined by integer and + + + align:start position:0% +number one that's defined by integer and +one that's defined specifically for int + + align:start position:0% +one that's defined specifically for int + + + align:start position:0% +one that's defined specifically for int +eight and I call it a pass an 8-bit + + align:start position:0% +eight and I call it a pass an 8-bit + + + align:start position:0% +eight and I call it a pass an 8-bit +integer it'll call that version all + + align:start position:0% +integer it'll call that version all + + + align:start position:0% +integer it'll call that version all +right so it gives you a filter but in + + align:start position:0% +right so it gives you a filter but in + + + align:start position:0% +right so it gives you a filter but in +general you can do this on multiple + + align:start position:0% +general you can do this on multiple + + + align:start position:0% +general you can do this on multiple +argument so this is like the key + + align:start position:0% +argument so this is like the key + + + align:start position:0% +argument so this is like the key +abstraction and Julia something called + + align:start position:0% +abstraction and Julia something called + + + align:start position:0% +abstraction and Julia something called +multiple dispatch so this was not + + align:start position:0% +multiple dispatch so this was not + + + align:start position:0% +multiple dispatch so this was not +invented by Julia I guess it was present + + align:start position:0% +invented by Julia I guess it was present + + + align:start position:0% +invented by Julia I guess it was present +in small talk in Dillon it's it's been + + align:start position:0% +in small talk in Dillon it's it's been + + + align:start position:0% +in small talk in Dillon it's it's been +in a bunch of languages have been + + align:start position:0% +in a bunch of languages have been + + + align:start position:0% +in a bunch of languages have been +floating around for a while but it's not + + align:start position:0% +floating around for a while but it's not + + + align:start position:0% +floating around for a while but it's not +been in a lot of mainstream languages + + align:start position:0% +been in a lot of mainstream languages + + + align:start position:0% +been in a lot of mainstream languages +not in a high-performance way and you + + align:start position:0% +not in a high-performance way and you + + + align:start position:0% +not in a high-performance way and you +can think of it as a generalization of + + align:start position:0% +can think of it as a generalization of + + + align:start position:0% +can think of it as a generalization of +object-oriented programming so I'm sure + + align:start position:0% +object-oriented programming so I'm sure + + + align:start position:0% +object-oriented programming so I'm sure +all of you have done object oriented in + + align:start position:0% +all of you have done object oriented in + + + align:start position:0% +all of you have done object oriented in +Python or C++ or something like this so + + align:start position:0% +Python or C++ or something like this so + + + align:start position:0% +Python or C++ or something like this so +now tutorial programming typically the + + align:start position:0% +now tutorial programming typically the + + + align:start position:0% +now tutorial programming typically the +way you you think of it as you as you + + align:start position:0% +way you you think of it as you as you + + + align:start position:0% +way you you think of it as you as you +say you have an object it's usually + + align:start position:0% +say you have an object it's usually + + + align:start position:0% +say you have an object it's usually +spelled like object method you know X Y + + align:start position:0% +spelled like object method you know X Y + + + align:start position:0% +spelled like object method you know X Y +for example right and what it does is + + align:start position:0% +for example right and what it does is + + + align:start position:0% +for example right and what it does is +this type the object type + + align:start position:0% + + + + align:start position:0% + +determines the method right so you could + + align:start position:0% +determines the method right so you could + + + align:start position:0% +determines the method right so you could +have a method called plus and would cope + + align:start position:0% +have a method called plus and would cope + + + align:start position:0% +have a method called plus and would cope +but I would actually call a different + + align:start position:0% +but I would actually call a different + + + align:start position:0% +but I would actually call a different +plus function for a complex number or + + align:start position:0% +plus function for a complex number or + + + align:start position:0% +plus function for a complex number or +real number something like that or a + + align:start position:0% +real number something like that or a + + + align:start position:0% +real number something like that or a +method called length right which for + + align:start position:0% +method called length right which for + + + align:start position:0% +method called length right which for +Python lists would call a different + + align:start position:0% +Python lists would call a different + + + align:start position:0% +Python lists would call a different +function than for a numpy array right in + + align:start position:0% +function than for a numpy array right in + + + align:start position:0% +function than for a numpy array right in +Julia you know why he would spell the + + align:start position:0% +Julia you know why he would spell the + + + align:start position:0% +Julia you know why he would spell the +same thing would you say method Minh + + align:start position:0% +same thing would you say method Minh + + + align:start position:0% +same thing would you say method Minh +take dot method right so you don't think + + align:start position:0% +take dot method right so you don't think + + + align:start position:0% +take dot method right so you don't think +of the here you think of the object is + + align:start position:0% +of the here you think of the object is + + + align:start position:0% +of the here you think of the object is +sort of owning the method right and + + align:start position:0% +sort of owning the method right and + + + align:start position:0% +sort of owning the method right and +Julia the object would just be maybe the + + align:start position:0% +Julia the object would just be maybe the + + + align:start position:0% +Julia the object would just be maybe the +first argument in fact in fact under the + + align:start position:0% +first argument in fact in fact under the + + + align:start position:0% +first argument in fact in fact under the +hood if you're looking in Python for + + align:start position:0% +hood if you're looking in Python for + + + align:start position:0% +hood if you're looking in Python for +example the object is passed as an + + align:start position:0% +example the object is passed as an + + + align:start position:0% +example the object is passed as an +implicit first argument called self + + align:start position:0% +implicit first argument called self + + + align:start position:0% +implicit first argument called self +right so essentially how is doing this + + align:start position:0% +right so essentially how is doing this + + + align:start position:0% +right so essentially how is doing this +it's just spelling different spelling of + + align:start position:0% +it's just spelling different spelling of + + + align:start position:0% +it's just spelling different spelling of +the same thing but as soon as you write + + align:start position:0% +the same thing but as soon as you write + + + align:start position:0% +the same thing but as soon as you write +it this way you realize like what what + + align:start position:0% +it this way you realize like what what + + + align:start position:0% +it this way you realize like what what +Python and what o up languages are doing + + align:start position:0% +Python and what o up languages are doing + + + align:start position:0% +Python and what o up languages are doing +is they're looking at the type of the + + align:start position:0% +is they're looking at the type of the + + + align:start position:0% +is they're looking at the type of the +first argument determine the method but + + align:start position:0% +first argument determine the method but + + + align:start position:0% +first argument determine the method but +why just the first argument so in a + + align:start position:0% +why just the first argument so in a + + + align:start position:0% +why just the first argument so in a +multiple dispatch a language you look at + + align:start position:0% +multiple dispatch a language you look at + + + align:start position:0% +multiple dispatch a language you look at +all the types so so this is sometimes in + + align:start position:0% +all the types so so this is sometimes in + + + align:start position:0% +all the types so so this is sometimes in +Julia this will be sometimes be called + + align:start position:0% +Julia this will be sometimes be called + + + align:start position:0% +Julia this will be sometimes be called +single dispatch because this this is + + align:start position:0% +single dispatch because this this is + + + align:start position:0% +single dispatch because this this is +this determining the method is called + + align:start position:0% +this determining the method is called + + + align:start position:0% +this determining the method is called +it's called dispatch right figuring out + + align:start position:0% +it's called dispatch right figuring out + + + align:start position:0% +it's called dispatch right figuring out +which function is that spelled length + + align:start position:0% +which function is that spelled length + + + align:start position:0% +which function is that spelled length +which function actually are you calling + + align:start position:0% +which function actually are you calling + + + align:start position:0% +which function actually are you calling +this dispatching to the right function + + align:start position:0% +this dispatching to the right function + + + align:start position:0% +this dispatching to the right function +so this is called multiple dispatch + + align:start position:0% + + + + align:start position:0% + +and it's its clearest if you look at + + align:start position:0% +and it's its clearest if you look at + + + align:start position:0% +and it's its clearest if you look at +something like a plus function alright + + align:start position:0% +something like a plus function alright + + + align:start position:0% +something like a plus function alright +so a plus function alright if you do a + + align:start position:0% +so a plus function alright if you do a + + + align:start position:0% +so a plus function alright if you do a +plus B right which plus you do really + + align:start position:0% +plus B right which plus you do really + + + align:start position:0% +plus B right which plus you do really +should depend on both a and B right it + + align:start position:0% +should depend on both a and B right it + + + align:start position:0% +should depend on both a and B right it +shouldn't depend on just a or just B and + + align:start position:0% +shouldn't depend on just a or just B and + + + align:start position:0% +shouldn't depend on just a or just B and +so it's actually quite awkward in + + align:start position:0% +so it's actually quite awkward in + + + align:start position:0% +so it's actually quite awkward in +languages in oo up languages like Python + + align:start position:0% +languages in oo up languages like Python + + + align:start position:0% +languages in oo up languages like Python +or especially suppose C++ to overload a + + align:start position:0% +or especially suppose C++ to overload a + + + align:start position:0% +or especially suppose C++ to overload a +plus operation that operates on sort of + + align:start position:0% +plus operation that operates on sort of + + + align:start position:0% +plus operation that operates on sort of +mixed types as a consequence for example + + align:start position:0% +mixed types as a consequence for example + + + align:start position:0% +mixed types as a consequence for example +in C++ you know there's a built in + + align:start position:0% +in C++ you know there's a built in + + + align:start position:0% +in C++ you know there's a built in +complex number type all right so you can + + align:start position:0% +complex number type all right so you can + + + align:start position:0% +complex number type all right so you can +have a complex sing a float or complex + + align:start position:0% +have a complex sing a float or complex + + + align:start position:0% +have a complex sing a float or complex +double complex ant you know cup box with + + align:start position:0% +double complex ant you know cup box with + + + align:start position:0% +double complex ant you know cup box with +different meal types but you can't add a + + align:start position:0% +different meal types but you can't add a + + + align:start position:0% +different meal types but you can't add a +complex float to a couple X double you + + align:start position:0% +complex float to a couple X double you + + + align:start position:0% +complex float to a couple X double you +can't you can't add a single precision + + align:start position:0% +can't you can't add a single precision + + + align:start position:0% +can't you can't add a single precision +complex number to a double precision + + align:start position:0% +complex number to a double precision + + + align:start position:0% +complex number to a double precision +couples member or any mixed operation + + align:start position:0% +couples member or any mixed operation + + + align:start position:0% +couples member or any mixed operation +because any mixed complex operation + + align:start position:0% +because any mixed complex operation + + + align:start position:0% +because any mixed complex operation +because it can't figure out who owns who + + align:start position:0% +because it can't figure out who owns who + + + align:start position:0% +because it can't figure out who owns who +owns the method it doesn't have a wave + + align:start position:0% +owns the method it doesn't have a wave + + + align:start position:0% +owns the method it doesn't have a wave +of doing that kind of promotion alright + + align:start position:0% +of doing that kind of promotion alright + + + align:start position:0% +of doing that kind of promotion alright +so in and enjoy so now you can have a + + align:start position:0% +so in and enjoy so now you can have a + + + align:start position:0% +so in and enjoy so now you can have a +method for for adding a float 32 to a + + align:start position:0% +method for for adding a float 32 to a + + + align:start position:0% +method for for adding a float 32 to a +float 32 but also a method for adding a + + align:start position:0% +float 32 but also a method for adding a + + + align:start position:0% +float 32 but also a method for adding a +I don't know let's see here's adding a a + + align:start position:0% +I don't know let's see here's adding a a + + + align:start position:0% +I don't know let's see here's adding a a +complex number to a real number for + + align:start position:0% +complex number to a real number for + + + align:start position:0% +complex number to a real number for +example alright you want to specialize + + align:start position:0% +example alright you want to specialize + + + align:start position:0% +example alright you want to specialize +or a real number to a complex number you + + align:start position:0% +or a real number to a complex number you + + + align:start position:0% +or a real number to a complex number you +want to specialize things in fact we can + + align:start position:0% +want to specialize things in fact we can + + + align:start position:0% +want to specialize things in fact we can +click on the link here and see the code + + align:start position:0% +click on the link here and see the code + + + align:start position:0% +click on the link here and see the code +so complex number to a real number and + + align:start position:0% +so complex number to a real number and + + + align:start position:0% +so complex number to a real number and +Julia looks like this it's the most + + align:start position:0% +Julia looks like this it's the most + + + align:start position:0% +Julia looks like this it's the most +obvious thing it's implemented in Julia + + align:start position:0% +obvious thing it's implemented in Julia + + + align:start position:0% +obvious thing it's implemented in Julia +plus complex real creates a new complex + + align:start position:0% +plus complex real creates a new complex + + + align:start position:0% +plus complex real creates a new complex +number but you only have to add the real + + align:start position:0% +number but you only have to add the real + + + align:start position:0% +number but you only have to add the real +part you can leave the imaginary part + + align:start position:0% +part you can leave the imaginary part + + + align:start position:0% +part you can leave the imaginary part +alone and this works on any any complex + + align:start position:0% +alone and this works on any any complex + + + align:start position:0% +alone and this works on any any complex +type ok so + + align:start position:0% + + + + align:start position:0% + +ah there's too many methods for okay I + + align:start position:0% +ah there's too many methods for okay I + + + align:start position:0% +ah there's too many methods for okay I +can shrink that let's see so I can talk + + align:start position:0% +can shrink that let's see so I can talk + + + align:start position:0% +can shrink that let's see so I can talk +but there's another type inference thing + + align:start position:0% +but there's another type inference thing + + + align:start position:0% +but there's another type inference thing +called I'll just mention it briefly so + + align:start position:0% +called I'll just mention it briefly so + + + align:start position:0% +called I'll just mention it briefly so +one of the things you have to do to make + + align:start position:0% +one of the things you have to do to make + + + align:start position:0% +one of the things you have to do to make +this this this type inference process + + align:start position:0% +this this this type inference process + + + align:start position:0% +this this this type inference process +work is given the types of the arguments + + align:start position:0% +work is given the types of the arguments + + + align:start position:0% +work is given the types of the arguments +you have to figure out the type of the + + align:start position:0% +you have to figure out the type of the + + + align:start position:0% +you have to figure out the type of the +return value okay so that means when you + + align:start position:0% +return value okay so that means when you + + + align:start position:0% +return value okay so that means when you +design a function we yeah it has to be + + align:start position:0% +design a function we yeah it has to be + + + align:start position:0% +design a function we yeah it has to be +what's called type stable that the the + + align:start position:0% +what's called type stable that the the + + + align:start position:0% +what's called type stable that the the +type of the results should depend on the + + align:start position:0% +type of the results should depend on the + + + align:start position:0% +type of the results should depend on the +types of the arguments and not on the + + align:start position:0% +types of the arguments and not on the + + + align:start position:0% +types of the arguments and not on the +values of the arguments because the + + align:start position:0% +values of the arguments because the + + + align:start position:0% +values of the arguments because the +types are known at compile time the + + align:start position:0% +types are known at compile time the + + + align:start position:0% +types are known at compile time the +values are only known at runtime and it + + align:start position:0% +values are only known at runtime and it + + + align:start position:0% +values are only known at runtime and it +turns out if you know if you don't have + + align:start position:0% +turns out if you know if you don't have + + + align:start position:0% +turns out if you know if you don't have +this in mind I mean in C of no choice + + align:start position:0% +this in mind I mean in C of no choice + + + align:start position:0% +this in mind I mean in C of no choice +but to obey this but it's something like + + align:start position:0% +but to obey this but it's something like + + + align:start position:0% +but to obey this but it's something like +Python a dynamic language at python and + + align:start position:0% +Python a dynamic language at python and + + + align:start position:0% +Python a dynamic language at python and +matlab if you're not thinking about this + + align:start position:0% +matlab if you're not thinking about this + + + align:start position:0% +matlab if you're not thinking about this +it's really easy to to design things so + + align:start position:0% +it's really easy to to design things so + + + align:start position:0% +it's really easy to to design things so +that doesn't work so that's not true so + + align:start position:0% +that doesn't work so that's not true so + + + align:start position:0% +that doesn't work so that's not true so +a classic example is the square root + + align:start position:0% +a classic example is the square root + + + align:start position:0% +a classic example is the square root +function all right so suppose i pass an + + align:start position:0% +function all right so suppose i pass an + + + align:start position:0% +function all right so suppose i pass an +integer to it okay so the square root is + + align:start position:0% +integer to it okay so the square root is + + + align:start position:0% +integer to it okay so the square root is +square root of this is 2 square root of + + align:start position:0% +square root of this is 2 square root of + + + align:start position:0% +square root of this is 2 square root of +5 right the result has to be a + + align:start position:0% +5 right the result has to be a + + + align:start position:0% +5 right the result has to be a +floating-point number right it's two + + align:start position:0% +floating-point number right it's two + + + align:start position:0% +floating-point number right it's two +point two three whatever so if i do + + align:start position:0% +point two three whatever so if i do + + + align:start position:0% +point two three whatever so if i do +square root of four of course that + + align:start position:0% +square root of four of course that + + + align:start position:0% +square root of four of course that +square root is an integer but if i + + align:start position:0% +square root is an integer but if i + + + align:start position:0% +square root is an integer but if i +return an integer for that type then it + + align:start position:0% +return an integer for that type then it + + + align:start position:0% +return an integer for that type then it +wouldn't be type stable anymore then the + + align:start position:0% +wouldn't be type stable anymore then the + + + align:start position:0% +wouldn't be type stable anymore then the +return value type would depend on the + + align:start position:0% +return value type would depend on the + + + align:start position:0% +return value type would depend on the +value of the input whether it was a + + align:start position:0% +value of the input whether it was a + + + align:start position:0% +value of the input whether it was a +perfect square or not all right so it + + align:start position:0% +perfect square or not all right so it + + + align:start position:0% +perfect square or not all right so it +was returned to floating-point value + + align:start position:0% +was returned to floating-point value + + + align:start position:0% +was returned to floating-point value +even if the input as an integer yes + + align:start position:0% + + + + align:start position:0% + +[Music] + + align:start position:0% +[Music] + + + align:start position:0% +[Music] +well it's just a look up comes it comes + + align:start position:0% +well it's just a look up comes it comes + + + align:start position:0% +well it's just a look up comes it comes +with compiled time so it's really kind + + align:start position:0% +with compiled time so it's really kind + + + align:start position:0% +with compiled time so it's really kind +of irrelevant it at least if type + + align:start position:0% +of irrelevant it at least if type + + + align:start position:0% +of irrelevant it at least if type +inferencing succeeds if type entrance + + align:start position:0% +inferencing succeeds if type entrance + + + align:start position:0% +inferencing succeeds if type entrance +fails then it's run time it's it's + + align:start position:0% +fails then it's run time it's it's + + + align:start position:0% +fails then it's run time it's it's +slower but it's not like mistake at + + align:start position:0% +slower but it's not like mistake at + + + align:start position:0% +slower but it's not like mistake at +research so it's not it's not as slow as + + align:start position:0% +research so it's not it's not as slow as + + + align:start position:0% +research so it's not it's not as slow as +you might might think but I most the + + align:start position:0% +you might might think but I most the + + + align:start position:0% +you might might think but I most the +time you don't worry about that because + + align:start position:0% +time you don't worry about that because + + + align:start position:0% +time you don't worry about that because +if you care about performance you want + + align:start position:0% +if you care about performance you want + + + align:start position:0% +if you care about performance you want +to arrange your code so that type + + align:start position:0% +to arrange your code so that type + + + align:start position:0% +to arrange your code so that type +inference succeeds + + align:start position:0% +inference succeeds + + + align:start position:0% +inference succeeds +so you prototype maybe - is it something + + align:start position:0% +so you prototype maybe - is it something + + + align:start position:0% +so you prototype maybe - is it something +you do in performance optimization like + + align:start position:0% +you do in performance optimization like + + + align:start position:0% +you do in performance optimization like +when you when your prototype but you + + align:start position:0% +when you when your prototype but you + + + align:start position:0% +when you when your prototype but you +don't care about types you say x equals + + align:start position:0% +don't care about types you say x equals + + + align:start position:0% +don't care about types you say x equals +three and the next line you say x equals + + align:start position:0% +three and the next line you say x equals + + + align:start position:0% +three and the next line you say x equals +an array whatever but when you're + + align:start position:0% +an array whatever but when you're + + + align:start position:0% +an array whatever but when you're +optimizing your code then Y okay you + + align:start position:0% +optimizing your code then Y okay you + + + align:start position:0% +optimizing your code then Y okay you +tweak it a little bit to make sure that + + align:start position:0% +tweak it a little bit to make sure that + + + align:start position:0% +tweak it a little bit to make sure that +things don't change types willy-nilly + + align:start position:0% +things don't change types willy-nilly + + + align:start position:0% +things don't change types willy-nilly +and that the types of a function depend + + align:start position:0% +and that the types of a function depend + + + align:start position:0% +and that the types of a function depend +on the types of the arguments not on the + + align:start position:0% +on the types of the arguments not on the + + + align:start position:0% +on the types of the arguments not on the +values so as I mentioned square root is + + align:start position:0% +values so as I mentioned square root is + + + align:start position:0% +values so as I mentioned square root is +what really confuses people at first if + + align:start position:0% +what really confuses people at first if + + + align:start position:0% +what really confuses people at first if +you take square root of minus one you + + align:start position:0% +you take square root of minus one you + + + align:start position:0% +you take square root of minus one you +might think you should get a complex + + align:start position:0% +might think you should get a complex + + + align:start position:0% +might think you should get a complex +value all right and instead it gives you + + align:start position:0% +value all right and instead it gives you + + + align:start position:0% +value all right and instead it gives you +an error all right and because that's + + align:start position:0% +an error all right and because that's + + + align:start position:0% +an error all right and because that's +basically what are the choices here it + + align:start position:0% +basically what are the choices here it + + + align:start position:0% +basically what are the choices here it +could give you an error it could give + + align:start position:0% +could give you an error it could give + + + align:start position:0% +could give you an error it could give +you a complex value but if it gave you a + + align:start position:0% +you a complex value but if it gave you a + + + align:start position:0% +you a complex value but if it gave you a +complex value then the return type of + + align:start position:0% +complex value then the return type of + + + align:start position:0% +complex value then the return type of +square root would depend upon the value + + align:start position:0% +square root would depend upon the value + + + align:start position:0% +square root would depend upon the value +of the input not just the type some + + align:start position:0% +of the input not just the type some + + + align:start position:0% +of the input not just the type some +MATLAB for example if you take square + + align:start position:0% +MATLAB for example if you take square + + + align:start position:0% +MATLAB for example if you take square +root of minus one it'll happen to give + + align:start position:0% +root of minus one it'll happen to give + + + align:start position:0% +root of minus one it'll happen to give +you a couple expander but as a result if + + align:start position:0% +you a couple expander but as a result if + + + align:start position:0% +you a couple expander but as a result if +you have MATLAB MATLAB has a compiler + + align:start position:0% +you have MATLAB MATLAB has a compiler + + + align:start position:0% +you have MATLAB MATLAB has a compiler +right but it has many many challenges + + align:start position:0% +right but it has many many challenges + + + align:start position:0% +right but it has many many challenges +but like one simple thing to understand + + align:start position:0% +but like one simple thing to understand + + + align:start position:0% +but like one simple thing to understand +is if you have it if the MATLAB compiler + + align:start position:0% +is if you have it if the MATLAB compiler + + + align:start position:0% +is if you have it if the MATLAB compiler +sees a square root function anywhere in + + align:start position:0% +sees a square root function anywhere in + + + align:start position:0% +sees a square root function anywhere in +your function even if it knows the + + align:start position:0% +your function even if it knows the + + + align:start position:0% +your function even if it knows the +inputs that are real it doesn't know if + + align:start position:0% +inputs that are real it doesn't know if + + + align:start position:0% +inputs that are real it doesn't know if +the outputs are complex or real unless + + align:start position:0% +the outputs are complex or real unless + + + align:start position:0% +the outputs are complex or real unless +it can prove that the inputs were + + align:start position:0% +it can prove that the inputs were + + + align:start position:0% +it can prove that the inputs were +positive or non-negative right and that + + align:start position:0% +positive or non-negative right and that + + + align:start position:0% +positive or non-negative right and that +means that it could then compile to code + + align:start position:0% +means that it could then compile to code + + + align:start position:0% +means that it could then compile to code +paths for the output right but then + + align:start position:0% +paths for the output right but then + + + align:start position:0% +paths for the output right but then +suppose it calls skirt again or some + + align:start position:0% +suppose it calls skirt again or some + + + align:start position:0% +suppose it calls skirt again or some +other function about you quickly get a + + align:start position:0% +other function about you quickly get a + + + align:start position:0% +other function about you quickly get a +next combinatorial explosion of possible + + align:start position:0% +next combinatorial explosion of possible + + + align:start position:0% +next combinatorial explosion of possible +code pass because it impossible types + + align:start position:0% +code pass because it impossible types + + + align:start position:0% +code pass because it impossible types +and so some point you just give up and + + align:start position:0% +and so some point you just give up and + + + align:start position:0% +and so some point you just give up and +just put things in a box but as soon as + + align:start position:0% +just put things in a box but as soon as + + + align:start position:0% +just put things in a box but as soon as +you put things in a box and you're + + align:start position:0% +you put things in a box and you're + + + align:start position:0% +you put things in a box and you're +looking at types at runtime you're dead + + align:start position:0% +looking at types at runtime you're dead + + + align:start position:0% +looking at types at runtime you're dead +right from a performance perspective so + + align:start position:0% +right from a performance perspective so + + + align:start position:0% +right from a performance perspective so +Python actually gets if you want a + + align:start position:0% +Python actually gets if you want a + + + align:start position:0% +Python actually gets if you want a +complex result from square root you have + + align:start position:0% +complex result from square root you have + + + align:start position:0% +complex result from square root you have +to give it a complex and + + align:start position:0% +to give it a complex and + + + align:start position:0% +to give it a complex and +but so in Julia a complex number I is + + align:start position:0% +but so in Julia a complex number I is + + + align:start position:0% +but so in Julia a complex number I is +actually M they decided I is too useful + + align:start position:0% +actually M they decided I is too useful + + + align:start position:0% +actually M they decided I is too useful +for loop variables so I and J so M is + + align:start position:0% +for loop variables so I and J so M is + + + align:start position:0% +for loop variables so I and J so M is +the complex unit if you take squared of + + align:start position:0% +the complex unit if you take squared of + + + align:start position:0% +the complex unit if you take squared of +a complex input it gives you a complex + + align:start position:0% +a complex input it gives you a complex + + + align:start position:0% +a complex input it gives you a complex +output so so Python actually does the + + align:start position:0% +output so so Python actually does the + + + align:start position:0% +output so so Python actually does the +same thing so in Python if it takes + + align:start position:0% +same thing so in Python if it takes + + + align:start position:0% +same thing so in Python if it takes +square root of a negative value it gives + + align:start position:0% +square root of a negative value it gives + + + align:start position:0% +square root of a negative value it gives +a an error unless you give it a complex + + align:start position:0% +a an error unless you give it a complex + + + align:start position:0% +a an error unless you give it a complex +input but Python but but Python made + + align:start position:0% +input but Python but but Python made + + + align:start position:0% +input but Python but but Python made +other mistakes so for example in Python + + align:start position:0% +other mistakes so for example in Python + + + align:start position:0% +other mistakes so for example in Python +an integer is guaranteed never to + + align:start position:0% +an integer is guaranteed never to + + + align:start position:0% +an integer is guaranteed never to +overflow if you add one one plus one + + align:start position:0% +overflow if you add one one plus one + + + align:start position:0% +overflow if you add one one plus one +plus one over and over again in Python + + align:start position:0% +plus one over and over again in Python + + + align:start position:0% +plus one over and over again in Python +eventually low overflow the size of + + align:start position:0% +eventually low overflow the size of + + + align:start position:0% +eventually low overflow the size of +history 64-bit integer and Python will + + align:start position:0% +history 64-bit integer and Python will + + + align:start position:0% +history 64-bit integer and Python will +just switch under the hood to an + + align:start position:0% +just switch under the hood to an + + + align:start position:0% +just switch under the hood to an +arbitrary position an integer right but + + align:start position:0% +arbitrary position an integer right but + + + align:start position:0% +arbitrary position an integer right but +seemed like a nice idea probably at the + + align:start position:0% +seemed like a nice idea probably at the + + + align:start position:0% +seemed like a nice idea probably at the +time and the rest of Python is so slow + + align:start position:0% +time and the rest of Python is so slow + + + align:start position:0% +time and the rest of Python is so slow +that like the performance cost of this + + align:start position:0% +that like the performance cost of this + + + align:start position:0% +that like the performance cost of this +this test you know it makes no + + align:start position:0% +this test you know it makes no + + + align:start position:0% +this test you know it makes no +difference in a typical Python code but + + align:start position:0% +difference in a typical Python code but + + + align:start position:0% +difference in a typical Python code but +it makes it very difficult to compile + + align:start position:0% +it makes it very difficult to compile + + + align:start position:0% +it makes it very difficult to compile +because that means if you have integer + + align:start position:0% +because that means if you have integer + + + align:start position:0% +because that means if you have integer +inputs and you see X plus 1 in Python + + align:start position:0% +inputs and you see X plus 1 in Python + + + align:start position:0% +inputs and you see X plus 1 in Python +the compiler cannot decide just can't + + align:start position:0% +the compiler cannot decide just can't + + + align:start position:0% +the compiler cannot decide just can't +just compile that to one instruction + + align:start position:0% +just compile that to one instruction + + + align:start position:0% +just compile that to one instruction +because unless you can somehow prove + + align:start position:0% +because unless you can somehow prove + + + align:start position:0% +because unless you can somehow prove +that X is sufficiently small so in Julia + + align:start position:0% +that X is sufficiently small so in Julia + + + align:start position:0% +that X is sufficiently small so in Julia +you know integer arithmetic will + + align:start position:0% +you know integer arithmetic will + + + align:start position:0% +you know integer arithmetic will +overflow but the default integer integer + + align:start position:0% +overflow but the default integer integer + + + align:start position:0% +overflow but the default integer integer +if Nick is integer arithmetic is 64 bits + + align:start position:0% +if Nick is integer arithmetic is 64 bits + + + align:start position:0% +if Nick is integer arithmetic is 64 bits +so in practice that never overflows + + align:start position:0% +so in practice that never overflows + + + align:start position:0% +so in practice that never overflows +unless you're doing number theory and + + align:start position:0% +unless you're doing number theory and + + + align:start position:0% +unless you're doing number theory and +you usually know if you're doing number + + align:start position:0% +you usually know if you're doing number + + + align:start position:0% +you usually know if you're doing number +theory and then use a reserved precision + + align:start position:0% +theory and then use a reserved precision + + + align:start position:0% +theory and then use a reserved precision +in integers it is much it was much worse + + align:start position:0% +in integers it is much it was much worse + + + align:start position:0% +in integers it is much it was much worse +in the days like this is something + + align:start position:0% +in the days like this is something + + + align:start position:0% +in the days like this is something +people worried a lot you know before you + + align:start position:0% +people worried a lot you know before you + + + align:start position:0% +people worried a lot you know before you +were born when there were 16-bit + + align:start position:0% +were born when there were 16-bit + + + align:start position:0% +were born when there were 16-bit +machines right and integers it's really + + align:start position:0% +machines right and integers it's really + + + align:start position:0% +machines right and integers it's really +really easy to overflow 16 bits so I + + align:start position:0% +really easy to overflow 16 bits so I + + + align:start position:0% +really easy to overflow 16 bits so I +guess the biggest sign value is then you + + align:start position:0% +guess the biggest sign value is then you + + + align:start position:0% +guess the biggest sign value is then you +know thirty two thousand seven nice to + + align:start position:0% +know thirty two thousand seven nice to + + + align:start position:0% +know thirty two thousand seven nice to +see seven right so it's really easy to + + align:start position:0% +see seven right so it's really easy to + + + align:start position:0% +see seven right so it's really easy to +overflow it so you're constantly + + align:start position:0% +overflow it so you're constantly + + + align:start position:0% +overflow it so you're constantly +worrying about overflow and even 32 bits + + align:start position:0% +worrying about overflow and even 32 bits + + + align:start position:0% +worrying about overflow and even 32 bits +the biggest sign value is two billion + + align:start position:0% +the biggest sign value is two billion + + + align:start position:0% +the biggest sign value is two billion +it's really easy to overflow that even + + align:start position:0% +it's really easy to overflow that even + + + align:start position:0% +it's really easy to overflow that even +just counting bytes right you know files + + align:start position:0% +just counting bytes right you know files + + + align:start position:0% +just counting bytes right you know files +that are bigger than two gigabytes + + align:start position:0% +that are bigger than two gigabytes + + + align:start position:0% +that are bigger than two gigabytes +easily nowadays so some people worried + + align:start position:0% +easily nowadays so some people worried + + + align:start position:0% +easily nowadays so some people worried +about this all the time that with 64-bit + + align:start position:0% +about this all the time that with 64-bit + + + align:start position:0% +about this all the time that with 64-bit +integers basically a 64-bit integer will + + align:start position:0% +integers basically a 64-bit integer will + + + align:start position:0% +integers basically a 64-bit integer will +never overflow if it's counting objects + + align:start position:0% +never overflow if it's counting objects + + + align:start position:0% +never overflow if it's counting objects +that exist in the + + align:start position:0% +that exist in the + + + align:start position:0% +that exist in the +universe like you know bytes or loop + + align:start position:0% +universe like you know bytes or loop + + + align:start position:0% +universe like you know bytes or loop +iterations or something like that so you + + align:start position:0% +iterations or something like that so you + + + align:start position:0% +iterations or something like that so you +just you just say okay to the 64 bits + + align:start position:0% +just you just say okay to the 64 bits + + + align:start position:0% +just you just say okay to the 64 bits +all you're doing number theory you + + align:start position:0% +all you're doing number theory you + + + align:start position:0% +all you're doing number theory you +should use begins so okay so let me talk + + align:start position:0% +should use begins so okay so let me talk + + + align:start position:0% +should use begins so okay so let me talk +the final thing I want to talk about + + align:start position:0% +the final thing I want to talk about + + + align:start position:0% +the final thing I want to talk about +let's see how much doing time good is + + align:start position:0% +let's see how much doing time good is + + + align:start position:0% +let's see how much doing time good is +defining our own types so this is where + + align:start position:0% +defining our own types so this is where + + + align:start position:0% +defining our own types so this is where +like this is the real test of the + + align:start position:0% +like this is the real test of the + + + align:start position:0% +like this is the real test of the +language right so McHale anguish where + + align:start position:0% +language right so McHale anguish where + + + align:start position:0% +language right so McHale anguish where +there's a certain built in set of + + align:start position:0% +there's a certain built in set of + + + align:start position:0% +there's a certain built in set of +functions and built-in types and there + + align:start position:0% +functions and built-in types and there + + + align:start position:0% +functions and built-in types and there +are things are fast so for example for + + align:start position:0% +are things are fast so for example for + + + align:start position:0% +are things are fast so for example for +Python there actually is a compiler + + align:start position:0% +Python there actually is a compiler + + + align:start position:0% +Python there actually is a compiler +called numba that does exactly what + + align:start position:0% +called numba that does exactly what + + + align:start position:0% +called numba that does exactly what +julia does it looks at the arguments + + align:start position:0% +julia does it looks at the arguments + + + align:start position:0% +julia does it looks at the arguments +type specializes things and then calls + + align:start position:0% +type specializes things and then calls + + + align:start position:0% +type specializes things and then calls +LVM and composite to fast code but it + + align:start position:0% +LVM and composite to fast code but it + + + align:start position:0% +LVM and composite to fast code but it +only works if your if your only + + align:start position:0% +only works if your if your only + + + align:start position:0% +only works if your if your only +container type is a numpy array and your + + align:start position:0% +container type is a numpy array and your + + + align:start position:0% +container type is a numpy array and your +only scalar type is one of the 12 scalar + + align:start position:0% +only scalar type is one of the 12 scalar + + + align:start position:0% +only scalar type is one of the 12 scalar +types that none pi supports if you have + + align:start position:0% +types that none pi supports if you have + + + align:start position:0% +types that none pi supports if you have +your own user-defined number type or + + align:start position:0% +your own user-defined number type or + + + align:start position:0% +your own user-defined number type or +your own user-defined container type + + align:start position:0% +your own user-defined container type + + + align:start position:0% +your own user-defined container type +then it doesn't work and user-defined + + align:start position:0% +then it doesn't work and user-defined + + + align:start position:0% +then it doesn't work and user-defined +container types it's probably easy to + + align:start position:0% +container types it's probably easy to + + + align:start position:0% +container types it's probably easy to +understand why that's useful usually + + align:start position:0% +understand why that's useful usually + + + align:start position:0% +understand why that's useful usually +find number types are extremely useful + + align:start position:0% +find number types are extremely useful + + + align:start position:0% +find number types are extremely useful +as well so for example there's a package + + align:start position:0% +as well so for example there's a package + + + align:start position:0% +as well so for example there's a package +in julia that provides the number type + + align:start position:0% +in julia that provides the number type + + + align:start position:0% +in julia that provides the number type +called dual numbers and that those have + + align:start position:0% +called dual numbers and that those have + + + align:start position:0% +called dual numbers and that those have +the property that if you pass them into + + align:start position:0% +the property that if you pass them into + + + align:start position:0% +the property that if you pass them into +the function they compute the function + + align:start position:0% +the function they compute the function + + + align:start position:0% +the function they compute the function +and it's derivative and it's just a + + align:start position:0% +and it's derivative and it's just a + + + align:start position:0% +and it's derivative and it's just a +slightly different maleeh carries around + + align:start position:0% +slightly different maleeh carries around + + + align:start position:0% +slightly different maleeh carries around +function and derivative values and as a + + align:start position:0% +function and derivative values and as a + + + align:start position:0% +function and derivative values and as a +slightly different you know plus and + + align:start position:0% +slightly different you know plus and + + + align:start position:0% +slightly different you know plus and +times and so forth that just do the the + + align:start position:0% +times and so forth that just do the the + + + align:start position:0% +times and so forth that just do the the +product rule and so forth and it just + + align:start position:0% +product rule and so forth and it just + + + align:start position:0% +product rule and so forth and it just +propagates derivatives and then if you + + align:start position:0% +propagates derivatives and then if you + + + align:start position:0% +propagates derivatives and then if you +have julia code like that + + align:start position:0% +have julia code like that + + + align:start position:0% +have julia code like that +you know vandermonde function it'll just + + align:start position:0% +you know vandermonde function it'll just + + + align:start position:0% +you know vandermonde function it'll just +compute its derivative as well okay so i + + align:start position:0% +compute its derivative as well okay so i + + + align:start position:0% +compute its derivative as well okay so i +want to be able to find my own type so a + + align:start position:0% +want to be able to find my own type so a + + + align:start position:0% +want to be able to find my own type so a +very simple type that might want to add + + align:start position:0% +very simple type that might want to add + + + align:start position:0% +very simple type that might want to add +would be points to D vectors into into + + align:start position:0% +would be points to D vectors into into + + + align:start position:0% +would be points to D vectors into into +space right so of course I could have an + + align:start position:0% +space right so of course I could have an + + + align:start position:0% +space right so of course I could have an +array of two values but an array is a + + align:start position:0% +array of two values but an array is a + + + align:start position:0% +array of two values but an array is a +really heavy weight object for for just + + align:start position:0% +really heavy weight object for for just + + + align:start position:0% +really heavy weight object for for just +two values right if I know it + + align:start position:0% +two values right if I know it + + + align:start position:0% +two values right if I know it +compile-time there's two values that I + + align:start position:0% +compile-time there's two values that I + + + align:start position:0% +compile-time there's two values that I +don't need to have a pointer to a block + + align:start position:0% +don't need to have a pointer to a block + + + align:start position:0% +don't need to have a pointer to a block +I can actually store the registers I + + align:start position:0% +I can actually store the registers I + + + align:start position:0% +I can actually store the registers I +don't know I can unroll the loop over + + align:start position:0% +don't know I can unroll the loop over + + + align:start position:0% +don't know I can unroll the loop over +these everything should be faster you + + align:start position:0% +these everything should be faster you + + + align:start position:0% +these everything should be faster you +know you can get an order of magnitude + + align:start position:0% +know you can get an order of magnitude + + + align:start position:0% +know you can get an order of magnitude +in speed by specializing on the on the + + align:start position:0% +in speed by specializing on the on the + + + align:start position:0% +in speed by specializing on the on the +the number of elements for small arrays + + align:start position:0% +the number of elements for small arrays + + + align:start position:0% +the number of elements for small arrays +compared to you know just a general rate + + align:start position:0% +compared to you know just a general rate + + + align:start position:0% +compared to you know just a general rate +data structure so let's make a point + + align:start position:0% +data structure so let's make a point + + + align:start position:0% +data structure so let's make a point +okay so this is the and I'm going to go + + align:start position:0% +okay so this is the and I'm going to go + + + align:start position:0% +okay so this is the and I'm going to go +through several iterations one of it + + align:start position:0% +through several iterations one of it + + + align:start position:0% +through several iterations one of it +start with a string with a slow + + align:start position:0% +start with a string with a slow + + + align:start position:0% +start with a string with a slow +iteration and then define a immutable + + align:start position:0% +iteration and then define a immutable + + + align:start position:0% +iteration and then define a immutable +struct okay so this will be a mutable + + align:start position:0% +struct okay so this will be a mutable + + + align:start position:0% +struct okay so this will be a mutable +object where I can add a point that has + + align:start position:0% +object where I can add a point that has + + + align:start position:0% +object where I can add a point that has +two values x and y can be of any type + + align:start position:0% +two values x and y can be of any type + + + align:start position:0% +two values x and y can be of any type +I'll define a plus function that can add + + align:start position:0% +I'll define a plus function that can add + + + align:start position:0% +I'll define a plus function that can add +them and it is the most obvious thing it + + align:start position:0% +them and it is the most obvious thing it + + + align:start position:0% +them and it is the most obvious thing it +adds the X components as the Y + + align:start position:0% +adds the X components as the Y + + + align:start position:0% +adds the X components as the Y +components I'll define a zero function + + align:start position:0% +components I'll define a zero function + + + align:start position:0% +components I'll define a zero function +that's the additive identities that just + + align:start position:0% +that's the additive identities that just + + + align:start position:0% +that's the additive identities that just +returns the point zero zero and then I + + align:start position:0% +returns the point zero zero and then I + + + align:start position:0% +returns the point zero zero and then I +can construct an object point three four + + align:start position:0% +can construct an object point three four + + + align:start position:0% +can construct an object point three four +I can say point three four plus 0.5 six + + align:start position:0% +I can say point three four plus 0.5 six + + + align:start position:0% +I can say point three four plus 0.5 six +it works it can hold actually right now + + align:start position:0% +it works it can hold actually right now + + + align:start position:0% +it works it can hold actually right now +it's very generic and probably too + + align:start position:0% +it's very generic and probably too + + + align:start position:0% +it's very generic and probably too +generic the so they like the real part + + align:start position:0% +generic the so they like the real part + + + align:start position:0% +generic the so they like the real part +can be a flying point number and the + + align:start position:0% +can be a flying point number and the + + + align:start position:0% +can be a flying point number and the +imaginary the X can be a floating point + + align:start position:0% +imaginary the X can be a floating point + + + align:start position:0% +imaginary the X can be a floating point +number here and then Y is a is a complex + + align:start position:0% +number here and then Y is a is a complex + + + align:start position:0% +number here and then Y is a is a complex +number of two integers or even I could + + align:start position:0% +number of two integers or even I could + + + align:start position:0% +number of two integers or even I could +make a string and an array that it + + align:start position:0% +make a string and an array that it + + + align:start position:0% +make a string and an array that it +wasn't Disney makes sense so I so here's + + align:start position:0% +wasn't Disney makes sense so I so here's + + + align:start position:0% +wasn't Disney makes sense so I so here's +I probably should have restricted the + + align:start position:0% +I probably should have restricted the + + + align:start position:0% +I probably should have restricted the +types of X&Y a little bit just to + + align:start position:0% +types of X&Y a little bit just to + + + align:start position:0% +types of X&Y a little bit just to +prevent the user from putting in + + align:start position:0% +prevent the user from putting in + + + align:start position:0% +prevent the user from putting in +something that makes no sense at all + + align:start position:0% +something that makes no sense at all + + + align:start position:0% +something that makes no sense at all +okay so so these things they can be + + align:start position:0% +okay so so these things they can be + + + align:start position:0% +okay so so these things they can be +anything so this this this type is not + + align:start position:0% +anything so this this this type is not + + + align:start position:0% +anything so this this this type is not +ideal in several ways so let's think + + align:start position:0% +ideal in several ways so let's think + + + align:start position:0% +ideal in several ways so let's think +about how this has to be stored in + + align:start position:0% +about how this has to be stored in + + + align:start position:0% +about how this has to be stored in +memory so this is a point 1 X plus a + + align:start position:0% +memory so this is a point 1 X plus a + + + align:start position:0% +memory so this is a point 1 X plus a +point one one three point seven right so + + align:start position:0% +point one one three point seven right so + + + align:start position:0% +point one one three point seven right so +in memory it's there's an X and there's + + align:start position:0% +in memory it's there's an X and there's + + + align:start position:0% +in memory it's there's an X and there's +a y but x and y can be of any type so + + align:start position:0% +a y but x and y can be of any type so + + + align:start position:0% +a y but x and y can be of any type so +that means they have to be a pointers to + + align:start position:0% +that means they have to be a pointers to + + + align:start position:0% +that means they have to be a pointers to +boxes there's a pointer to int one and + + align:start position:0% +boxes there's a pointer to int one and + + + align:start position:0% +boxes there's a pointer to int one and +there's a pointer to a float64 in this + + align:start position:0% +there's a pointer to a float64 in this + + + align:start position:0% +there's a pointer to a float64 in this +case three point seven so this already + + align:start position:0% +case three point seven so this already + + + align:start position:0% +case three point seven so this already +we know this is not going to be good + + align:start position:0% +we know this is not going to be good + + + align:start position:0% +we know this is not going to be good +news for performance right and it's + + align:start position:0% +news for performance right and it's + + + align:start position:0% +news for performance right and it's +mutable so that mutable struct ments if + + align:start position:0% +mutable so that mutable struct ments if + + + align:start position:0% +mutable so that mutable struct ments if +I if I take P equals point a point like + + align:start position:0% +I if I take P equals point a point like + + + align:start position:0% +I if I take P equals point a point like +then say P X equals seven I can change + + align:start position:0% +then say P X equals seven I can change + + + align:start position:0% +then say P X equals seven I can change +the value and which seems like a + + align:start position:0% +the value and which seems like a + + + align:start position:0% +the value and which seems like a +harmless thing to do but actually is a + + align:start position:0% +harmless thing to do but actually is a + + + align:start position:0% +harmless thing to do but actually is a +big problem because for example if I + + align:start position:0% +big problem because for example if I + + + align:start position:0% +big problem because for example if I +make an array of of three piece okay and + + align:start position:0% +make an array of of three piece okay and + + + align:start position:0% +make an array of of three piece okay and +then I say P dot y equals eight and a + + align:start position:0% +then I say P dot y equals eight and a + + + align:start position:0% +then I say P dot y equals eight and a +look at that array it has to it has to + + align:start position:0% +look at that array it has to it has to + + + align:start position:0% +look at that array it has to it has to +change the Y component okay so if I have + + align:start position:0% +change the Y component okay so if I have + + + align:start position:0% +change the Y component okay so if I have +say five up P or in general five of P + + align:start position:0% +say five up P or in general five of P + + + align:start position:0% +say five up P or in general five of P +that's looking at that object if this is + + align:start position:0% +that's looking at that object if this is + + + align:start position:0% +that's looking at that object if this is +an object you can mutate it means that + + align:start position:0% +an object you can mutate it means that + + + align:start position:0% +an object you can mutate it means that +if I have another element Q it's also + + align:start position:0% +if I have another element Q it's also + + + align:start position:0% +if I have another element Q it's also +pointing the same object and I say P px + + align:start position:0% +pointing the same object and I say P px + + + align:start position:0% +pointing the same object and I say P px +equals 4 then Q dot X had better also + + align:start position:0% +equals 4 then Q dot X had better also + + + align:start position:0% +equals 4 then Q dot X had better also +before at that point so so to have + + align:start position:0% +before at that point so so to have + + + align:start position:0% +before at that point so so to have +mutable semantics it to have the + + align:start position:0% +mutable semantics it to have the + + + align:start position:0% +mutable semantics it to have the +semantics of something you can change + + align:start position:0% +semantics of something you can change + + + align:start position:0% +semantics of something you can change +and reference other references you can + + align:start position:0% +and reference other references you can + + + align:start position:0% +and reference other references you can +see that change that means that this + + align:start position:0% +see that change that means that this + + + align:start position:0% +see that change that means that this +object has to be stored in memory on the + + align:start position:0% +object has to be stored in memory on the + + + align:start position:0% +object has to be stored in memory on the +heap as a pointer to two objects so that + + align:start position:0% +heap as a pointer to two objects so that + + + align:start position:0% +heap as a pointer to two objects so that +you know other pointers the same object + + align:start position:0% +you know other pointers the same object + + + align:start position:0% +you know other pointers the same object +and I mutated and the and the other + + align:start position:0% +and I mutated and the and the other + + + align:start position:0% +and I mutated and the and the other +references see it it can't just be stuck + + align:start position:0% +references see it it can't just be stuck + + + align:start position:0% +references see it it can't just be stuck +in a register or something like that you + + align:start position:0% +in a register or something like that you + + + align:start position:0% +in a register or something like that you +have to it has to be something that + + align:start position:0% +have to it has to be something that + + + align:start position:0% +have to it has to be something that +other references can see so this is bad + + align:start position:0% +other references can see so this is bad + + + align:start position:0% +other references can see so this is bad +so if I have so I can call point 1 dot a + + align:start position:0% +so if I have so I can call point 1 dot a + + + align:start position:0% +so if I have so I can call point 1 dot a +equals the constructor element wise and + + align:start position:0% +equals the constructor element wise and + + + align:start position:0% +equals the constructor element wise and +this a is this array of 10 the 7th + + align:start position:0% +this a is this array of 10 the 7th + + + align:start position:0% +this a is this array of 10 the 7th +random numbers I was benchmarking on + + align:start position:0% +random numbers I was benchmarking on + + + align:start position:0% +random numbers I was benchmarking on +before that was taking 10 milliseconds + + align:start position:0% +before that was taking 10 milliseconds + + + align:start position:0% +before that was taking 10 milliseconds +okay and if I call I can sum it I can + + align:start position:0% +okay and if I call I can sum it I can + + + align:start position:0% +okay and if I call I can sum it I can +call the built in sum function on this I + + align:start position:0% +call the built in sum function on this I + + + align:start position:0% +call the built in sum function on this I +can even call my sum function on this + + align:start position:0% +can even call my sum function on this + + + align:start position:0% +can even call my sum function on this +because ID supports a zero function it + + align:start position:0% +because ID supports a zero function it + + + align:start position:0% +because ID supports a zero function it +sort of supports a plus so here if I + + align:start position:0% +sort of supports a plus so here if I + + + align:start position:0% +sort of supports a plus so here if I +have an array if I could scroll back up + + align:start position:0% +have an array if I could scroll back up + + + align:start position:0% +have an array if I could scroll back up +I have an array array here of 10 to the + + align:start position:0% +I have an array array here of 10 to the + + + align:start position:0% +I have an array array here of 10 to the +7th values of type point 1 so that the + + align:start position:0% +7th values of type point 1 so that the + + + align:start position:0% +7th values of type point 1 so that the +type of point 1 is attached to the array + + align:start position:0% +type of point 1 is attached to the array + + + align:start position:0% +type of point 1 is attached to the array +so the array in memory so I've been to + + align:start position:0% +so the array in memory so I've been to + + + align:start position:0% +so the array in memory so I've been to +if I have an array of 0.1 the 1 here + + align:start position:0% +if I have an array of 0.1 the 1 here + + + align:start position:0% +if I have an array of 0.1 the 1 here +means it's a one dimensional ready + + align:start position:0% +means it's a one dimensional ready + + + align:start position:0% +means it's a one dimensional ready +there's also two 2d 3d and so forth that + + align:start position:0% +there's also two 2d 3d and so forth that + + + align:start position:0% +there's also two 2d 3d and so forth that +looks like a point 1 value a point 1 + + align:start position:0% +looks like a point 1 value a point 1 + + + align:start position:0% +looks like a point 1 value a point 1 +value point 1 value but each one of + + align:start position:0% +value point 1 value but each one of + + + align:start position:0% +value point 1 value but each one of +those but each one of those now + + align:start position:0% +those but each one of those now + + + align:start position:0% +those but each one of those now +sorry have to be a pointer to an X and + + align:start position:0% +sorry have to be a pointer to an X and + + + align:start position:0% +sorry have to be a pointer to an X and +the y which themselves are pointers to + + align:start position:0% +the y which themselves are pointers to + + + align:start position:0% +the y which themselves are pointers to +boxes right so operating something this + + align:start position:0% +boxes right so operating something this + + + align:start position:0% +boxes right so operating something this +is gonna be really slow this is a lot of + + align:start position:0% +is gonna be really slow this is a lot of + + + align:start position:0% +is gonna be really slow this is a lot of +pointer chasing it has to at runtime + + align:start position:0% +pointer chasing it has to at runtime + + + align:start position:0% +pointer chasing it has to at runtime +check what's the type of X what's the + + align:start position:0% +check what's the type of X what's the + + + align:start position:0% +check what's the type of X what's the +type of Y and in fact it was it took + + align:start position:0% +type of Y and in fact it was it took + + + align:start position:0% +type of Y and in fact it was it took +instead of 10 milliseconds it took in + + align:start position:0% +instead of 10 milliseconds it took in + + + align:start position:0% +instead of 10 milliseconds it took in +five or six hundred milliseconds so to + + align:start position:0% +five or six hundred milliseconds so to + + + align:start position:0% +five or six hundred milliseconds so to +do better we need to do two things so + + align:start position:0% +do better we need to do two things so + + + align:start position:0% +do better we need to do two things so +first of all x and y they have to be we + + align:start position:0% +first of all x and y they have to be we + + + align:start position:0% +first of all x and y they have to be we +have to be able to see what type they + + align:start position:0% +have to be able to see what type they + + + align:start position:0% +have to be able to see what type they +are okay it can't be just any arbitrary + + align:start position:0% +are okay it can't be just any arbitrary + + + align:start position:0% +are okay it can't be just any arbitrary +old thing that has to be a point to a + + align:start position:0% +old thing that has to be a point to a + + + align:start position:0% +old thing that has to be a point to a +box okay + + align:start position:0% +box okay + + + align:start position:0% +box okay +and the point object has to be immutable + + align:start position:0% +and the point object has to be immutable + + + align:start position:0% +and the point object has to be immutable +it has to be something where if I have + + align:start position:0% +it has to be something where if I have + + + align:start position:0% +it has to be something where if I have +if I have if I have P equals something Q + + align:start position:0% +if I have if I have P equals something Q + + + align:start position:0% +if I have if I have P equals something Q +equals something I can't change P and + + align:start position:0% +equals something I can't change P and + + + align:start position:0% +equals something I can't change P and +expect Q to see it otherwise if it's + + align:start position:0% +expect Q to see it otherwise if it's + + + align:start position:0% +expect Q to see it otherwise if it's +mutable they have to be stored as the + + align:start position:0% +mutable they have to be stored as the + + + align:start position:0% +mutable they have to be stored as the +little semantics have to be implemented + + align:start position:0% +little semantics have to be implemented + + + align:start position:0% +little semantics have to be implemented +as some pointer to an object in place + + align:start position:0% +as some pointer to an object in place + + + align:start position:0% +as some pointer to an object in place +and you're done you're dead so I can + + align:start position:0% +and you're done you're dead so I can + + + align:start position:0% +and you're done you're dead so I can +just say struct so struct now is not + + align:start position:0% +just say struct so struct now is not + + + align:start position:0% +just say struct so struct now is not +mutable it doesn't have the mutable + + align:start position:0% +mutable it doesn't have the mutable + + + align:start position:0% +mutable it doesn't have the mutable +keyword and I can give the arguments + + align:start position:0% +keyword and I can give the arguments + + + align:start position:0% +keyword and I can give the arguments +type so I can say that both float64 and + + align:start position:0% +type so I can say that both float64 and + + + align:start position:0% +type so I can say that both float64 and +then x and y are both the same type that + + align:start position:0% +then x and y are both the same type that + + + align:start position:0% +then x and y are both the same type that +both the 64 but floating point numbers + + align:start position:0% +both the 64 but floating point numbers + + + align:start position:0% +both the 64 but floating point numbers +I'll define plus the same way 0 the same + + align:start position:0% +I'll define plus the same way 0 the same + + + align:start position:0% +I'll define plus the same way 0 the same +way and now I can add them and so forth + + align:start position:0% +way and now I can add them and so forth + + + align:start position:0% +way and now I can add them and so forth +but now if I make an array of these + + align:start position:0% +but now if I make an array of these + + + align:start position:0% +but now if I make an array of these +things and if I say px equals 6 it will + + align:start position:0% +things and if I say px equals 6 it will + + + align:start position:0% +things and if I say px equals 6 it will +give an error says though you can't + + align:start position:0% +give an error says though you can't + + + align:start position:0% +give an error says though you can't +actually mutate don't even try to mutate + + align:start position:0% +actually mutate don't even try to mutate + + + align:start position:0% +actually mutate don't even try to mutate +it because because we can't support + + align:start position:0% +it because because we can't support + + + align:start position:0% +it because because we can't support +those semantics on this type but that + + align:start position:0% +those semantics on this type but that + + + align:start position:0% +those semantics on this type but that +means so that type is actually + + align:start position:0% + + + + align:start position:0% + +you look at look at Botany memory what + + align:start position:0% +you look at look at Botany memory what + + + align:start position:0% +you look at look at Botany memory what +the compiler is allowed to do and what + + align:start position:0% +the compiler is allowed to do and what + + + align:start position:0% +the compiler is allowed to do and what +it does do for this is if you have an + + align:start position:0% +it does do for this is if you have an + + + align:start position:0% +it does do for this is if you have an +array of point two one then it looks + + align:start position:0% +array of point two one then it looks + + + align:start position:0% +array of point two one then it looks +like just you know the x value the Y + + align:start position:0% +like just you know the x value the Y + + + align:start position:0% +like just you know the x value the Y +value the x value the Y value and so + + align:start position:0% +value the x value the Y value and so + + + align:start position:0% +value the x value the Y value and so +forth each of these are exactly one + + align:start position:0% +forth each of these are exactly one + + + align:start position:0% +forth each of these are exactly one +eight bytes float64 and all the types + + align:start position:0% +eight bytes float64 and all the types + + + align:start position:0% +eight bytes float64 and all the types +are known at compile time and so if I + + align:start position:0% +are known at compile time and so if I + + + align:start position:0% +are known at compile time and so if I +sum them it should take about point 20 + + align:start position:0% +sum them it should take about point 20 + + + align:start position:0% +sum them it should take about point 20 +milliseconds right + + align:start position:0% +milliseconds right + + + align:start position:0% +milliseconds right +summing in real numbers it was 10 + + align:start position:0% +summing in real numbers it was 10 + + + align:start position:0% +summing in real numbers it was 10 +milliseconds and this is twice as many + + align:start position:0% +milliseconds and this is twice as many + + + align:start position:0% +milliseconds and this is twice as many +because there's some the X's haven't + + align:start position:0% +because there's some the X's haven't + + + align:start position:0% +because there's some the X's haven't +some of the Y's and let's benchmark it + + align:start position:0% +some of the Y's and let's benchmark it + + + align:start position:0% +some of the Y's and let's benchmark it +and let's see oh actually - something + + align:start position:0% +and let's see oh actually - something + + + align:start position:0% +and let's see oh actually - something +sort of something the real numbers took + + align:start position:0% +sort of something the real numbers took + + + align:start position:0% +sort of something the real numbers took +5 milliseconds so something should do it + + align:start position:0% +5 milliseconds so something should do it + + + align:start position:0% +5 milliseconds so something should do it +take about 10 let's see if that's still + + align:start position:0% +take about 10 let's see if that's still + + + align:start position:0% +take about 10 let's see if that's still +true yeah it took about 10 so actually + + align:start position:0% +true yeah it took about 10 so actually + + + align:start position:0% +true yeah it took about 10 so actually +the compiler is smart enough it stores + + align:start position:0% +the compiler is smart enough it stores + + + align:start position:0% +the compiler is smart enough it stores +this so it's first of all it stores this + + align:start position:0% +this so it's first of all it stores this + + + align:start position:0% +this so it's first of all it stores this +in line as one big block consecutive + + align:start position:0% +in line as one big block consecutive + + + align:start position:0% +in line as one big block consecutive +memory and then when you sum them + + align:start position:0% +memory and then when you sum them + + + align:start position:0% +memory and then when you sum them +remember some function this well this is + + align:start position:0% +remember some function this well this is + + + align:start position:0% +remember some function this well this is +the built-in sum but our sum function + + align:start position:0% +the built-in sum but our sum function + + + align:start position:0% +the built-in sum but our sum function +will work the same way the compiler will + + align:start position:0% +will work the same way the compiler will + + + align:start position:0% +will work the same way the compiler will +elevate and we'll be smart enough to say + + align:start position:0% +elevate and we'll be smart enough to say + + + align:start position:0% +elevate and we'll be smart enough to say +oh I can load this into a register load + + align:start position:0% +oh I can load this into a register load + + + align:start position:0% +oh I can load this into a register load +Y into a register call it have a tight + + align:start position:0% +Y into a register call it have a tight + + + align:start position:0% +Y into a register call it have a tight +loop where I basically call one + + align:start position:0% +loop where I basically call one + + + align:start position:0% +loop where I basically call one +instruction to sum the X's one + + align:start position:0% +instruction to sum the X's one + + + align:start position:0% +instruction to sum the X's one +instruction to sum the Y's and then + + align:start position:0% +instruction to sum the Y's and then + + + align:start position:0% +instruction to sum the Y's and then +repeat so there's about as good as you + + align:start position:0% +repeat so there's about as good as you + + + align:start position:0% +repeat so there's about as good as you +could get but you paid a big price + + align:start position:0% +could get but you paid a big price + + + align:start position:0% +could get but you paid a big price +we've lost all generality right these + + align:start position:0% +we've lost all generality right these + + + align:start position:0% +we've lost all generality right these +can only be to 64-bit floating-point + + align:start position:0% +can only be to 64-bit floating-point + + + align:start position:0% +can only be to 64-bit floating-point +numbers so I can't have two single + + align:start position:0% +numbers so I can't have two single + + + align:start position:0% +numbers so I can't have two single +precision numbers or two so this is like + + align:start position:0% +precision numbers or two so this is like + + + align:start position:0% +precision numbers or two so this is like +a struct of 240 explosives two doubles + + align:start position:0% +a struct of 240 explosives two doubles + + + align:start position:0% +a struct of 240 explosives two doubles +and C alright so if I have to do this to + + align:start position:0% +and C alright so if I have to do this to + + + align:start position:0% +and C alright so if I have to do this to +get performance in Julia that would suck + + align:start position:0% +get performance in Julia that would suck + + + align:start position:0% +get performance in Julia that would suck +basically I'm it's maybe an you know + + align:start position:0% +basically I'm it's maybe an you know + + + align:start position:0% +basically I'm it's maybe an you know +it's I'm basically writing C code in a + + align:start position:0% +it's I'm basically writing C code in a + + + align:start position:0% +it's I'm basically writing C code in a +slightly higher level syntax I'm losing + + align:start position:0% +slightly higher level syntax I'm losing + + + align:start position:0% +slightly higher level syntax I'm losing +that benefit of using high level + + align:start position:0% +that benefit of using high level + + + align:start position:0% +that benefit of using high level +language so the way you get around this + + align:start position:0% +language so the way you get around this + + + align:start position:0% +language so the way you get around this +is you define what you want is to define + + align:start position:0% +is you define what you want is to define + + + align:start position:0% +is you define what you want is to define +something like this point + + align:start position:0% +something like this point + + + align:start position:0% +something like this point +type but you don't want you to find just + + align:start position:0% +type but you don't want you to find just + + + align:start position:0% +type but you don't want you to find just +one type you wanted to find a whole + + align:start position:0% +one type you wanted to find a whole + + + align:start position:0% +one type you wanted to find a whole +family of types you wanted to find this + + align:start position:0% +family of types you wanted to find this + + + align:start position:0% +family of types you wanted to find this +for a to 54 is to float 32 for twos in + + align:start position:0% +for a to 54 is to float 32 for twos in + + + align:start position:0% +for a to 54 is to float 32 for twos in +fact you wanted to find an infinite + + align:start position:0% +fact you wanted to find an infinite + + + align:start position:0% +fact you wanted to find an infinite +family of types for ED to two things of + + align:start position:0% +family of types for ED to two things of + + + align:start position:0% +family of types for ED to two things of +any type you want as long as they're two + + align:start position:0% +any type you want as long as they're two + + + align:start position:0% +any type you want as long as they're two +real numbers to real types and so the + + align:start position:0% +real numbers to real types and so the + + + align:start position:0% +real numbers to real types and so the +way you do that in julia is a + + align:start position:0% +way you do that in julia is a + + + align:start position:0% +way you do that in julia is a +parameterize type this is called + + align:start position:0% +parameterize type this is called + + + align:start position:0% +parameterize type this is called +parametric polymorphism is similar to + + align:start position:0% +parametric polymorphism is similar to + + + align:start position:0% +parametric polymorphism is similar to +what you see in C++ templates so now I + + align:start position:0% +what you see in C++ templates so now I + + + align:start position:0% +what you see in C++ templates so now I +have a struct this it's not mutable 0.3 + + align:start position:0% +have a struct this it's not mutable 0.3 + + + align:start position:0% +have a struct this it's not mutable 0.3 +but the curly braces t it says it's + + align:start position:0% +but the curly braces t it says it's + + + align:start position:0% +but the curly braces t it says it's +parameterised by type t so x and y I'm + + align:start position:0% +parameterised by type t so x and y I'm + + + align:start position:0% +parameterised by type t so x and y I'm +restricted restricted slightly here I've + + align:start position:0% +restricted restricted slightly here I've + + + align:start position:0% +restricted restricted slightly here I've +said x and y had to be the same type I + + align:start position:0% +said x and y had to be the same type I + + + align:start position:0% +said x and y had to be the same type I +didn't have to do that but most of that + + align:start position:0% +didn't have to do that but most of that + + + align:start position:0% +didn't have to do that but most of that +medev had two parameters one for the + + align:start position:0% +medev had two parameters one for the + + + align:start position:0% +medev had two parameters one for the +type of X ones at that of Y but most the + + align:start position:0% +type of X ones at that of Y but most the + + + align:start position:0% +type of X ones at that of Y but most the +time you'd be doing something like this + + align:start position:0% +time you'd be doing something like this + + + align:start position:0% +time you'd be doing something like this +he'd want them both both of his same + + align:start position:0% +he'd want them both both of his same + + + align:start position:0% +he'd want them both both of his same +type but they could be both lossless + + align:start position:0% +type but they could be both lossless + + + align:start position:0% +type but they could be both lossless +ephors both float 32 is both integers + + align:start position:0% +ephors both float 32 is both integers + + + align:start position:0% +ephors both float 32 is both integers +whatever so T is any type that less than + + align:start position:0% +whatever so T is any type that less than + + + align:start position:0% +whatever so T is any type that less than +: means is a subtype of so T is this any + + align:start position:0% +: means is a subtype of so T is this any + + + align:start position:0% +: means is a subtype of so T is this any +subtype of real it could be flow 64 it + + align:start position:0% +subtype of real it could be flow 64 it + + + align:start position:0% +subtype of real it could be flow 64 it +could be in 64 could be in tade could be + + align:start position:0% +could be in 64 could be in tade could be + + + align:start position:0% +could be in 64 could be in tade could be +big flow it could be a user defined type + + align:start position:0% +big flow it could be a user defined type + + + align:start position:0% +big flow it could be a user defined type +it doesn't care so this is really not + + align:start position:0% +it doesn't care so this is really not + + + align:start position:0% +it doesn't care so this is really not +it's a it's a point three here is a + + align:start position:0% +it's a it's a point three here is a + + + align:start position:0% +it's a it's a point three here is a +whole hierarchy is not define this I'm + + align:start position:0% +whole hierarchy is not define this I'm + + + align:start position:0% +whole hierarchy is not define this I'm +not defining one type I'm defining a + + align:start position:0% +not defining one type I'm defining a + + + align:start position:0% +not defining one type I'm defining a +whole set of types so point three is a + + align:start position:0% +whole set of types so point three is a + + + align:start position:0% +whole set of types so point three is a +set of types there's a point 0.3 in 64 + + align:start position:0% +set of types there's a point 0.3 in 64 + + + align:start position:0% +set of types there's a point 0.3 in 64 +there's a point 3 float 32 at 4 for 64 + + align:start position:0% +there's a point 3 float 32 at 4 for 64 + + + align:start position:0% +there's a point 3 float 32 at 4 for 64 +and so on and infinitely many types you + + align:start position:0% +and so on and infinitely many types you + + + align:start position:0% +and so on and infinitely many types you +know as many as you want and basically + + align:start position:0% +know as many as you want and basically + + + align:start position:0% +know as many as you want and basically +McCree 8 more types on the fly and is + + align:start position:0% +McCree 8 more types on the fly and is + + + align:start position:0% +McCree 8 more types on the fly and is +just by just by instantiating so for + + align:start position:0% +just by just by instantiating so for + + + align:start position:0% +just by just by instantiating so for +example otherwise it looks the same the + + align:start position:0% +example otherwise it looks the same the + + + align:start position:0% +example otherwise it looks the same the +plus function is basically the same I + + align:start position:0% +plus function is basically the same I + + + align:start position:0% +plus function is basically the same I +add the X components of Y components the + + align:start position:0% +add the X components of Y components the + + + align:start position:0% +add the X components of Y components the +zero function is the same I make we + + align:start position:0% +zero function is the same I make we + + + align:start position:0% +zero function is the same I make we +submit now I make sure there's zeros of + + align:start position:0% +submit now I make sure there's zeros of + + + align:start position:0% +submit now I make sure there's zeros of +type t whatever that type is and now if + + align:start position:0% +type t whatever that type is and now if + + + align:start position:0% +type t whatever that type is and now if +I say 0.34 now I'm instantiating a + + align:start position:0% +I say 0.34 now I'm instantiating a + + + align:start position:0% +I say 0.34 now I'm instantiating a +particular instance of this create + + align:start position:0% +particular instance of this create + + + align:start position:0% +particular instance of this create +create and now that particular instance + + align:start position:0% +create and now that particular instance + + + align:start position:0% +create and now that particular instance +of 0.3 + + align:start position:0% +of 0.3 + + + align:start position:0% +of 0.3 +will have what this is + + align:start position:0% +will have what this is + + + align:start position:0% +will have what this is +an abstract type will have one of these + + align:start position:0% +an abstract type will have one of these + + + align:start position:0% +an abstract type will have one of these +concrete types and the concrete type it + + align:start position:0% +concrete types and the concrete type it + + + align:start position:0% +concrete types and the concrete type it +has in this case is 0.3 of 2 in 64 s22 + + align:start position:0% +has in this case is 0.3 of 2 in 64 s22 + + + align:start position:0% +has in this case is 0.3 of 2 in 64 s22 +64-bit integers okay + + align:start position:0% +64-bit integers okay + + + align:start position:0% +64-bit integers okay +and I can add them and actually adding + + align:start position:0% +and I can add them and actually adding + + + align:start position:0% +and I can add them and actually adding +mixed types will already work because + + align:start position:0% +mixed types will already work because + + + align:start position:0% +mixed types will already work because +the plus what the addition function here + + align:start position:0% + + + + align:start position:0% + +it works for any 2.3 I didn't say they + + align:start position:0% +it works for any 2.3 I didn't say they + + + align:start position:0% +it works for any 2.3 I didn't say they +had to be 0.3 is of the same type I did + + align:start position:0% +had to be 0.3 is of the same type I did + + + align:start position:0% +had to be 0.3 is of the same type I did +so and any two of these they don't have + + align:start position:0% +so and any two of these they don't have + + + align:start position:0% +so and any two of these they don't have +to be two of these it could be one of + + align:start position:0% +to be two of these it could be one of + + + align:start position:0% +to be two of these it could be one of +these in one of these and then it + + align:start position:0% +these in one of these and then it + + + align:start position:0% +these in one of these and then it +determines the type of the result by the + + align:start position:0% +determines the type of the result by the + + + align:start position:0% +determines the type of the result by the +type of the return it does type + + align:start position:0% +type of the return it does type + + + align:start position:0% +type of the return it does type +inference so if you have an in 16.3 of + + align:start position:0% +inference so if you have an in 16.3 of + + + align:start position:0% +inference so if you have an in 16.3 of +two and 64 x' and 0.32 432 is all it + + align:start position:0% +two and 64 x' and 0.32 432 is all it + + + align:start position:0% +two and 64 x' and 0.32 432 is all it +says oh px is an n64 QX is a float 36 + + align:start position:0% +says oh px is an n64 QX is a float 36 + + + align:start position:0% +says oh px is an n64 QX is a float 36 +full 64 + + align:start position:0% +full 64 + + + align:start position:0% +full 64 +Oh which plus function do I call there's + + align:start position:0% +Oh which plus function do I call there's + + + align:start position:0% +Oh which plus function do I call there's +a plus function form it that mixed thing + + align:start position:0% +a plus function form it that mixed thing + + + align:start position:0% +a plus function form it that mixed thing +and it promotes the result of flow 64 so + + align:start position:0% +and it promotes the result of flow 64 so + + + align:start position:0% +and it promotes the result of flow 64 so +that means that that sum is posted for + + align:start position:0% +that means that that sum is posted for + + + align:start position:0% +that means that that sum is posted for +the other film is full 64 oh then I'm + + align:start position:0% +the other film is full 64 oh then I'm + + + align:start position:0% +the other film is full 64 oh then I'm +creating a polling point 3 of felicity + + align:start position:0% +creating a polling point 3 of felicity + + + align:start position:0% +creating a polling point 3 of felicity +force so this kind of mixed promotion is + + align:start position:0% +force so this kind of mixed promotion is + + + align:start position:0% +force so this kind of mixed promotion is +is done automatically you can actually + + align:start position:0% +is done automatically you can actually + + + align:start position:0% +is done automatically you can actually +define your own promotion rules and + + align:start position:0% +define your own promotion rules and + + + align:start position:0% +define your own promotion rules and +Julia as well and I can make an array + + align:start position:0% +Julia as well and I can make an array + + + align:start position:0% +Julia as well and I can make an array +and so now if I have an array of 0.3 + + align:start position:0% +and so now if I have an array of 0.3 + + + align:start position:0% +and so now if I have an array of 0.3 +float64 so this type is attached to the + + align:start position:0% +float64 so this type is attached to the + + + align:start position:0% +float64 so this type is attached to the +whole array and this is not an arbitrary + + align:start position:0% +whole array and this is not an arbitrary + + + align:start position:0% +whole array and this is not an arbitrary +point 3 it's an appoint 3 of 250 force + + align:start position:0% +point 3 it's an appoint 3 of 250 force + + + align:start position:0% +point 3 it's an appoint 3 of 250 force +so it gets stored again as just 10 to + + align:start position:0% +so it gets stored again as just 10 to + + + align:start position:0% +so it gets stored again as just 10 to +the seventh elements of XY XY we each + + align:start position:0% +the seventh elements of XY XY we each + + + align:start position:0% +the seventh elements of XY XY we each +one is 8 bytes 8 bytes 8 bytes one after + + align:start position:0% +one is 8 bytes 8 bytes 8 bytes one after + + + align:start position:0% +one is 8 bytes 8 bytes 8 bytes one after +the other the compiler knows all the + + align:start position:0% +the other the compiler knows all the + + + align:start position:0% +the other the compiler knows all the +types so when you sum it it knows + + align:start position:0% +types so when you sum it it knows + + + align:start position:0% +types so when you sum it it knows +everything at compile time and it will + + align:start position:0% +everything at compile time and it will + + + align:start position:0% +everything at compile time and it will +you know it will sum to these things by + + align:start position:0% +you know it will sum to these things by + + + align:start position:0% +you know it will sum to these things by +loaded this into a register load this + + align:start position:0% +loaded this into a register load this + + + align:start position:0% +loaded this into a register load this +into a register called one instruction + + align:start position:0% +into a register called one instruction + + + align:start position:0% +into a register called one instruction +add them and and so the sum function + + align:start position:0% +add them and and so the sum function + + + align:start position:0% +add them and and so the sum function +should be fast so we can call the built + + align:start position:0% +should be fast so we can call the built + + + align:start position:0% +should be fast so we can call the built +in sum function we can call our own sum + + align:start position:0% +in sum function we can call our own sum + + + align:start position:0% +in sum function we can call our own sum +function our own sum function I didn't + + align:start position:0% +function our own sum function I didn't + + + align:start position:0% +function our own sum function I didn't +put CMD here so that's gonna be twice as + + align:start position:0% +put CMD here so that's gonna be twice as + + + align:start position:0% +put CMD here so that's gonna be twice as +slow but + + align:start position:0% +slow but + + + align:start position:0% +slow but +yeah yeah yeah in fact if you look this + + align:start position:0% +yeah yeah yeah in fact if you look this + + + align:start position:0% +yeah yeah yeah in fact if you look this +the built in some function the built in + + align:start position:0% +the built in some function the built in + + + align:start position:0% +the built in some function the built in +sometimes was implemented in Julie it + + align:start position:0% +sometimes was implemented in Julie it + + + align:start position:0% +sometimes was implemented in Julie it +just hasn't had Cindy on the Sun so yes + + align:start position:0% +just hasn't had Cindy on the Sun so yes + + + align:start position:0% +just hasn't had Cindy on the Sun so yes +it says so LLVM is smart enough that if + + align:start position:0% +it says so LLVM is smart enough that if + + + align:start position:0% +it says so LLVM is smart enough that if +you give it a structure to values and + + align:start position:0% +you give it a structure to values and + + + align:start position:0% +you give it a structure to values and +and then load load them and if you tell + + align:start position:0% +and then load load them and if you tell + + + align:start position:0% +and then load load them and if you tell +it they know I mean adding these two + + align:start position:0% +it they know I mean adding these two + + + align:start position:0% +it they know I mean adding these two +value to these two values these two + + align:start position:0% +value to these two values these two + + + align:start position:0% +value to these two values these two +values to these two values it will it + + align:start position:0% +values to these two values it will it + + + align:start position:0% +values to these two values it will it +will actually use them the instructions + + align:start position:0% +will actually use them the instructions + + + align:start position:0% +will actually use them the instructions +I think oh maybe not no wait my some use + + align:start position:0% +I think oh maybe not no wait my some use + + + align:start position:0% +I think oh maybe not no wait my some use +Cindy confused I thought it did I + + align:start position:0% +Cindy confused I thought it did I + + + align:start position:0% +Cindy confused I thought it did I +thought I removed it yes maybe maybe + + align:start position:0% +thought I removed it yes maybe maybe + + + align:start position:0% +thought I removed it yes maybe maybe +it's not smart enough to use Cindy I've + + align:start position:0% +it's not smart enough to use Cindy I've + + + align:start position:0% +it's not smart enough to use Cindy I've +seen in some cases where it's smart + + align:start position:0% +seen in some cases where it's smart + + + align:start position:0% +seen in some cases where it's smart +enough to use yeah yeah okay so they're + + align:start position:0% +enough to use yeah yeah okay so they're + + + align:start position:0% +enough to use yeah yeah okay so they're +the same speed okay no I take I take it + + align:start position:0% +the same speed okay no I take I take it + + + align:start position:0% +the same speed okay no I take I take it +back so so maybe the LLVM is not smart + + align:start position:0% +back so so maybe the LLVM is not smart + + + align:start position:0% +back so so maybe the LLVM is not smart +enough in this case T to use somebody + + align:start position:0% +enough in this case T to use somebody + + + align:start position:0% +enough in this case T to use somebody +automatically we could try putting the + + align:start position:0% +automatically we could try putting the + + + align:start position:0% +automatically we could try putting the +Cindy annotation there and try it again + + align:start position:0% +Cindy annotation there and try it again + + + align:start position:0% +Cindy annotation there and try it again +but I thought it was but maybe not let's + + align:start position:0% +but I thought it was but maybe not let's + + + align:start position:0% +but I thought it was but maybe not let's +see this puts MD so weak we need to find + + align:start position:0% +see this puts MD so weak we need to find + + + align:start position:0% +see this puts MD so weak we need to find +that and then just rerun this so it'll + + align:start position:0% +that and then just rerun this so it'll + + + align:start position:0% +that and then just rerun this so it'll +notice that I changed the definition + + align:start position:0% +notice that I changed the definition + + + align:start position:0% +notice that I changed the definition +it'll recompile it but the B time since + + align:start position:0% +it'll recompile it but the B time since + + + align:start position:0% +it'll recompile it but the B time since +that times at multiple times it the + + align:start position:0% +that times at multiple times it the + + + align:start position:0% +that times at multiple times it the +first time it calls it sits low because + + align:start position:0% +first time it calls it sits low because + + + align:start position:0% +first time it calls it sits low because +it's compiling it but it takes the + + align:start position:0% +it's compiling it but it takes the + + + align:start position:0% +it's compiling it but it takes the +minimum over several times so so let's + + align:start position:0% +minimum over several times so so let's + + + align:start position:0% +minimum over several times so so let's +see + + align:start position:0% + + + + align:start position:0% + +yeah I mean this is this is a problem + + align:start position:0% +yeah I mean this is this is a problem + + + align:start position:0% +yeah I mean this is this is a problem +ins in general with with vectorizing + + align:start position:0% +ins in general with with vectorizing + + + align:start position:0% +ins in general with with vectorizing +compilers is they're not that smart if + + align:start position:0% +compilers is they're not that smart if + + + align:start position:0% +compilers is they're not that smart if +you're using anything other than just + + align:start position:0% +you're using anything other than just + + + align:start position:0% +you're using anything other than just +like an array of an elementary data type + + align:start position:0% +like an array of an elementary data type + + + align:start position:0% +like an array of an elementary data type +yeah no it didn't make any difference so + + align:start position:0% +yeah no it didn't make any difference so + + + align:start position:0% +yeah no it didn't make any difference so +I took him back you Sol Sol Sol Sol Sol + + align:start position:0% +I took him back you Sol Sol Sol Sol Sol + + + align:start position:0% +I took him back you Sol Sol Sol Sol Sol +for more complicated data structures you + + align:start position:0% +for more complicated data structures you + + + align:start position:0% +for more complicated data structures you +often have to use semi structures + + align:start position:0% +often have to use semi structures + + + align:start position:0% +often have to use semi structures +explicitly and there is there is a way + + align:start position:0% +explicitly and there is there is a way + + + align:start position:0% +explicitly and there is there is a way +to do that in julia and there and + + align:start position:0% +to do that in julia and there and + + + align:start position:0% +to do that in julia and there and +there's a higher-level library on top of + + align:start position:0% +there's a higher-level library on top of + + + align:start position:0% +there's a higher-level library on top of +that you can basically create a tuple + + align:start position:0% +that you can basically create a tuple + + + align:start position:0% +that you can basically create a tuple +and then add things and it'll um and + + align:start position:0% +and then add things and it'll um and + + + align:start position:0% +and then add things and it'll um and +it'll do 70 MD acceleration but yeah so + + align:start position:0% +it'll do 70 MD acceleration but yeah so + + + align:start position:0% +it'll do 70 MD acceleration but yeah so +anyway so that's there's a whole bunch + + align:start position:0% +anyway so that's there's a whole bunch + + + align:start position:0% +anyway so that's there's a whole bunch +of like this the story of like why Julie + + align:start position:0% +of like this the story of like why Julie + + + align:start position:0% +of like this the story of like why Julie +can be compiled of fast code it's a good + + align:start position:0% +can be compiled of fast code it's a good + + + align:start position:0% +can be compiled of fast code it's a good +combination of lots of little things but + + align:start position:0% +combination of lots of little things but + + + align:start position:0% +combination of lots of little things but +there there are a few big things one is + + align:start position:0% +there there are a few big things one is + + + align:start position:0% +there there are a few big things one is +the is that it's specialized thing as + + align:start position:0% +the is that it's specialized thing as + + + align:start position:0% +the is that it's specialized thing as +compiled times but of course you can do + + align:start position:0% +compiled times but of course you can do + + + align:start position:0% +compiled times but of course you can do +that in any language so that relies on + + align:start position:0% +that in any language so that relies on + + + align:start position:0% +that in any language so that relies on +designing the language so that you can + + align:start position:0% +designing the language so that you can + + + align:start position:0% +designing the language so that you can +do type inference it relies on having + + align:start position:0% +do type inference it relies on having + + + align:start position:0% +do type inference it relies on having +these kinds of parameterize types so and + + align:start position:0% +these kinds of parameterize types so and + + + align:start position:0% +these kinds of parameterize types so and +giving you a way to talk about types and + + align:start position:0% +giving you a way to talk about types and + + + align:start position:0% +giving you a way to talk about types and +attach types to other types so so the + + align:start position:0% +attach types to other types so so the + + + align:start position:0% +attach types to other types so so the +array you notice probably see now that + + align:start position:0% +array you notice probably see now that + + + align:start position:0% +array you notice probably see now that +you understand what these little braces + + align:start position:0% +you understand what these little braces + + + align:start position:0% +you understand what these little braces +mean you can see that the the the array + + align:start position:0% +mean you can see that the the the array + + + align:start position:0% +mean you can see that the the the array +is defined in Julia as another + + align:start position:0% +is defined in Julia as another + + + align:start position:0% +is defined in Julia as another +parametrized type its parametrized by + + align:start position:0% +parametrized type its parametrized by + + + align:start position:0% +parametrized type its parametrized by +the type of the element and also by the + + align:start position:0% +the type of the element and also by the + + + align:start position:0% +the type of the element and also by the +dimensionality so that that's that's + + align:start position:0% +dimensionality so that that's that's + + + align:start position:0% +dimensionality so that that's that's +uses the same mechanism to attach types + + align:start position:0% +uses the same mechanism to attach types + + + align:start position:0% +uses the same mechanism to attach types +to an array and you can have your own + + align:start position:0% +to an array and you can have your own + + + align:start position:0% +to an array and you can have your own +user the array type and julie is + + align:start position:0% +user the array type and julie is + + + align:start position:0% +user the array type and julie is +implemented mostly in julia and there + + align:start position:0% +implemented mostly in julia and there + + + align:start position:0% +implemented mostly in julia and there +are other packages that implement their + + align:start position:0% +are other packages that implement their + + + align:start position:0% +are other packages that implement their +own types of arrays that have the same + + align:start position:0% +own types of arrays that have the same + + + align:start position:0% +own types of arrays that have the same +performance one of the one of the goals + + align:start position:0% +performance one of the one of the goals + + + align:start position:0% +performance one of the one of the goals +of julia is to build in as little as + + align:start position:0% +of julia is to build in as little as + + + align:start position:0% +of julia is to build in as little as +possible so that that like there's not + + align:start position:0% +possible so that that like there's not + + + align:start position:0% +possible so that that like there's not +like some set of privileged privileged + + align:start position:0% +like some set of privileged privileged + + + align:start position:0% +like some set of privileged privileged +types that the compiler knows about and + + align:start position:0% +types that the compiler knows about and + + + align:start position:0% +types that the compiler knows about and +everything else is second class it's + + align:start position:0% +everything else is second class it's + + + align:start position:0% +everything else is second class it's +like you know a user code is majest as + + align:start position:0% +like you know a user code is majest as + + + align:start position:0% +like you know a user code is majest as +good as the built in code and in fact + + align:start position:0% +good as the built in code and in fact + + + align:start position:0% +good as the built in code and in fact +built in code is mostly just implemented + + align:start position:0% +built in code is mostly just implemented + + + align:start position:0% +built in code is mostly just implemented +in julia there's a small core that's + + align:start position:0% +in julia there's a small core that's + + + align:start position:0% +in julia there's a small core that's +implemented in c for bootstrapping + + align:start position:0% +implemented in c for bootstrapping + + + align:start position:0% +implemented in c for bootstrapping +basically yeah so having parameterize + + align:start position:0% +basically yeah so having parameterize + + + align:start position:0% +basically yeah so having parameterize +types having another technicalities + + align:start position:0% +types having another technicalities + + + align:start position:0% +types having another technicalities +having um all concrete types are final + + align:start position:0% +having um all concrete types are final + + + align:start position:0% +having um all concrete types are final +and julia so that means you can't it's a + + align:start position:0% +and julia so that means you can't it's a + + + align:start position:0% +and julia so that means you can't it's a +concrete type is something you can + + align:start position:0% +concrete type is something you can + + + align:start position:0% +concrete type is something you can +actually store memories so like 0.33 + + align:start position:0% +actually store memories so like 0.33 + + + align:start position:0% +actually store memories so like 0.33 +for something you actually have right + + align:start position:0% +for something you actually have right + + + align:start position:0% +for something you actually have right +you can an object of two integers is + + align:start position:0% +you can an object of two integers is + + + align:start position:0% +you can an object of two integers is +that type so it's concrete right as + + align:start position:0% +that type so it's concrete right as + + + align:start position:0% +that type so it's concrete right as +opposed to this thing this is an + + align:start position:0% +opposed to this thing this is an + + + align:start position:0% +opposed to this thing this is an +abstract type you can't actually have + + align:start position:0% +abstract type you can't actually have + + + align:start position:0% +abstract type you can't actually have +one of these you can only have one of + + align:start position:0% +one of these you can only have one of + + + align:start position:0% +one of these you can only have one of +the instances of the concrete types so + + align:start position:0% +the instances of the concrete types so + + + align:start position:0% +the instances of the concrete types so +but there are no this is final there + + align:start position:0% +but there are no this is final there + + + align:start position:0% +but there are no this is final there +it's not possible to have a subtype of + + align:start position:0% +it's not possible to have a subtype of + + + align:start position:0% +it's not possible to have a subtype of +this because if you could then you'd be + + align:start position:0% +this because if you could then you'd be + + + align:start position:0% +this because if you could then you'd be +dead because this is an array of these + + align:start position:0% +dead because this is an array of these + + + align:start position:0% +dead because this is an array of these +things if the compiler has to know it's + + align:start position:0% +things if the compiler has to know it's + + + align:start position:0% +things if the compiler has to know it's +actually these things and not some + + align:start position:0% +actually these things and not some + + + align:start position:0% +actually these things and not some +subtype of this alright so where is in + + align:start position:0% +subtype of this alright so where is in + + + align:start position:0% +subtype of this alright so where is in +other languages that Python you can have + + align:start position:0% +other languages that Python you can have + + + align:start position:0% +other languages that Python you can have +subtypes of concrete types and so then + + align:start position:0% +subtypes of concrete types and so then + + + align:start position:0% +subtypes of concrete types and so then +even if you said this is an array of a + + align:start position:0% +even if you said this is an array of a + + + align:start position:0% +even if you said this is an array of a +particular Python type you wouldn't + + align:start position:0% +particular Python type you wouldn't + + + align:start position:0% +particular Python type you wouldn't +really know it's that thing that type or + + align:start position:0% +really know it's that thing that type or + + + align:start position:0% +really know it's that thing that type or +might be some subtype of that that's one + + align:start position:0% +might be some subtype of that that's one + + + align:start position:0% +might be some subtype of that that's one +of the reasons why you can't implement + + align:start position:0% +of the reasons why you can't implement + + + align:start position:0% +of the reasons why you can't implement +numpy in Python this is there's no way + + align:start position:0% +numpy in Python this is there's no way + + + align:start position:0% +numpy in Python this is there's no way +to say though this is really that type + + align:start position:0% +to say though this is really that type + + + align:start position:0% +to say though this is really that type +and nothing else at that in a language + + align:start position:0% +and nothing else at that in a language + + + align:start position:0% +and nothing else at that in a language +level yeah oh yeah so it's calling LVM + + align:start position:0% +level yeah oh yeah so it's calling LVM + + + align:start position:0% +level yeah oh yeah so it's calling LVM +so basically the stage is you call so + + align:start position:0% +so basically the stage is you call so + + + align:start position:0% +so basically the stage is you call so +there's a few passes okay so and one of + + align:start position:0% +there's a few passes okay so and one of + + + align:start position:0% +there's a few passes okay so and one of +the fun things is you can actually + + align:start position:0% +the fun things is you can actually + + + align:start position:0% +the fun things is you can actually +inspect all the passes and almost + + align:start position:0% +inspect all the passes and almost + + + align:start position:0% +inspect all the passes and almost +intercept all of them practically so of + + align:start position:0% +intercept all of them practically so of + + + align:start position:0% +intercept all of them practically so of +course typing told like this first it + + align:start position:0% +course typing told like this first it + + + align:start position:0% +course typing told like this first it +gets parsed okay and you can a matter oh + + align:start position:0% +gets parsed okay and you can a matter oh + + + align:start position:0% +gets parsed okay and you can a matter oh +those things that are coming with AK + + align:start position:0% +those things that are coming with AK + + + align:start position:0% +those things that are coming with AK +actually are functions that are called + + align:start position:0% +actually are functions that are called + + + align:start position:0% +actually are functions that are called +at the right after parsing they can just + + align:start position:0% +at the right after parsing they can just + + + align:start position:0% +at the right after parsing they can just +take the parsed code and rewrite it + + align:start position:0% +take the parsed code and rewrite it + + + align:start position:0% +take the parsed code and rewrite it +arbitrarily so that's they can extend + + align:start position:0% +arbitrarily so that's they can extend + + + align:start position:0% +arbitrarily so that's they can extend +the language that way so it's first but + + align:start position:0% +the language that way so it's first but + + + align:start position:0% +the language that way so it's first but +then it's parsed maybe we may be + + align:start position:0% +then it's parsed maybe we may be + + + align:start position:0% +then it's parsed maybe we may be +rewritten by a macro and then you get an + + align:start position:0% +rewritten by a macro and then you get an + + + align:start position:0% +rewritten by a macro and then you get an +abstract syntax tree and then when you + + align:start position:0% +abstract syntax tree and then when you + + + align:start position:0% +abstract syntax tree and then when you +call it I say f of three then this is o + + align:start position:0% +call it I say f of three then this is o + + + align:start position:0% +call it I say f of three then this is o +X is an integer n 64 then it runs the + + align:start position:0% +X is an integer n 64 then it runs the + + + align:start position:0% +X is an integer n 64 then it runs the +type inference pass it tries to figure + + align:start position:0% +type inference pass it tries to figure + + + align:start position:0% +type inference pass it tries to figure +out what's what's the type of everything + + align:start position:0% +out what's what's the type of everything + + + align:start position:0% +out what's what's the type of everything +in which which version of Plus to call + + align:start position:0% +in which which version of Plus to call + + + align:start position:0% +in which which version of Plus to call +and so forth then it decides whether to + + align:start position:0% +and so forth then it decides whether to + + + align:start position:0% +and so forth then it decides whether to +inline some things and then Minh sits + + align:start position:0% +inline some things and then Minh sits + + + align:start position:0% +inline some things and then Minh sits +done all that it spits out LLVM byte + + align:start position:0% +done all that it spits out LLVM byte + + + align:start position:0% +done all that it spits out LLVM byte +code then calls LVM and compiles it to + + align:start position:0% +code then calls LVM and compiles it to + + + align:start position:0% +code then calls LVM and compiles it to +machine code and then it caches that + + align:start position:0% +machine code and then it caches that + + + align:start position:0% +machine code and then it caches that +someplace so for the next time you call + + align:start position:0% +someplace so for the next time you call + + + align:start position:0% +someplace so for the next time you call +you call f you know F of for F with + + align:start position:0% +you call f you know F of for F with + + + align:start position:0% +you call f you know F of for F with +another integer just calling this it + + align:start position:0% +another integer just calling this it + + + align:start position:0% +another integer just calling this it +doesn't repeat the same processes + + align:start position:0% +doesn't repeat the same processes + + + align:start position:0% +doesn't repeat the same processes +notice it's cached so that's that's beer + + align:start position:0% +notice it's cached so that's that's beer + + + align:start position:0% +notice it's cached so that's that's beer +but it's bit at the lowest level it's + + align:start position:0% +but it's bit at the lowest level it's + + + align:start position:0% +but it's bit at the lowest level it's +just a la vía so there's tons of things + + align:start position:0% +just a la vía so there's tons of things + + + align:start position:0% +just a la vía so there's tons of things +I haven't written so I haven't showed + + align:start position:0% +I haven't written so I haven't showed + + + align:start position:0% +I haven't written so I haven't showed +you I mentioned metaprogramming so it + + align:start position:0% +you I mentioned metaprogramming so it + + + align:start position:0% +you I mentioned metaprogramming so it +has this is macro facility and so you + + align:start position:0% +has this is macro facility and so you + + + align:start position:0% +has this is macro facility and so you +can basically write syntax that rewrites + + align:start position:0% +can basically write syntax that rewrites + + + align:start position:0% +can basically write syntax that rewrites +other syntax which is really cool for + + align:start position:0% +other syntax which is really cool for + + + align:start position:0% +other syntax which is really cool for +cogeneration you can also intercept it + + align:start position:0% +cogeneration you can also intercept it + + + align:start position:0% +cogeneration you can also intercept it +after the type inference face you can + + align:start position:0% +after the type inference face you can + + + align:start position:0% +after the type inference face you can +write something called the generated + + align:start position:0% +write something called the generated + + + align:start position:0% +write something called the generated +function that basically takes because at + + align:start position:0% +function that basically takes because at + + + align:start position:0% +function that basically takes because at +part's time it knows how things are + + align:start position:0% +part's time it knows how things are + + + align:start position:0% +part's time it knows how things are +spelled and you can rewrite how they're + + align:start position:0% +spelled and you can rewrite how they're + + + align:start position:0% +spelled and you can rewrite how they're +spelled but it doesn't know what + + align:start position:0% +spelled but it doesn't know what + + + align:start position:0% +spelled but it doesn't know what +anything actually means it does it just + + align:start position:0% +anything actually means it does it just + + + align:start position:0% +anything actually means it does it just +knows X as a symbol doesn't know X as an + + align:start position:0% +knows X as a symbol doesn't know X as an + + + align:start position:0% +knows X as a symbol doesn't know X as an +integer or whatever just knows the + + align:start position:0% +integer or whatever just knows the + + + align:start position:0% +integer or whatever just knows the +spelling so when you actually compile + + align:start position:0% +spelling so when you actually compile + + + align:start position:0% +spelling so when you actually compile +them of EXO at that point it knows X is + + align:start position:0% +them of EXO at that point it knows X is + + + align:start position:0% +them of EXO at that point it knows X is +an integer and so you can write + + align:start position:0% +an integer and so you can write + + + align:start position:0% +an integer and so you can write +something called a generator or a stage + + align:start position:0% +something called a generator or a stage + + + align:start position:0% +something called a generator or a stage +function that that basically runs at + + align:start position:0% +function that that basically runs at + + + align:start position:0% +function that that basically runs at +that time and says oh you told me X is + + align:start position:0% +that time and says oh you told me X is + + + align:start position:0% +that time and says oh you told me X is +an integer now I'll rewrite the code + + align:start position:0% +an integer now I'll rewrite the code + + + align:start position:0% +an integer now I'll rewrite the code +based on that and so this is really + + align:start position:0% +based on that and so this is really + + + align:start position:0% +based on that and so this is really +useful for there's some cool facilities + + align:start position:0% +useful for there's some cool facilities + + + align:start position:0% +useful for there's some cool facilities +for multi dimensional arrays because the + + align:start position:0% +for multi dimensional arrays because the + + + align:start position:0% +for multi dimensional arrays because the +the dimensionality of the array is + + align:start position:0% +the dimensionality of the array is + + + align:start position:0% +the dimensionality of the array is +actually part of the type so you can say + + align:start position:0% +actually part of the type so you can say + + + align:start position:0% +actually part of the type so you can say +oh this is a three dimensional array + + align:start position:0% +oh this is a three dimensional array + + + align:start position:0% +oh this is a three dimensional array +alright three loops oh this you have a + + align:start position:0% +alright three loops oh this you have a + + + align:start position:0% +alright three loops oh this you have a +four dimensional array alright for loops + + align:start position:0% +four dimensional array alright for loops + + + align:start position:0% +four dimensional array alright for loops +and and it can rewrite the code + + align:start position:0% +and and it can rewrite the code + + + align:start position:0% +and and it can rewrite the code +depending on the dimensionality and with + + align:start position:0% +depending on the dimensionality and with + + + align:start position:0% +depending on the dimensionality and with +code generation so you can have you can + + align:start position:0% +code generation so you can have you can + + + align:start position:0% +code generation so you can have you can +have code that basically generates any + + align:start position:0% +have code that basically generates any + + + align:start position:0% +have code that basically generates any +number of nested loops depending on the + + align:start position:0% +number of nested loops depending on the + + + align:start position:0% +number of nested loops depending on the +types of the arguments and all the + + align:start position:0% +types of the arguments and all the + + + align:start position:0% +types of the arguments and all the +generation is done at compile time after + + align:start position:0% +generation is done at compile time after + + + align:start position:0% +generation is done at compile time after +type inference so it knows the + + align:start position:0% +type inference so it knows the + + + align:start position:0% +type inference so it knows the +dimensionality of the array and yeah so + + align:start position:0% +dimensionality of the array and yeah so + + + align:start position:0% +dimensionality of the array and yeah so +that's that's there's lots of fun things + + align:start position:0% +that's that's there's lots of fun things + + + align:start position:0% +that's that's there's lots of fun things +like that of course it has parallel + + align:start position:0% +like that of course it has parallel + + + align:start position:0% +like that of course it has parallel +facilities and they're not quite as + + align:start position:0% +facilities and they're not quite as + + + align:start position:0% +facilities and they're not quite as +advanced as silk at this point but + + align:start position:0% +advanced as silk at this point but + + + align:start position:0% +advanced as silk at this point but +that's that's sort of the direction + + align:start position:0% +that's that's sort of the direction + + + align:start position:0% +that's that's sort of the direction +they're heading there's no global + + align:start position:0% +they're heading there's no global + + + align:start position:0% +they're heading there's no global +interpreter lock like in Python that you + + align:start position:0% +interpreter lock like in Python that you + + + align:start position:0% +interpreter lock like in Python that you +know there's no interpreter so the you + + align:start position:0% +know there's no interpreter so the you + + + align:start position:0% +know there's no interpreter so the you +know there's a threading facility and + + align:start position:0% +know there's a threading facility and + + + align:start position:0% +know there's a threading facility and +there's a pool of workers and you can + + align:start position:0% +there's a pool of workers and you can + + + align:start position:0% +there's a pool of workers and you can +spawn and you can you can thread a loop + + align:start position:0% +spawn and you can you can thread a loop + + + align:start position:0% +spawn and you can you can thread a loop +and the the garbage collection is + + align:start position:0% +and the the garbage collection is + + + align:start position:0% +and the the garbage collection is +is threating aware so that's safe and + + align:start position:0% +is threating aware so that's safe and + + + align:start position:0% +is threating aware so that's safe and +you know they're gradually having more + + align:start position:0% +you know they're gradually having more + + + align:start position:0% +you know they're gradually having more +and more powerful runtimes hopefully + + align:start position:0% +and more powerful runtimes hopefully + + + align:start position:0% +and more powerful runtimes hopefully +eventually looking into some of + + align:start position:0% +eventually looking into some of + + + align:start position:0% +eventually looking into some of +Professor license you know advanced + + align:start position:0% +Professor license you know advanced + + + align:start position:0% +Professor license you know advanced +threading compiler paper compiler or + + align:start position:0% +threading compiler paper compiler or + + + align:start position:0% +threading compiler paper compiler or +whatever it is there's also you know + + align:start position:0% +whatever it is there's also you know + + + align:start position:0% +whatever it is there's also you know +from most of what I do in my research is + + align:start position:0% +from most of what I do in my research is + + + align:start position:0% +from most of what I do in my research is +more coarse-grained distributed memory + + align:start position:0% +more coarse-grained distributed memory + + + align:start position:0% +more coarse-grained distributed memory +parallelism so you know running on + + align:start position:0% +parallelism so you know running on + + + align:start position:0% +parallelism so you know running on +supercomputers and stuff like that and + + align:start position:0% +supercomputers and stuff like that and + + + align:start position:0% +supercomputers and stuff like that and +that's there's there's MPI there's a + + align:start position:0% +that's there's there's MPI there's a + + + align:start position:0% +that's there's there's MPI there's a +remote procedure call library there's + + align:start position:0% +remote procedure call library there's + + + align:start position:0% +remote procedure call library there's +different different you know flavors of + + align:start position:0% +different different you know flavors of + + + align:start position:0% +different different you know flavors of +that but yeah so any other questions + + align:start position:0% +that but yeah so any other questions + + + align:start position:0% +that but yeah so any other questions +yeah the big numb type in julia is + + align:start position:0% +yeah the big numb type in julia is + + + align:start position:0% +yeah the big numb type in julia is +actually calling you so the so you + + align:start position:0% +actually calling you so the so you + + + align:start position:0% +actually calling you so the so you +know minh of those things let me just + + align:start position:0% + + + + align:start position:0% + +something we could a new notebook so so + + align:start position:0% +something we could a new notebook so so + + + align:start position:0% +something we could a new notebook so so +if i say i know big int you know three + + align:start position:0% +if i say i know big int you know three + + + align:start position:0% +if i say i know big int you know three +three thousand okay and then i'd say + + align:start position:0% +three thousand okay and then i'd say + + + align:start position:0% +three thousand okay and then i'd say +that to the SI factorial I think there's + + align:start position:0% +that to the SI factorial I think there's + + + align:start position:0% +that to the SI factorial I think there's +a built in fakie factorial of that right + + align:start position:0% +a built in fakie factorial of that right + + + align:start position:0% +a built in fakie factorial of that right +so so and this is called a big numb + + align:start position:0% +so so and this is called a big numb + + + align:start position:0% +so so and this is called a big numb +it's something where the number of + + align:start position:0% +it's something where the number of + + + align:start position:0% +it's something where the number of +digits changes at runtime so of course + + align:start position:0% +digits changes at runtime so of course + + + align:start position:0% +digits changes at runtime so of course +these are orders of magnitude slower + + align:start position:0% +these are orders of magnitude slower + + + align:start position:0% +these are orders of magnitude slower +than I know Hardware things because it + + align:start position:0% +than I know Hardware things because it + + + align:start position:0% +than I know Hardware things because it +basically it has to implement it as a + + align:start position:0% +basically it has to implement it as a + + + align:start position:0% +basically it has to implement it as a +loop of a loop of digits in some base + + align:start position:0% +loop of a loop of digits in some base + + + align:start position:0% +loop of a loop of digits in some base +and when you add a multiple you have to + + align:start position:0% +and when you add a multiple you have to + + + align:start position:0% +and when you add a multiple you have to +just loop over those at runtime so these + + align:start position:0% +just loop over those at runtime so these + + + align:start position:0% +just loop over those at runtime so these +big name libraries they're quite large + + align:start position:0% +big name libraries they're quite large + + + align:start position:0% +big name libraries they're quite large +and heavily optimized and so so nobody's + + align:start position:0% +and heavily optimized and so so nobody's + + + align:start position:0% +and heavily optimized and so so nobody's +reimplemented one in julia they're just + + align:start position:0% +reimplemented one in julia they're just + + + align:start position:0% +reimplemented one in julia they're just +calling out to a c library called the + + align:start position:0% +calling out to a c library called the + + + align:start position:0% +calling out to a c library called the +new multi precision library and for + + align:start position:0% +new multi precision library and for + + + align:start position:0% +new multi precision library and for +floating-point values there's there's + + align:start position:0% +floating-point values there's there's + + + align:start position:0% +floating-point values there's there's +something called big float it's a big + + align:start position:0% +something called big float it's a big + + + align:start position:0% +something called big float it's a big +float of pi is is that I can actually + + align:start position:0% +float of pi is is that I can actually + + + align:start position:0% +float of pi is is that I can actually +this let's set set precision + + align:start position:0% + + + + align:start position:0% + +big float mm that's 1,000 binary digits + + align:start position:0% +big float mm that's 1,000 binary digits + + + align:start position:0% +big float mm that's 1,000 binary digits +and then say big float of Pi and and + + align:start position:0% +and then say big float of Pi and and + + + align:start position:0% +and then say big float of Pi and and +it's no it's more by the way yeah you + + align:start position:0% +it's no it's more by the way yeah you + + + align:start position:0% +it's no it's more by the way yeah you +might have so I can have a variable + + align:start position:0% +might have so I can have a variable + + + align:start position:0% +might have so I can have a variable +alpha oops alpha hat sub 2 equals 17 + + align:start position:0% +alpha oops alpha hat sub 2 equals 17 + + + align:start position:0% +alpha oops alpha hat sub 2 equals 17 +that's allowed all this happening here + + align:start position:0% +that's allowed all this happening here + + + align:start position:0% +that's allowed all this happening here +is that you is that Julia allows almost + + align:start position:0% +is that you is that Julia allows almost + + + align:start position:0% +is that you is that Julia allows almost +arbitrary Unicode things for identifiers + + align:start position:0% +arbitrary Unicode things for identifiers + + + align:start position:0% +arbitrary Unicode things for identifiers +so I can have you know make it bigger + + align:start position:0% +so I can have you know make it bigger + + + align:start position:0% +so I can have you know make it bigger +it's like you know we can have an + + align:start position:0% +it's like you know we can have an + + + align:start position:0% +it's like you know we can have an +identifier koala right so so there's two + + align:start position:0% +identifier koala right so so there's two + + + align:start position:0% +identifier koala right so so there's two +issues so one is just a lot of a + + align:start position:0% +issues so one is just a lot of a + + + align:start position:0% +issues so one is just a lot of a +language that allows those things as + + align:start position:0% +language that allows those things as + + + align:start position:0% +language that allows those things as +identifiers so Python 3 also allows + + align:start position:0% +identifiers so Python 3 also allows + + + align:start position:0% +identifiers so Python 3 also allows +Unicode identifiers although I think + + align:start position:0% +Unicode identifiers although I think + + + align:start position:0% +Unicode identifiers although I think +Julia out of all the existing the like + + align:start position:0% +Julia out of all the existing the like + + + align:start position:0% +Julia out of all the existing the like +the common language is probably as the + + align:start position:0% +the common language is probably as the + + + align:start position:0% +the common language is probably as the +widest Unicode support but most most + + align:start position:0% +widest Unicode support but most most + + + align:start position:0% +widest Unicode support but most most +languages only have a allow a very + + align:start position:0% +languages only have a allow a very + + + align:start position:0% +languages only have a allow a very +narrow range of Unicode characters for + + align:start position:0% +narrow range of Unicode characters for + + + align:start position:0% +narrow range of Unicode characters for +identifiers so Python would not would + + align:start position:0% +identifiers so Python would not would + + + align:start position:0% +identifiers so Python would not would +allow the koala but with python 3 would + + align:start position:0% +allow the koala but with python 3 would + + + align:start position:0% +allow the koala but with python 3 would +not allow without alpha hat some two + + align:start position:0% +not allow without alpha hat some two + + + align:start position:0% +not allow without alpha hat some two +because it doesn't the numeric subscript + + align:start position:0% +because it doesn't the numeric subscript + + + align:start position:0% +because it doesn't the numeric subscript +Unicode characters it doesn't allow the + + align:start position:0% +Unicode characters it doesn't allow the + + + align:start position:0% +Unicode characters it doesn't allow the +other thing is how do you type these + + align:start position:0% +other thing is how do you type these + + + align:start position:0% +other thing is how do you type these +things and that's more of an editor + + align:start position:0% +things and that's more of an editor + + + align:start position:0% +things and that's more of an editor +thing and so in Julie we mean we + + align:start position:0% +thing and so in Julie we mean we + + + align:start position:0% +thing and so in Julie we mean we +implemented it initially in the repple + + align:start position:0% +implemented it initially in the repple + + + align:start position:0% +implemented it initially in the repple +and in in in jupiter and now all the + + align:start position:0% +and in in in jupiter and now all the + + + align:start position:0% +and in in in jupiter and now all the +editors support you can just do tab + + align:start position:0% +editors support you can just do tab + + + align:start position:0% +editors support you can just do tab +completion of latex I can type I can + + align:start position:0% +completion of latex I can type I can + + + align:start position:0% +completion of latex I can type I can +type you know gamma tab and the tab + + align:start position:0% +type you know gamma tab and the tab + + + align:start position:0% +type you know gamma tab and the tab +completes to the Unicode character I can + + align:start position:0% +completes to the Unicode character I can + + + align:start position:0% +completes to the Unicode character I can +see I can say dot and it puts a dot over + + align:start position:0% +see I can say dot and it puts a dot over + + + align:start position:0% +see I can say dot and it puts a dot over +it and backslash + + align:start position:0% +it and backslash + + + align:start position:0% +it and backslash +superscript four and it you know if it's + + align:start position:0% +superscript four and it you know if it's + + + align:start position:0% +superscript four and it you know if it's +a four and that's its and that and + + align:start position:0% +a four and that's its and that and + + + align:start position:0% +a four and that's its and that and +that's that's allowed so I says it's + + align:start position:0% +that's that's allowed so I says it's + + + align:start position:0% +that's that's allowed so I says it's +it's quite nice so like Debbie emails + + align:start position:0% +it's quite nice so like Debbie emails + + + align:start position:0% +it's quite nice so like Debbie emails +and I put equations and emails I go to + + align:start position:0% +and I put equations and emails I go to + + + align:start position:0% +and I put equations and emails I go to +the Julia repple and + + align:start position:0% +the Julia repple and + + + align:start position:0% +the Julia repple and +and tab complete all my latex characters + + align:start position:0% +and tab complete all my latex characters + + + align:start position:0% +and tab complete all my latex characters +so that I can put equations and emails + + align:start position:0% +so that I can put equations and emails + + + align:start position:0% +so that I can put equations and emails +because it's the easiest way to type + + align:start position:0% +because it's the easiest way to type + + + align:start position:0% +because it's the easiest way to type +these unicode math characters but yeah + + align:start position:0% +these unicode math characters but yeah + + + align:start position:0% +these unicode math characters but yeah +so that's yeah I Python borrowed this so + + align:start position:0% +so that's yeah I Python borrowed this so + + + align:start position:0% +so that's yeah I Python borrowed this so +the second I'll do the same thing in in + + align:start position:0% +the second I'll do the same thing in in + + + align:start position:0% +the second I'll do the same thing in in +the ipython notebooks as well so because + + align:start position:0% +the ipython notebooks as well so because + + + align:start position:0% +the ipython notebooks as well so because +it's it's it's really fun when you're + + align:start position:0% +it's it's it's really fun when you're + + + align:start position:0% +it's it's it's really fun when you're +writing it finally you know because if + + align:start position:0% +writing it finally you know because if + + + align:start position:0% +writing it finally you know because if +you read old math codes especially old + + align:start position:0% +you read old math codes especially old + + + align:start position:0% +you read old math codes especially old +Fortran codes or things you see lots of + + align:start position:0% +Fortran codes or things you see lots of + + + align:start position:0% +Fortran codes or things you see lots of +variables that are named alpha hat or + + align:start position:0% +variables that are named alpha hat or + + + align:start position:0% +variables that are named alpha hat or +something like the alpha hat underscore + + align:start position:0% +something like the alpha hat underscore + + + align:start position:0% +something like the alpha hat underscore +three it's so much nicer to have a + + align:start position:0% +three it's so much nicer to have a + + + align:start position:0% +three it's so much nicer to have a +variable that's actually the alpha hat + + align:start position:0% +variable that's actually the alpha hat + + + align:start position:0% +variable that's actually the alpha hat +sub 3 so that's cute + + align:start position:0% +sub 3 so that's cute + + + align:start position:0% +sub 3 so that's cute +Steve thanks very much thanks this was + + align:start position:0% +Steve thanks very much thanks this was + + + align:start position:0% +Steve thanks very much thanks this was +great + + align:start position:0% +great + + + align:start position:0% +great +we are as he'd mentioned looking + + align:start position:0% +we are as he'd mentioned looking + + + align:start position:0% +we are as he'd mentioned looking +actually at a project to merge the Julia + + align:start position:0% +actually at a project to merge the Julia + + + align:start position:0% +actually at a project to merge the Julia +Technology with a silk technology and so + + align:start position:0% +Technology with a silk technology and so + + + align:start position:0% +Technology with a silk technology and so +we're right now in the process of + + align:start position:0% +we're right now in the process of + + + align:start position:0% +we're right now in the process of +putting together grant proposal and if + + align:start position:0% +putting together grant proposal and if + + + align:start position:0% +putting together grant proposal and if +that gets funded there may be some + + align:start position:0% +that gets funded there may be some + + + align:start position:0% +that gets funded there may be some +Europe's + + align:start position:0% +Europe's + + + align:start position:0% +Europe's +[Music] + + align:start position:0% + + + + align:start position:0% + +you \ No newline at end of file