@@nateF888 GPUs use a variation of SIMD parallelism, which means that the same code is executed simultaneously on many different sets of data. This is great for graphics because quite often you'll need to run the same code once per pixel or once per vertex of a 3D object or something like that. It does however come with some restrictions. Even a simple if-else requires a bit of trickery and is only efficient in some cases. What GPUs simply cannot do is function pointers. You may not notice it when programming in a high level language but most languages extensively use function pointers, i.e. they pass a reference to executable code around like a value. This makes translating code for the GPU from normal programming languages challenging. Usually you use GPU-specific programming languages like GLSL or HLSL. As for why it's great to run code on the GPU: SIMD parallelism is very efficient for tasks where it works well. An Intel Core i5 12400 can perform 47 billion floating point operations per second (and I think that already includes the little bit of SIMD that even CPUs have nowadays). It also comes with a basic integrated GPU so that it can be used without an actual graphics card. It's not enough for high end gaming but it's ok for most everyday tasks. That Intel UHD Graphics 730 on the same chip can perform 350 billion floating point operations per second.
I've changed to Julia from Python early in my scientific career (differential equations, numerical modelling) and it has been the best decision in my life!
I've been using Julia in a few of my micro applications and the ecosystem/dev environment is not only very friendly and accommodating, but it is beautiful to write. It's a Love triangle of Ruby and C++ with python at the bottom.
I Like how at 1:02 you typed .js then corrected yourself showing the love you have for JavaScript or maybe it's because you've covered soo many js frameworks that your muscle memory can't help itself but type .js whenever there's need of an extension
I love Julia! I hope it gets picked up for elective courses in compsci in universities, and built into graphic calculators. It makes math such a breeze! For one, it handles rational values with the // operator, so you can for example multiply 3//4 * 1//2 (to give you 3//8). It handles vectors and matrices and has SO many built-in math functions. Great language!
Well say no more, in my uni they are teaching algo, linear equations, optimization by implementing it in Julia. And I must say, what a powerful language, blows my mind when compared to python.
Python handles its rational Fraction type with the regular “/” operator. E.g. from fractions import \ Fraction as F print(F(3) / 4 * 1 / 2) prints out 3/8
I’m actually planning on porting Emac’s Calc program as a capstone for my Julia foray. Whats nice about Julia is that as it stands, it nearly IS the graphic calculator.
It's because it's a buggy mess. People try it out because it promises the world, then they see it doesn't live up, vote with their feet and move on. What you end up seeing is the language making huge promises but not having any widespread adoption and think people just aren't paying attention. They are, but they need a language that can actually be used in production and julia's not it.
Julia is an amazing language. Fast yet concise code, but the true power lies in composability in my opinion. The way you can mix together custom types from many different libraries and make them smoothly work together is almost like magic. The package manager is also
@@TheJuliaLanguage absolutely I agree that things are improving fast. It’s great that new features and libraries are being developed, but I feel like it would also be a good idea to coordinate the efforts with the newcomers’ experience in mind. Not blaming anyone, these things take time!
When I tried it for the first and last time to render large panoramas as seen from certain summit from height maps, I had trouble to realize how to break code into smaller files. Is it my problem or is it some unfinished part of the language? I mean files with 100s lines of code, not necessarily libraries.
I think the best part of Julia is the differential equations library and it's amazing integration with Machine learning libraries. Scientific machine learning techniques like PINNs and neural ODEs are so much better in Julia than in pytorch or tensorflow.
@@anon9322 engineers of many disciplines live and breath differential equations. the fact that julia is both faster and easier to write than matlab, and also open source (free), makes it a huge game changer for the industry
I've started a course on statistics and machine learning (regression stuff), in there they use scikit learn (python) and R. While i kinda-like python (coming from c-style languages missing curly-braces and all the other stuff is very very strange =D ), R felt outdated and overly complicated, because its syntax feels very very inconsistent, so i searched for a more modern alternative and stumbled upon Julia. It feels so much modern, consistend, well-thought through, it was like an epiphany, while i was fighting with R on many occasions, the Julia syntax just felt right, it was like "if i would be creating a language for maths and stuff, it would be exactly like this" =)
I use Julia for anything requiring heavy numeric and symbolic calculations, but still use R when I need to create and mutate a 2d array (dataframe). Don’t use base R though religiously stick to Tidyverse syntax (specifically dylplr).
I haven't worked with Julia. But have read some articles about it and found the language is perfect for what it was made for like machine learning, data visualization, and mathematics.
I'm still trying to figure out why some languages like this are "perfect" for some advanced things, but are somehow not for things I would consider easy, like web development.
Likely. Depends on what you mean by data visualization, for text analysis, working with tables and plotting graphs, I'd choose Python. For working with large 2D to 4D data and computing them on fly, Python is painfully slow. Still viable if you can prototype it at small resolution and run overnight. But if you are doing some data processing and Python does not have fast library written in C++ for that purpose, maybe Julia is worth trying (C++ might be an option as well)
@@leonf.7893 Honestly, the only differentiators are the core library and the frameworks. You can do any task in any language with equal effectiveness as long as you sufficiently optimize the compiler or the runtime. The thing is that languages are built by communities, so they will prioritize core features and optimizations for specific tasks which in the long term makes them excel at that specific task while everything else is sidelined. Almost every language exists because at some point someone thought "I want feature x in language y with optimizations for z" so they create a chimera that's focused on their specific problem, then people that have a similar problem congregate.
Really love the speed/optimizations this language has. Had this particular code in MATLAB that took an average of 6 seconds to run, porting it to Julia reduced it down to 0.3 seconds, scale that up to the hundreds of times I usually run that code and the time saving explodes.
Impressive. Any chance you'd try porting the same code to python with the numba JIT compiler library? I'd love to see how they compare. Some sources put numba's JIT compiler at 1000 times faster than native python execution of equivalent code in math heavy applications of course
@@lucky-segfault I don't work in the lab that had those codes anymore. But, I do know who maintains that code now, I'll let them know about your idea and maybe they'll implement it. If they do I'll let you know how it goes. It might work well since our code is for cell simulations and generally just involves thousands upon thousands of coupled diff eqs being solved.
FYI matlab is jit compiled as well, but with quite a different phylosophy wrt to julia, most probably the 20x speedup comes from memory management / allocations. I would bet numba achieves far less than 1000x wrt to matlab here (note that in general matlab is way faster then pure python).
I started learning Julia a few weeks ago, and all I can say is that it is by far my favorite programming language. I will give my opinions on it, but I'm not extremely familiar with computer science, so forgive my vocabulary and lack of other languages for comparison. I will say what I like as I think of it. I love the range operator (:), it makes it very easy to iterate through values, and can also be reversed and modified to include a jump (sorry for the lack of better words). It also works with strings, as it does in python. However, it has a few differences from pythons. First of all, the range operator can actually be used in a for loop. For example, for i=1:10 ... end instead of for i in range(1,10). Another difference is the use of the end operator. In python, strings can be accessed from the last index using something like [-3:]. But in Julia, end must be used, for example as [end-3:end], which is better for visual purposes and avoiding confusion. Speaking of end, Julia avoids any confusing by closing if statements, functions, for/while loops, do statements, let statements, structs, and more using the end keyword, which avoids confusion and removes the picky indentation system that python features. semicolons are also available for use, but are optional Functions can also be declared like f(x) = x + 2, which is very cool in my opinion. I'm not aware of any specific language that does this other than Julia, but there are likely some. Another thing I love in Julia is the unicode implementation. In VSCode, I can input unicode characters that actually are interpreted as certain things. for example, for i in 1:10 is the same as for i ∈ 1:10. There are so many more examples of this, which I find very fun to use. I mentioned earlier do statements, which make iteration and other things very easy. Things like map( num -> num+2, 1:10 ) can be replaced with map(1:10) do num num+2 end, which is very syntactically nice. These are just a few of the things I enjoy, among so many more. If you like simple but powerful languages, check out Julia. I did, and I don't regret it. Programming in Julia is extremely enjoyable. It has its own package manager, great documentation, many amazing packages, so many functions and tools, and much more. Enjoy!
Just wanted to let you know, functions that can be declared like f(x) = x + 2 is a feature of a programming paradigm called "functional programming". Pretty much all "functional programming languages" (programming languages that mainly follow the functional programming paradigm, such as Haskell) have that feature. You can also do that in Python using lambda as follows: f = lambda x: x + 2
Wow this is my favourite in 100 seconds video. Really exciting language, that I even though had heard of it, never took time to read into it and now I feel like I’m missing out. Julia seems really really amazing and different. I’m hoping there is a wider use than stats, data viz and such. Thanks Jeff
@@UltravioletMind python just has so much developed for it and such wide spread use it's hard to overcome. Maybe in the long run julia will take over for the scientific/math/data/ML type applications (much like python itself has had slow but steady growth for years and years) but it's not likely to happen over night. That said, I do feel like I see it mentioned more than I did 3 or 4 years ago
The use cases are expanding. Like, there has been work on using it for server side stuff, front end web design, and even some game dev stuff, but the libraries for that arent super developed. atm it is mostly large computing and stats and science stuff
I think the language will properly explode with Julia 2.0. I think that's when they want to have full support for ahead of time compilation. So executables can be small and portable. Currently, you can statically compile your code, but the executables are huge because they include everything exported by dependancies or imported by your code.
I usually frown a bit when discovering new languages because of the complexity of reading the unknown tokens and syntax in general. Didn't happen with this one. Seems very straightforward and flexible. Deserves an upvote... Or like...
Honestly, I love the fact that not every function must be attached to an object. I feel like our worship of OOP has lead us down a road that didn't really pay off. This whole "but OOP makes your code so reusable" promise was never really kept. I want a banana, and end up importing the whole jungle instead. I like that Julia does away with that.
This implies that Julia is somehow unique in this regard whereas most functional, imperative, and multiparadigm languages all support first-class functions to some extent. I feel like the OOP=best debate is already outdated and nobody actually thinks this.
Rust, C++, JS, TS, go, and a few others let you do this too. OOP is overrated but it's still useful in some applications. The issue is more about understanding how a piece of code will be used and what paradigm is best for that a given use case
By far the best language for academic and scientific purposes. My brother uses it all the time and loves it. It also got me to shut up about how slow his python code used to run, because Julia performed just as well as the random C replacement I would show him could do the job better (obviously it was minutes to sheer seconds faster then the python variant).
@@nathanjokeley4102 run time. When you do matrix multiplication on large complex numbers on huge scales and for huge dimensions with sparse matrices the difference is absolutely insane. The python variants simply can't keep pace. I originally showed my brother who was doing his PhD on quantum circuits and trying to find optimized algorithems that his then mathematix was running to slow, by doing a simple sample in C++, he ended up rewriting it into python, but that had a 100x uplift compared to his old approach with the right libraries but i then showed him how much faster still it was in my C++, so he talked to some experts at a conference and they all praised Julia for this kind of workload. Sure enough it outperformed my first pass C++ equivalent and when I looked up official run time figures julia was tied with C++, C implimentations for this kind of work scenario. Julia is a rock solid language for calculation, simulation, and other programming purposes.
@@lutzleipold5206 "Julia is a rock solid language" Julia is incredibly buggy. You can use many positive adjectives to describe it but "rock solid" is definitely not one of them.
0:07 - A slim and tall guy - Indian or arab guy - A blonde/redhead guy who came from northern/eastern europe - A guy with a big belly and whose eyes seems to saw the sunlight only a few times in his life This could be any IT team in any IT firm.
Woah! I remember suggesting Julia in one of your community posts but I never thought you'd do it. Thank you for this! It puts into perspective just how much is crammed into Julia and all the features it has. You didn't even mention the metaprogramming aspect, one-based indexing, column-major order, REPL workflow, etc., but for a short video like this it sure is jam-packed.
A friend of mine told me about julia almost 10 years ago, it was at the very beginning, and he said it was really good and his favotire language. I have never learned past the ultra basics, and the name never left my mind.
I love the multiple dispatch, the type annotation lets the JIT complier optimize the code to specific machine code for each type, making it super fast (C# its other language that has an amazing JIT), but you a have a first call performance cost, I guess that its some kind of issue unless they also implent some AOT compilation also, other than that this language is really really interesting and for sure will become a top choice in the future
Using Julia at work now to do some cool things. First time I see one of your videos on something I already knew, made me appreciate your channel even more. Keep up the great work!
Don’t know if this has been suggested before, but I think a PHP for the haters video would be great to watch! It would be entertaining to see how you go about roasting that language.
He made Java for the haters, based in my interactions with various communities I thought Ruby would take the crown of most hated language but Jeff introduced a different perspective.
Please consider a video on Fortran. Modern Fortran is similar to Julia in some ways, emphasizing performance and used in scientific computing, with good support for multi-dimensional arrays.
We got our Fortran video! And yeah, Modern Fortran is a great language, I'm currently refactoring some hideous codes to modern standards and the difference is enormous
I taught a class this week on PCA. Blew all the students' minds when I showed them you can do it in just a few lines of base Julia, and have it run faster than ScikitLearn.
We had to use Julia in Applied Mathematics at UNI last year when the only docs were the ones from Julia itself. No yt vids, no stackoverflow, no nothing. It was hell.
I've known about Julia for a few years and find it super intriguing, but I'm just a hobbyist and don't have the use case for learning Julia yet. Same with Rust. Anyone out there using Julia (or Rust) as a hobbyist? If so, what for?
If I'm not mistaken, Julia isn't JIT. The compiler isn't active during runtime. I've seen people in the Julia community calling it "Just Ahead of Time", instead of "Just in Time".
1:45 one of the reasons julia is so fast is that the dispatch is done mainly at compile time, escaping to dynamic (run-time) dispatch only when necessary, i.e., when it's not possible to infer type at compile-time
Wow, this is really interesting. I kinda looked past Julia when I first saw its announcement, but now I'm interested as heck. Could you make a similar video about Nim or D?
I learned about Julia in 2012. Back then they had this claim that it was super fast and generic. I even saw their benchmark, but I never believed it. Wasn't until 2020 that I gave it a go. It's my main language now.
You save a lot of time with these 100s videos, if I want to learn some concept first I review if you made a video. Thanks a lot!! Could you please, make a video about UML and some other methods display process.
Fun fact: Did you know Julia ships a patched version of LLVM to fix correctness bugs in numerical methods? While at the same time the Julia ecosystem and libraries have reported a big number of correctness bugs...
How many people if Jeff consist of? I do not shit as often as he creates content, yet a new video is never just a new video, it is a whole iteration. I always catch small improvements here and there. Mad respect.
Can you do Zig next? It’s the best in the programming language drag race, but because it’s only 5 ish years old, there’s not a lot of info on RUclips about it
I've googled but can't find anything, what's the dot vector syntax? Does x. mean x is a vector and, if so, why do we need it instead of just doing x = [3; 5; 7; ...]?
@@mrocto329 the dot in X.*2 is a shortcut for broadcasting. If you search for broadcasting in Julia you will learn a lot more about it. Basically it stands for: multiply every element in the vector by 2
@@mrocto329 the dot syntax means to peform an operation for every element of an array instead the array itself, array.map in other languages. For example, in javascript, if you want to create an array where every element is the element of an old array + 5, you would do something like: let newArray = oldArray.map(x => x + 5) The equivalent julia code is: newArray = map(x -> x + 5, oldArray) But you can use dot syntax to "broadcast" the operation for every element of the oldArray, like this: newArray = oldArray .+ 5 This is a much more cleaner syntax.
That is not a dot multiplication, that is a scalar multiplication. Dot multiplication is important when multiplying two vectors or matrices, as it is a different operation from element wise multiplication.
I don't get why multiple-dispatch is necessary to determine which function to call in the case when the switch is based on a static type, such as string or int. The compiler knows at build time which version ought to be called and could mind to that specific version directly, not that different from overloading. Perhaps the example of multiple dispatch here is wrong. Maybe an example where the runtime type is used for dispatching, or possibly another value, such as greater than zero, or equal to zero. I don't know. Never used the language, but if it's statically typed, that design wouldn't make sense.
You can do that by knowing in advance your function may encounter only say string or int64 in the future. But in julia, you can use somebody else's function in your code, invent some new type you need for yourself, write what this function does when it encounters your new type and use it with the whole julia ecosystem without ever modifying the initial code. To learn more, I suggest this nice talk by one of the language creators: ruclips.net/video/kc9HwsxE1OY/видео.html
it’s pretty common to run into situations in C++ or similar where you’ve got a dozen similar functions for a variable that could be 4 or 5 different types. C++ has templates and overloading, but it doesn’t have any runtime type checking whatsoever leading to a web of if statements and super repetitive code. i think it’s a pretty welcome feature that the language will step in and help me dispatch the appropriate function if i want
The major advantace of multiple dispatch is that you can dispatch functions of libraries you are importing, chainging the internal behaviour of a library without touching the original code. This is what makes it so powerful: you can implement your objects, define basic operations on them, and call any julia library passing them as a argunent and it works! There are amazing interactions between packages in julia thanks to this feature.
In practice, the JIT compile time in Julia is often slower than the entire run time of equivalent Python code. Julia works best as a REPL where it can cache the JIT compiled functions for re-use. Otherwise, don't expect to be impressed by Julia's script performance
That is true only if your script takes few seconds to run and you have to run it only once, that is a case in which you do not need performances so yeah, no big reasons to use julia. But in all other cases, the difference is astonishing
I looked it up. I can't link the software engineering stack overflow post here w/o being reported as spam, so I'll summarize: dispatching is for dynamic types (types that can change at runtime). Overloading is only for static types (so like Java). this seems like a weird difference to have a whole new confusing term for.
It's not the same, in Java for example yes you can have multiple functions with the same name but different argument types (overloading), but when you invoke such function you explicitly need to say which one you want to use, you can't simple pass generic types, the code will not compile. With multiple dispatch, like in Julia, you don't need to specify, you just pass an object and in runtime the correct function is selected (this is multiple dispatch, which Java doesn't support) .
NGL, Julia looks very promising. Give it large enough ecosystem of projects, and it will replace Python, and become a new golden standard in ML and Data Science
You should do an "R in 100 Seconds" video! As a more specialized statistical computing language, it would be really interesting to see how its defining features compare to those of Julia.
I don't even know a single language fully and now I want to learn Julia, thank you fireship for making me want to learn 3 languages at once and ruining my life by that
@@abdullahmertozdemir9437 If you don't have any particular projects in your head, I would suggest to learn C# for Windows Applications OR Kotlin for Android Applications OR Swift for anything Apple related OR JavaScript for Web. Those languages are easy to pick up and write in. After that you could learn whatever you want ;-)
@@igorthelight Currently I have C++, JavaScript and Julia in my bucketlist (gotta add Flutter there when I am done with them all for quick mobile apps) but I think I am at that phase where you get into something new and go "and I will do this and that" then realize it is just not that easy. For now I want to learn SFML and OpenGL for C++ and then will jump to javascript course on scrimba. Only then, I believe, I can start talking about learning any other thing
@@igorthelight But I think I have a strong foundation though, I got done with data structures etc. and basics of C++ so I believe learning another language won't be as hard after that
Thats the humans count.Its there for ease, especially if you are more of a science guy than a professional programmer. Python has been my first language, i am using in my phd.Have been exposed to Julia recently and i absolutely love the syntax.I am slowly starting to pick and maybe someday do most of my work in it!!
@@ayushkumarsingh8020 "Thats the humans count" Sure, but it's objectively the wrong choice for programming and for me pretty much a deal breaker when picking a language.
wow another one, and honest I didn't know it. As a self-taught developer using Js and React, I'm now learning Python and this video is super helpful. Thanks Jeff ✌🏻
Compilation: AoT makes sense for releases, while JiT makes sense for real time development and sciencey things. Interpreted makes sense for shells/hacking. Languages should be more ambitious in covering all the bases.
I think of multiple dispatch as taking the methods out of the class and putting it into the function, keeping the data in structs and the behavior in functions. instead of: class(type) function -fields (data) -methods(behavior) we have: struct(type) function -fields(data) -methods(behavior)
0:59 wrong!! `pi` is not a `Float64`, but actually `Irrational{:π}`. i think there's some intermediate method that uses a precomputed Float64 pi though
I love how you just casually finish with "can run on the GPU natively" like that's not a big deal
Im new to programmnjing. How is that a big deal
@@nateF888 it means you don't have to use wierd libraries and syntax to run GPU code. Eg. Cuda
@@nateF888 GPUs use a variation of SIMD parallelism, which means that the same code is executed simultaneously on many different sets of data. This is great for graphics because quite often you'll need to run the same code once per pixel or once per vertex of a 3D object or something like that. It does however come with some restrictions. Even a simple if-else requires a bit of trickery and is only efficient in some cases. What GPUs simply cannot do is function pointers. You may not notice it when programming in a high level language but most languages extensively use function pointers, i.e. they pass a reference to executable code around like a value. This makes translating code for the GPU from normal programming languages challenging. Usually you use GPU-specific programming languages like GLSL or HLSL.
As for why it's great to run code on the GPU: SIMD parallelism is very efficient for tasks where it works well. An Intel Core i5 12400 can perform 47 billion floating point operations per second (and I think that already includes the little bit of SIMD that even CPUs have nowadays). It also comes with a basic integrated GPU so that it can be used without an actual graphics card. It's not enough for high end gaming but it's ok for most everyday tasks. That Intel UHD Graphics 730 on the same chip can perform 350 billion floating point operations per second.
@@bastianurbach if youtube was anything like reddit you'd have multiple awards right now 🏆
@@bastianurbach how tf u know all of this
I've changed to Julia from Python early in my scientific career (differential equations, numerical modelling) and it has been the best decision in my life!
Go on. Tell me more
I am thinking to change over fully next year.
We love to hear and see it!
Shh! The python cultists might hear you!
Using Python due to its vast library. How is availability of libraries in Julia?
I've been using Julia in a few of my micro applications and the ecosystem/dev environment is not only very friendly and accommodating, but it is beautiful to write. It's a Love triangle of Ruby and C++ with python at the bottom.
so it's a polyamory of programming languages
Python at the bottom or python …. in the middle…. ? hehehe
Truly agree.
Or Python in the bottom?😁😈
i would say c instead of c++
Been asking for Julia in 100 seconds for nearly a year, and finally, here we are.
Thank you 😁
I actually remember such a comment
he said he made it for you on twitter
You spent a whole year taking 100 seconds to ask a question?
Thank you for asking and being patient, we are as excited as you are!
@@TheJuliaLanguage Real Julia Programming😳😮🤯
I Like how at 1:02 you typed .js then corrected yourself showing the love you have for JavaScript or maybe it's because you've covered soo many js frameworks that your muscle memory can't help itself but type .js whenever there's need of an extension
@Bruno Nahorny yeah, definitely done on purpose
He was thinking on many Julias, that lil perv…
I do make that mistake often too 🤣
I came looking for a comment like this 😅
I was looking for this comment xd
I love Julia! I hope it gets picked up for elective courses in compsci in universities, and built into graphic calculators. It makes math such a breeze! For one, it handles rational values with the // operator, so you can for example multiply 3//4 * 1//2 (to give you 3//8). It handles vectors and matrices and has SO many built-in math functions. Great language!
It seems amazing
Well say no more, in my uni they are teaching algo, linear equations, optimization by implementing it in Julia.
And I must say, what a powerful language, blows my mind when compared to python.
@@masterbaitt That sounds like a great class.
Python handles its rational Fraction type with the regular “/” operator. E.g.
from fractions import \
Fraction as F
print(F(3) / 4 * 1 / 2)
prints out
3/8
I’m actually planning on porting Emac’s Calc program as a capstone for my Julia foray. Whats nice about Julia is that as it stands, it nearly IS the graphic calculator.
Julia is by far the most under appreciated language, love it
I definitely don't appreciate the 1-based indexing lol
You are telling us : )
U r forgetting about groovy but yes, Julia deserves more attention
Lua: Am I a joke to you?
It's because it's a buggy mess.
People try it out because it promises the world, then they see it doesn't live up, vote with their feet and move on. What you end up seeing is the language making huge promises but not having any widespread adoption and think people just aren't paying attention. They are, but they need a language that can actually be used in production and julia's not it.
Julia is an amazing language. Fast yet concise code, but the true power lies in composability in my opinion. The way you can mix together custom types from many different libraries and make them smoothly work together is almost like magic. The package manager is also
Agree. I always point people to this talk: ruclips.net/video/kc9HwsxE1OY/видео.html
I also wish it was available on mobile
Julia as an ecosystem is maturing rapidly, there's exponentially more stability than a few years ago and things will continue to get better!
@@TheJuliaLanguage absolutely I agree that things are improving fast. It’s great that new features and libraries are being developed, but I feel like it would also be a good idea to coordinate the efforts with the newcomers’ experience in mind. Not blaming anyone, these things take time!
When I tried it for the first and last time to render large panoramas as seen from certain summit from height maps, I had trouble to realize how to break code into smaller files. Is it my problem or is it some unfinished part of the language? I mean files with 100s lines of code, not necessarily libraries.
By far my favorite programming language. It's such a joy to write in that it almost makes you want to code
I think the best part of Julia is the differential equations library and it's amazing integration with Machine learning libraries. Scientific machine learning techniques like PINNs and neural ODEs are so much better in Julia than in pytorch or tensorflow.
but how they are better?
prob = ODEProblem(diff_eq!, x0, tspan, params)
s = solve(prob)
plot(s.t, s.u)
things nobody uses except mathematicians
@@anon9322 engineers of many disciplines live and breath differential equations. the fact that julia is both faster and easier to write than matlab, and also open source (free), makes it a huge game changer for the industry
@@anon9322 things nobody should say if they don't know what they're talking about
I've started a course on statistics and machine learning (regression stuff), in there they use scikit learn (python) and R.
While i kinda-like python (coming from c-style languages missing curly-braces and all the other stuff is very very strange =D ), R felt outdated and overly complicated, because its syntax feels very very inconsistent, so i searched for a more modern alternative and stumbled upon Julia.
It feels so much modern, consistend, well-thought through, it was like an epiphany, while i was fighting with R on many occasions, the Julia syntax just felt right, it was like "if i would be creating a language for maths and stuff, it would be exactly like this" =)
I use Julia for anything requiring heavy numeric and symbolic calculations, but still use R when I need to create and mutate a 2d array (dataframe). Don’t use base R though religiously stick to Tidyverse syntax (specifically dylplr).
I haven't worked with Julia. But have read some articles about it and found the language is perfect for what it was made for like machine learning, data visualization, and mathematics.
I'm still trying to figure out why some languages like this are "perfect" for some advanced things, but are somehow not for things I would consider easy, like web development.
@@leonf.7893 Because it's not designed for the backend or frontend. Just for fast computation.
Yes, these are the common use cases!
Likely. Depends on what you mean by data visualization, for text analysis, working with tables and plotting graphs, I'd choose Python.
For working with large 2D to 4D data and computing them on fly, Python is painfully slow. Still viable if you can prototype it at small resolution and run overnight.
But if you are doing some data processing and Python does not have fast library written in C++ for that purpose, maybe Julia is worth trying (C++ might be an option as well)
@@leonf.7893 Honestly, the only differentiators are the core library and the frameworks. You can do any task in any language with equal effectiveness as long as you sufficiently optimize the compiler or the runtime. The thing is that languages are built by communities, so they will prioritize core features and optimizations for specific tasks which in the long term makes them excel at that specific task while everything else is sidelined. Almost every language exists because at some point someone thought "I want feature x in language y with optimizations for z" so they create a chimera that's focused on their specific problem, then people that have a similar problem congregate.
Really love the speed/optimizations this language has. Had this particular code in MATLAB that took an average of 6 seconds to run, porting it to Julia reduced it down to 0.3 seconds, scale that up to the hundreds of times I usually run that code and the time saving explodes.
Impressive. Any chance you'd try porting the same code to python with the numba JIT compiler library? I'd love to see how they compare.
Some sources put numba's JIT compiler at 1000 times faster than native python execution of equivalent code in math heavy applications of course
@@lucky-segfault it's "up to" 1000 times faster. 1000x is not the norm.
@@lucky-segfault I don't work in the lab that had those codes anymore. But, I do know who maintains that code now, I'll let them know about your idea and maybe they'll implement it. If they do I'll let you know how it goes.
It might work well since our code is for cell simulations and generally just involves thousands upon thousands of coupled diff eqs being solved.
FYI matlab is jit compiled as well, but with quite a different phylosophy wrt to julia, most probably the 20x speedup comes from memory management / allocations. I would bet numba achieves far less than 1000x wrt to matlab here (note that in general matlab is way faster then pure python).
You forgot one important aspect of Julia: index starts at 1, not 0.
now I’ve decided that I’m not going to learn it after all.
You can actually change this
@@Croesquared you can? Does that not make it “incompatible with itself”?
@@chri-k nope, just define an AbstractArray with FirstIndex=0. Julia is intelligent enough to handle it
@@Croesquared in that case, I misunderstood you, significantly.
I started learning Julia a few weeks ago, and all I can say is that it is by far my favorite programming language. I will give my opinions on it, but I'm not extremely familiar with computer science, so forgive my vocabulary and lack of other languages for comparison. I will say what I like as I think of it.
I love the range operator (:), it makes it very easy to iterate through values, and can also be reversed and modified to include a jump (sorry for the lack of better words). It also works with strings, as it does in python. However, it has a few differences from pythons. First of all, the range operator can actually be used in a for loop. For example, for i=1:10 ... end instead of for i in range(1,10). Another difference is the use of the end operator. In python, strings can be accessed from the last index using something like [-3:]. But in Julia, end must be used, for example as [end-3:end], which is better for visual purposes and avoiding confusion.
Speaking of end, Julia avoids any confusing by closing if statements, functions, for/while loops, do statements, let statements, structs, and more using the end keyword, which avoids confusion and removes the picky indentation system that python features. semicolons are also available for use, but are optional
Functions can also be declared like f(x) = x + 2, which is very cool in my opinion. I'm not aware of any specific language that does this other than Julia, but there are likely some.
Another thing I love in Julia is the unicode implementation. In VSCode, I can input unicode characters that actually are interpreted as certain things. for example, for i in 1:10 is the same as for i ∈ 1:10. There are so many more examples of this, which I find very fun to use.
I mentioned earlier do statements, which make iteration and other things very easy. Things like map( num -> num+2, 1:10 ) can be replaced with map(1:10) do num num+2 end, which is very syntactically nice.
These are just a few of the things I enjoy, among so many more. If you like simple but powerful languages, check out Julia. I did, and I don't regret it. Programming in Julia is extremely enjoyable. It has its own package manager, great documentation, many amazing packages, so many functions and tools, and much more. Enjoy!
Just wanted to let you know, functions that can be declared like
f(x) = x + 2
is a feature of a programming paradigm called "functional programming". Pretty much all "functional programming languages" (programming languages that mainly follow the functional programming paradigm, such as Haskell) have that feature. You can also do that in Python using lambda as follows:
f = lambda x: x + 2
most languages have some kind of keyword or syntax for ending blocks, python is very much the odd one out for using semantic indentation.
Wow this is my favourite in 100 seconds video. Really exciting language, that I even though had heard of it, never took time to read into it and now I feel like I’m missing out. Julia seems really really amazing and different. I’m hoping there is a wider use than stats, data viz and such. Thanks Jeff
Exactly how I feel . How dvqoes Julia have so many neat features but remain so low key . Feels like I’m missing out
Yeah it seems amazing 😄
@@UltravioletMind python just has so much developed for it and such wide spread use it's hard to overcome. Maybe in the long run julia will take over for the scientific/math/data/ML type applications (much like python itself has had slow but steady growth for years and years) but it's not likely to happen over night.
That said, I do feel like I see it mentioned more than I did 3 or 4 years ago
The use cases are expanding. Like, there has been work on using it for server side stuff, front end web design, and even some game dev stuff, but the libraries for that arent super developed. atm it is mostly large computing and stats and science stuff
I think the language will properly explode with Julia 2.0. I think that's when they want to have full support for ahead of time compilation. So executables can be small and portable.
Currently, you can statically compile your code, but the executables are huge because they include everything exported by dependancies or imported by your code.
I usually frown a bit when discovering new languages because of the complexity of reading the unknown tokens and syntax in general. Didn't happen with this one. Seems very straightforward and flexible. Deserves an upvote... Or like...
Some optimization classes at my university used Julia and I really liked the language. Unfortunately have never had the chance to use it on the job.
Honestly, I love the fact that not every function must be attached to an object. I feel like our worship of OOP has lead us down a road that didn't really pay off.
This whole "but OOP makes your code so reusable" promise was never really kept. I want a banana, and end up importing the whole jungle instead.
I like that Julia does away with that.
This implies that Julia is somehow unique in this regard whereas most functional, imperative, and multiparadigm languages all support first-class functions to some extent. I feel like the OOP=best debate is already outdated and nobody actually thinks this.
@@thecreature7808 Julia isn't unique, I just like it. And where I'm from, the "OOP is King" mentality still exists unfortunately
Rust, C++, JS, TS, go, and a few others let you do this too. OOP is overrated but it's still useful in some applications. The issue is more about understanding how a piece of code will be used and what paradigm is best for that a given use case
Fuck OOP.
@@MechMK1 so, Java and C#... ? I can't think of many others that still force you to do that
By far the best language for academic and scientific purposes. My brother uses it all the time and loves it. It also got me to shut up about how slow his python code used to run, because Julia performed just as well as the random C replacement I would show him could do the job better (obviously it was minutes to sheer seconds faster then the python variant).
why not just use a jit compiler for python.
@@nathanjokeley4102 run time. When you do matrix multiplication on large complex numbers on huge scales and for huge dimensions with sparse matrices the difference is absolutely insane. The python variants simply can't keep pace. I originally showed my brother who was doing his PhD on quantum circuits and trying to find optimized algorithems that his then mathematix was running to slow, by doing a simple sample in C++, he ended up rewriting it into python, but that had a 100x uplift compared to his old approach with the right libraries but i then showed him how much faster still it was in my C++, so he talked to some experts at a conference and they all praised Julia for this kind of workload. Sure enough it outperformed my first pass C++ equivalent and when I looked up official run time figures julia was tied with C++, C implimentations for this kind of work scenario. Julia is a rock solid language for calculation, simulation, and other programming purposes.
Try Nim out. Compare it with Julia.
@@lutzleipold5206 "Julia is a rock solid language"
Julia is incredibly buggy. You can use many positive adjectives to describe it but "rock solid" is definitely not one of them.
@@isodoubIetit isnt
I was so hoping this video would come. Julia is a blessing for any scientific work
Thankyou! Do some more about Julia. perhaps compare solution with R, Rust and Python.
and v programing langue, nim lang, dascript lang
I was really hoping you’d cover Julia. I really like it and hope that more people end up using it.
We hope so too!
0:07
- A slim and tall guy
- Indian or arab guy
- A blonde/redhead guy who came from northern/eastern europe
- A guy with a big belly and whose eyes seems to saw the sunlight only a few times in his life
This could be any IT team in any IT firm.
They actually, at least the big belly man on the right is MIT professors.
Really cool language, everyone says they had to use it for comp sci but I had to use it for linear algebra in my uni class. Pretty useful!!
Woah! I remember suggesting Julia in one of your community posts but I never thought you'd do it.
Thank you for this! It puts into perspective just how much is crammed into Julia and all the features it has. You didn't even mention the metaprogramming aspect, one-based indexing, column-major order, REPL workflow, etc., but for a short video like this it sure is jam-packed.
The REPL workflow is such a great feature!
Been using Julia for about 6 months now, it is absolutely awesome, give it a try.
Great to hear!
A friend of mine told me about julia almost 10 years ago, it was at the very beginning, and he said it was really good and his favotire language. I have never learned past the ultra basics, and the name never left my mind.
I love the multiple dispatch, the type annotation lets the JIT complier optimize the code to specific machine code for each type, making it super fast (C# its other language that has an amazing JIT), but you a have a first call performance cost, I guess that its some kind of issue unless they also implent some AOT compilation also, other than that this language is really really interesting and for sure will become a top choice in the future
Using Julia at work now to do some cool things. First time I see one of your videos on something I already knew, made me appreciate your channel even more. Keep up the great work!
Don’t know if this has been suggested before, but I think a PHP for the haters video would be great to watch! It would be entertaining to see how you go about roasting that language.
He's already made one if I'm not mistaken
He made Java for the haters, based in my interactions with various communities I thought Ruby would take the crown of most hated language but Jeff introduced a different perspective.
@@daleryanaldover6545 why do people hate Ruby? I never heard of that but maybe we just know very different people
But it a perfect language, and it has no flaws. /s
PHP has already roasted itself too much in the past. Let it rest hahah
LOL - love that you named it .js then corrected it, the subtle humor on this channel is amazing
Didn’t know this language existed until now, looks amazing! Suggestion, would be 100 seconds of Haxe, would be pretty cool.
I've literally just finished julia assignment for my uni course and this vid came out. Mental
"and run natively on the gpu" what an ending i love it
Because of your 100 seconds series, I don't have to keep trying all the languages out there by myself and struggle through the docs. Thank you!
Please consider a video on Fortran. Modern Fortran is similar to Julia in some ways, emphasizing performance and used in scientific computing, with good support for multi-dimensional arrays.
We got our Fortran video!
And yeah, Modern Fortran is a great language, I'm currently refactoring some hideous codes to modern standards and the difference is enormous
Nice, you have reminded me that I should resume my learning of Julia lang.
I used Julia in my numerical analysis class in undergrad. Amazing for quick matrix manipulation for PCA and image processing
Great, I'm using it in a game engine
I taught a class this week on PCA. Blew all the students' minds when I showed them you can do it in just a few lines of base Julia, and have it run faster than ScikitLearn.
Keep up the amazing content, Fireship!
We had to use Julia in Applied Mathematics at UNI last year when the only docs were the ones from Julia itself. No yt vids, no stackoverflow, no nothing. It was hell.
What were the difficulties?
It's been a long time coming. Waited for this for so long
I've known about Julia for a few years and find it super intriguing, but I'm just a hobbyist and don't have the use case for learning Julia yet. Same with Rust. Anyone out there using Julia (or Rust) as a hobbyist? If so, what for?
usually i use Julia for data visualisation and image rendering, since the language is so fast
Love the show of love for Julia with a 100 seconds vid. Deserves it! You da best!
If I'm not mistaken, Julia isn't JIT. The compiler isn't active during runtime. I've seen people in the Julia community calling it "Just Ahead of Time", instead of "Just in Time".
1:45 one of the reasons julia is so fast is that the dispatch is done mainly at compile time, escaping to dynamic (run-time) dispatch only when necessary, i.e., when it's not possible to infer type at compile-time
Wow, this is really interesting. I kinda looked past Julia when I first saw its announcement, but now I'm interested as heck.
Could you make a similar video about Nim or D?
I learned about Julia in 2012. Back then they had this claim that it was super fast and generic. I even saw their benchmark, but I never believed it. Wasn't until 2020 that I gave it a go. It's my main language now.
I write a comment requesting this video on a previous one. Thank you so much Fireship! 🔥🔥🔥
I'd love to watch "Making a 100 second video in 100 seconds"
ruclips.net/video/N6-Q2dgodLs/видео.html
Julia is the most under appreciated language in existence.
You save a lot of time with these 100s videos, if I want to learn some concept first I review if you made a video. Thanks a lot!! Could you please, make a video about UML and some other methods display process.
Really been waiting for this one!
Fun fact: Did you know Julia ships a patched version of LLVM to fix correctness bugs in numerical methods?
While at the same time the Julia ecosystem and libraries have reported a big number of correctness bugs...
How many people if Jeff consist of?
I do not shit as often as he creates content, yet a new video is never just a new video, it is a whole iteration. I always catch small improvements here and there.
Mad respect.
Can you do Zig next? It’s the best in the programming language drag race, but because it’s only 5 ish years old, there’s not a lot of info on RUclips about it
I love that you typed .js just to replace it by .jl 1:01
In my academic work julia has completely replaced python for me. Fast for loops are a game changer!
Love to hear it, would be interested to hear more about how you are using it!
@@TheJuliaLanguage
Mainly data analysis, simulations (differential equation library is very useful), and graphing.
the dot vector syntax like x.*2 and function piping like x |> sqrt |> sum is also very nice feature of Julia
I've googled but can't find anything, what's the dot vector syntax? Does x. mean x is a vector and, if so, why do we need it instead of just doing x = [3; 5; 7; ...]?
@@mrocto329 the dot in X.*2 is a shortcut for broadcasting. If you search for broadcasting in Julia you will learn a lot more about it.
Basically it stands for: multiply every element in the vector by 2
@@mrocto329 the dot syntax means to peform an operation for every element of an array instead the array itself, array.map in other languages. For example, in javascript, if you want to create an array where every element is the element of an old array + 5, you would do something like:
let newArray = oldArray.map(x => x + 5)
The equivalent julia code is:
newArray = map(x -> x + 5, oldArray)
But you can use dot syntax to "broadcast" the operation for every element of the oldArray, like this:
newArray = oldArray .+ 5
This is a much more cleaner syntax.
@@pimlinden98 ooh that's cool, but cv is already multiplying each term in the vector in maths, so it just seems like extra notation tbh.
That is not a dot multiplication, that is a scalar multiplication.
Dot multiplication is important when multiplying two vectors or matrices, as it is a different operation from element wise multiplication.
I've heard of Julia but never had a reason to look into it, now I do. Cool video!
I don't get why multiple-dispatch is necessary to determine which function to call in the case when the switch is based on a static type, such as string or int. The compiler knows at build time which version ought to be called and could mind to that specific version directly, not that different from overloading. Perhaps the example of multiple dispatch here is wrong. Maybe an example where the runtime type is used for dispatching, or possibly another value, such as greater than zero, or equal to zero. I don't know. Never used the language, but if it's statically typed, that design wouldn't make sense.
You can do that by knowing in advance your function may encounter only say string or int64 in the future. But in julia, you can use somebody else's function in your code, invent some new type you need for yourself, write what this function does when it encounters your new type and use it with the whole julia ecosystem without ever modifying the initial code. To learn more, I suggest this nice talk by one of the language creators: ruclips.net/video/kc9HwsxE1OY/видео.html
it’s pretty common to run into situations in C++ or similar where you’ve got a dozen similar functions for a variable that could be 4 or 5 different types. C++ has templates and overloading, but it doesn’t have any runtime type checking whatsoever leading to a web of if statements and super repetitive code. i think it’s a pretty welcome feature that the language will step in and help me dispatch the appropriate function if i want
The major advantace of multiple dispatch is that you can dispatch functions of libraries you are importing, chainging the internal behaviour of a library without touching the original code. This is what makes it so powerful: you can implement your objects, define basic operations on them, and call any julia library passing them as a argunent and it works! There are amazing interactions between packages in julia thanks to this feature.
Fireship and code_report are some of my favourite programming language channels.
In practice, the JIT compile time in Julia is often slower than the entire run time of equivalent Python code. Julia works best as a REPL where it can cache the JIT compiled functions for re-use. Otherwise, don't expect to be impressed by Julia's script performance
That is true only if your script takes few seconds to run and you have to run it only once, that is a case in which you do not need performances so yeah, no big reasons to use julia. But in all other cases, the difference is astonishing
This is the first time I see a julia code, and i seems like a very good language! I will learn more about it.
What's the difference between dispatching and function overloading?
I looked it up. I can't link the software engineering stack overflow post here w/o being reported as spam, so I'll summarize: dispatching is for dynamic types (types that can change at runtime). Overloading is only for static types (so like Java). this seems like a weird difference to have a whole new confusing term for.
@@jvillemare Ah. Thank you. At least there is a difference. And now we know it's safe to think of them as essentially the same.
It's not the same, in Java for example yes you can have multiple functions with the same name but different argument types (overloading), but when you invoke such function you explicitly need to say which one you want to use, you can't simple pass generic types, the code will not compile.
With multiple dispatch, like in Julia, you don't need to specify, you just pass an object and in runtime the correct function is selected (this is multiple dispatch, which Java doesn't support) .
Ever since switching to julia, adding functions starts with the fun
NGL, Julia looks very promising. Give it large enough ecosystem of projects, and it will replace Python, and become a new golden standard in ML and Data Science
Python is used for way more than that. Python cannot be replaced at this point.
@@InfinityOver0 I know, I meant that Python could be possibly replaced in ML/AI
@@InfinityOver0 At least for me, the only other application for Python is as a cross platform alternative to bash scripting.
julia absofukinlutely will replace python for ml if enough people start using it
Finally a new video on a programming language and not on some JavaScript application
You should do an "R in 100 Seconds" video! As a more specialized statistical computing language, it would be really interesting to see how its defining features compare to those of Julia.
1:45 wow, this is like overloads in TypeScript but even more awesome
1:03
I see what you did there
Because of the multiple dispatch, Julia has built-in support for solving the Expression Problem. Which is really neat!
0:08 I guess one of them had a crush on a girl named Julia
Most probably
This was really good. I hope you do a video on R one day.
I don't even know a single language fully and now I want to learn Julia, thank you fireship for making me want to learn 3 languages at once and ruining my life by that
As long as you understand the basic computer science concepts you can learn many languages at once. Especially if you get the hang of C!
@@akshaybodla163 Alrigthy then, this gives me some hope!
@@abdullahmertozdemir9437 If you don't have any particular projects in your head, I would suggest to learn C# for Windows Applications OR Kotlin for Android Applications OR Swift for anything Apple related OR JavaScript for Web.
Those languages are easy to pick up and write in.
After that you could learn whatever you want ;-)
@@igorthelight Currently I have C++, JavaScript and Julia in my bucketlist (gotta add Flutter there when I am done with them all for quick mobile apps) but I think I am at that phase where you get into something new and go "and I will do this and that" then realize it is just not that easy. For now I want to learn SFML and OpenGL for C++ and then will jump to javascript course on scrimba. Only then, I believe, I can start talking about learning any other thing
@@igorthelight But I think I have a strong foundation though, I got done with data structures etc. and basics of C++ so I believe learning another language won't be as hard after that
im starting to learn julia today, but I watch ur video first before even reading any documentation.
Found Julia while looking for an alternative to MATLAB, beyond its speed its a highly composable language.
Man, Julia getting some much-needed exposure lately.
please do one for Haxe, its a really nice programming language
Wow I suggested this in another video and you actually did it! Thank you, good stuff as always!
Native GPU support? Oooh, now that is fancy!
Yay! Thank you for covering Julia. :)
“Julia's arrays are indexed starting at 1”
🤯
Thats the humans count.Its there for ease, especially if you are more of a science guy than a professional programmer. Python has been my first language, i am using in my phd.Have been exposed to Julia recently and i absolutely love the syntax.I am slowly starting to pick and maybe someday do most of my work in it!!
@@ayushkumarsingh8020 "Thats the humans count"
Sure, but it's objectively the wrong choice for programming and for me pretty much a deal breaker when picking a language.
This programing language has so much potential 🤯
looks amazing. wish I had a reason to use it lol
LOL. Same. It looks interesting. But I can't think of a possible scenario of why should I learn it.
I am love with your starts! „Julia, a dynamic general purpose language…“ this gives me goosebumps every time.
wow another one, and honest I didn't know it. As a self-taught developer using Js and React, I'm now learning Python and this video is super helpful. Thanks Jeff ✌🏻
Nice video! Wanted to see Crystal in 100 seconds next
I can't believe you missed the opportunity of putting Charizard for char type .-.
This lang seems legit , I wonder why I havn't heard of it till now wow we can do many cool things with ite
The Ju in Jupyter stands for Julia.
This is not up to date at 1:00. After version 1.0, they started sending cd installers by mail instead of floppy discs.
Compilation: AoT makes sense for releases, while JiT makes sense for real time development and sciencey things.
Interpreted makes sense for shells/hacking. Languages should be more ambitious in covering all the bases.
Julia can compile to an executable too
Wdym with releases
Besides lots of langs used in science are interpreted or compiled like python and fortran
@@02orochi deployment
Wow, that's some next level stuff, truly futuristic.
I think of multiple dispatch as taking the methods out of the class and putting it into the function, keeping the data in structs and the behavior in functions.
instead of:
class(type) function
-fields (data)
-methods(behavior)
we have:
struct(type) function
-fields(data) -methods(behavior)
I prefer Python over any other language, but that last part 2:28 really got my attention.
Can you do R in 100 seconds?
Already done ✅
I lied. I saw this video 8 months ago and said the same thing: ruclips.net/video/PeMlggyqz0Y/видео.html
0:59 wrong!! `pi` is not a `Float64`, but actually `Irrational{:π}`. i think there's some intermediate method that uses a precomputed Float64 pi though
I actually really like this language for some things, better than python in a lot of ways
Nice, some love for Julia :D
Never seen a programming language with so many attributes before