 So for 2022, you want to use Julia. You want to learn how to code in Julia. You've got a bunch of projects. Maybe you're doing them in Python, some other language, and you want to try out Julia. I'm going to show you how to download and install Julia. Well, not really the install. That's just double-clicking on your file that you downloaded and just following all the defaults, no problem. But how to set up Julia then so that you can use it from the command prompt or the terminal here in the macOS. I'm going to show you macOS. And that's quite important to be able to start Julia just from your terminal window. Then how to set up different environments, because when you install Julia, you're going to have a base installation. But I want you to set up different environments for your different projects. If you have a different environment, a separate environment, that means you can install packages specific to that project in that environment. And you don't have this overcrowding of packages in your base installation and all sorts of problems with dependencies when someone updates their package and you run into or potentially run into problems. So separate environments for your separate projects. Then I'm going to show you how to install a Julia kernel so that you can run Julia inside of a Jupyter notebook. And then I'll also show you Pluto notebooks. Now Pluto notebooks really famous at the moment for the use at MIT's data science courses. And in many other projects, I'll show you how to set up Pluto notebooks as well. And then lastly, I'm going to show you how to set up Visual Studio Code. One of the extensions in the marketplace for Visual Studio Code is of course Julia. So here we are on the Julia language homepage. That's julialang.org. And you can see very bold there. There's the download button. By the way, there's also excellent documentation. There's a blog, a community, and some links to places that you can learn about Julia. So we're going to go for downloads and hit that big download button. And what you'll see on this download Julia page is usually two versions of Julia. The first one is the current stable release at the time of recording. This was done way back in 30th of November, 2021. And so that's the current stable release. And you can always install that one. It is stable. If you work at some institution or company, though, that requires some form of longer term support versions, then you can go for the LTS release, as you can see there in the bottom. You can also see there's installers for Windows, Mac OS, both Intel and the M series processors. And then all sorts of installations for Linux, although I would suggest that use a Linux distribution that has Julia built into its packages as well. Yeah, I'm on the Mac OS on an Intel based, the Core i9 16 inch MacBook Pro. So I'm going to choose that one 64, but I'm going to download that file. And then I'm just going to double click on it and install it. I'm going to follow all the prompts, not change anything. There's much to change and Julia will be installed. And if you do this with Windows, most of the time go for the 64 but install unless you have a real system. Go for the 64 but install it, download it, double click on install it, accept all the defaults. And that is really all you need to do. Yeah, I am in my applications folder in my finder. And there we see Julia 1.7. I'm going to double click on that. It was successfully installed. And it just starts Julia in the repel read, evaluate print loop. And if I type 2 plus 2, for instance, there at the Julia prompt, hit return, I'm going to see the result of my code there, which is 4, no problem whatsoever. You can see there, if we hit the right square bracket key, so let's hit right square bracket, that brings us into the package manager. Now the package manager is fantastic. This is where we're going to add all our packages. But we can see there we are at v1.7, version 1.7. This is my base Julia installation. And as I mentioned, I don't like to put packages here. At most, I'll have one or two packages. The one on this system is Pluto. And I put that in my base installation, because, you know, I want to use Pluto notebooks in a certain way. But for now, we're not going to install anything there. I'm going to hit the backspace key. So I'm outside of my package manager. And I'm just going to do exit, exit function, open close parentheses, because it is a function. And we are outside of Julia. And we can just quit the terminal. So there we go, we see Julia 1.7 there. So what I want to do, though, is to set up Julia so that it runs from the terminal, so that I don't have to come into my finder here, double click. So if you're on Windows, you're going to get start, and then you're going to go to Julia and just open it there. That's not how we want to use it. We want to open a command prompt, or we want to open a terminal here in Mac OS. And I just want to type Julia, and I want Julia to start. So here on a Mac, I've got to add it to my path. And in Windows, you've got to add it to environment variables. So there you're going to just click on open, open your search or start button, search for environment variables, and you'll see two sets. And just install it for your system. You can see a new button there. And what you have to do when you do that new button is just to copy and paste the path to the actual executable Julia file on your Windows system. Let me show you how that's done on the Mac. So I've opened my terminal here on a Mac. And what we want to do is to export this file here. Let's go back to our finder. If I right click on Julia 1-1.7, I'm going to say show package contents, contents, resources, Julia, and there's the binary for the BIN. So right there at the bottom, we can see that whole path there. If I right click on bin, right at the bottom there, I can say copy bin as path name. And that's going to copy this address to this executable onto my clipboard. What I want to do in my terminal is start a little program called nano. And that's a text editor. And what I want to do is to edit this Z or ZSH, as you can see at the top, that's the shell that's running inside of this terminal. I've got to add this Julia executable or the path to the Julia executable to this shell. So what are we going to do? I'm going to type sudo super user do nano. That's my text editor. And the file that I want, I'm going to do a squiggly line, a tilde key, fold slash dot. I'm in my home directory. And it's ZSH or ZSHRC. And there we go. It's going to ask me for my password. There we go. And we can see this text editor, nano text editor has opened this. Now, the top part you'll see there, that's all about Miniconda. That's my installation for Python. But I've added this file here at the bottom. This line of code, I should say. So I've put a little comment there, hashtag Julia, that's going to be ignored. So this is what you want to add though, export space, space path equals. And then inside of a set of quotation marks, I'm going to paste that path to the binary folder. So my instance, it was slash. This is a Mac. So it's ford slashers applications Julia dash 1.7 dot app content resources Julia bin colon dollar path. So that's what you want to add. And just make sure that that really is that path to where your Julia executable is the bottom day, you can see hold down control and hit oh, and say yes, to overwrite your file. I've already done mine. So I'm just going to do control X to exit. And that's it. Julia is now available from the command prompt, no matter where I am. So if I type Julia now, Julia is going to start right square bracket. We can see I'm in my base installation. It said exit to get out of Julia. And that's as simple as that. It's a couple of night of code. You've got to edit that file. Otherwise, you'll have to go in your find and start Julia that way. And that's not how we want to set it up specifically. If we want to set up environments that we can use for our different projects. So now that we can run Julia from the command prompt or the terminal window, we want to set up these environments. Now on my system, I've got a folder in my documents folder called Julia. And what I want to do inside of my terminal now, you can do it inside of command prompt as well. Remember that you'll just have to use back slashers instead of forward slashers. But I want to change directory. And for that, in a terminal, there's a keyword called CD change directory. So I want to go to documents Julia. Now I've already set that up. So that folder exists on my system. I'm going to hit return. And I can see I've gone from my home folder. That's a little tilde there. I'm now in the Julia folder, which is inside of my documents folder. So now that I'm in that sub folder, I'm going to type the following Julia. I don't want to just start Julia. I'm going to do a flag dash e. And then inside of single quotation marks, I'm going to write some Julia code. I'm going to say using PKG semi colon. Now that's a line of Julia code. And using means I'm importing a package. The package is called PKG that is the package manager, which means I can now use one of the functions inside of there. And that's the generate function. And I'm going to use a pair of parentheses and double quotation marks. And I'm going to say you tube demo. That's going to be the name of my environment. And the flag is going to run that code that Julia star Julia run the code and then exit out of Julia. So let's run that. And it was almost instantaneous. It says generating project YouTube demo. And now in this Julia folder that's in my documents folder, I now have a YouTube demo folder. And inside of there, there's a project.tml file. That project.tml file holds a list of all the packages that we install in this environment. And there's also a sub folder called SRC. And then inside that sub folder, there is already a Julia file YouTube, YouTube demo.jl. So if we want to do package development, which is not what we're going to do here, everything's already set up for you. You've already got that file as a name for your package. So what we're going to do is we're just going to change directory into this YouTube demo file folder that we've just created. So there we can see I just cd into that CD space, YouTube demo. And we can see I'm in the YouTube demo folder. Remember that's inside of the Julia folder, which is inside of the documents folder, which is inside of my, my home folder. If I now type LS on a unit space system such such as a Mac, it's going to show me all the files and folders and windows you'll have to type dir for directory. And then it is the project.toml file and also the SRC folder. Now that we've done that, we can start Julia with this environment. And the way that we're going to do that is to use flags again. So I'm going to say Julia dash dash project equals dot. Now the other ways to go about this, but for me, this is the preferred way. So I've got to be in this folder that contains the project.toml file. That's very, very important. So let's run this. And now we've started Julia again, but I want to do this, the right square bracket. And you can see I'm not in at v1.7. I'm not in my base installation. I'm now in my YouTube demo environment. I can type in ST and that's short for status. You can also write status and you'll see it's an empty project. In my package manager here, which I got into by the right square bracket key, it's empty. So let's add something. I'm going to add iJulia. So just add inside the package manager. And then i and j is uppercase iJulia. And that is the package for Jupyter notebooks. So let's hit enter return. And that's going to install iJulia for me. And there we go. It says one dependency successfully pre-compiled in one second, 15 already pre-compiled. Let me hit the backspace key. And I'm outside of my package manager now. By the way, let's go back in and hit ST now. And if I do that, I see iJulia is right there. So we have our environment and we've got our first package installed in that environment. And with that package, we're going to run Jupyter notebook. So we're going to open a Jupyter notebook and it's going to run a Julia kernel for us. Now in order to do that, remember we're still in this activated environment of ours. I'm going to say using PKG. So I'm now using, that means I'm importing that package. Now when you install Julia, some packages are already there. They're part of the base installation. And one of them is PKG. And by the way, this is the same as the right arrow bracket package manager that you can use. But I'm using again using PKG because what I want to say is PKG dot build. And then I want to, let's build, I want to build iJulia. So it's instead of set of quotation marks, instead of a set of parentheses, so PKG dot build, it's a build, it's a function inside of the PKG package. And you can see their condo iJulia. So that's going to install what I need to be able to run Jupyter notebooks. And when I open a Jupyter notebook, Julia is going to be available as a kernel. So let's use iJulia. By the way, everything's already been done on my system. And I've exited and come back, all of those nice things. I'm going to say using iJulia. And that J should also be a capital using iJulia. And one of the functions in iJulia is the notebook function. So open it, notebook, open and close parentheses. And there we go. It's now going to open my default browser. And there we go. It's now going to open my default browser. And we can see there's the project.to.ml file because we've added one package, the iJulia package. There's now also going to be a manifest.to.ml file, whereas the project files are just going to contain a list of all the packages that I've installed. The manifest is going to have some more information about dependencies and versions, etc. And there's the src folder. Let's just go inside of that folder. There's that youtube demo.jl file. But that's not what we want to do. We want to start a new notebook. So I'm going to say new. And there we go. Julia 1.7.0. So previously I had 1.6.3 installed on the system. It's no longer available. I'm just going to hit 1.7.0. Open the new tab. And the kernel I started, I've now got a Julia kernel. So we can do 2 plus 2 in the cell, hold down shift, hit return. And there we go. I have my input and I have my output. I have a Julia kernel running inside of Jupyter Notebook. And I can use a Jupyter Notebook to type my Julia code. So now that we can run a Julia kernel inside of a Jupyter Notebook, I want to show you Pluto Notebooks. Now Pluto Notebooks are fantastic. They run an active session. So if you change the value of a variable, it changes in all the cells. It's not this idea of sequential execution. And it is very good in another way as well. It has an inbuilt package manager. So you don't have to be in an active environment or activate an environment. You can just add your packages right as code inside of the notebook and it's going to create an environment inside of that notebook and do those installations for you. You can also overwrite it, though, if you want to make use of one of the environments that you've already created. So here we are, my YouTube demo folder that's inside of my Julia folder, which is inside of my document folder. And remember if I type LS or DIR on Windows, there's my manifest file, my project file, and that SRC folder. So what do I want to do here? I want to type Julia. And if I just type Julia here, remember right square bracket, I'm in my base installation. And this is where I want to add Pluto. So that would be one of the very few packages that goes inside of my base installation. Because I want to start Pluto without worrying about an environment. Sometimes I just want to use the inbuilt package manager. So Pluto for me would be one of the very few packages that goes inside of my base installation. So I've already done that. If I were to type ST in the package manager, or you could write status, you can see there's only one package there inside of my base installation and that is Pluto. So I'm going to say using Pluto when I'm back at the Julia prompt. And now I'm going to use one of the functions called the run function. So Pluto.run, you've got a state Pluto dot and open close parentheses. There we go. It's now also going to open my default browser. And it's going to start a Pluto notebook for me. There we go. We've got a Pluto notebook. You can open some sample notebooks, a new notebook. There's some notebooks that we've worked on before. So I'm going to right click on the new notebook and open it in a new tab. It's something that I like to do so that I just have this page open at all time. So there we go. We're now going to have a new tab in our default browser here and it's going to start a new empty Pluto notebook for us. There's our brand new notebook. So if you go up here, save notebook. I'm going to click in there and you can see because we started Julia inside of our folder, we're already inside of the right folder here. If not, you'll have to type all of this to get to the correct space or spot on your folder system in your internal drive to get here. So let's call this one PlutoDemo.jl. So these are not IP, Y and B files. These are .jl files. And we can see, well, what I'm going to do, I'll show you this, I'm just going to put src forward slash so that this is also in that source. Now you don't have to do that. I just want to keep everything there but we're not doing any package development. As you can see there, you can just type in the right address for the folder system that you want in where you want your file to be. So I'm going to click choose and now the file exists there. So two ways for you to use Pluto notebooks. If I type using in a cell, and I say a new package such as Pluto UI, you see there's a little cloud and a downward facing arrow. And if I hover over that, it's very tiny. It says Pluto UI vo.7.22 will be installed in the notebook when you run the cell. So I have not activated my environment here. The environment lives inside of this Pluto notebook. So if I share this notebook with someone else, this environment lives inside of the notebook. So that's certainly one way to go about it. And as soon as you execute this cell, that package is going to be installed for you in this notebook specific notebooks environment. Let's do something else though. I'm going to say using PKG. There's already a little tick mark there because package is already installed in my system. It came with Julia. I'm going to hold down command or control hit return or enter. It's going to execute that line and open a new line for me below. But remember, Pluto notebooks, you can just use these little plus symbols there to add new cells. So once that is done, I'm now going to say PKG dot activate the activate function. And I'm going to open my parentheses and then immediately there's a little comment that comes up. So if we click on that, it's going to say PKG dot activate disables Pluto's built-in package manager. And that means you can overwrite it. You can activate one of your own environments inside of this notebook and no longer use the inbuilt package manager. So my instance, remember that is going to be in four slash users. And then my name and then it was documents, documents and then Julia and then YouTube demo. And then project dot t o ml. So it's the project t o ml file that we want to activate. So if I run the cell and I didn't make any mistakes in my typing, it's going to activate this environment. So that's great. The two ways that you can use environments with a Pluto notebook. Next up, I'm going to show you visual studio code, fantastic coding environment becoming more and more popular. And you can type your Julia code inside of VS code. So here we have visual studio code from Microsoft to search for VS code on your favorite search engines going to bring you, you know, one of the first links will be this page from Microsoft is download. And my instance, it's going to say Mac if you're in a windows is going to say windows. And it's available for Linux as well. Download as easy as Julia installation, just double click on that downloaded file, accept all the defaults and install it and VS code is going to be available to you. So I'm here in my finder and then we can say visual studio code after I've installed it, I can double click on that and visual studio code is going to open up on the left hand side here. Now you're going to you might see some welcome messages, et cetera. Mine's been installed for some time. But these are the extensions button. Let's click on extensions. And in the marketplace, there are hundreds of extensions. And what you can do is just search for Julia. And in my instance, it's already installed. There we go. Julia language support. Let me just come out of there. I'll show you if I just come down here. There's Julia. It's already installed. So you have to install that extension. So I'm back in my terminal. I'm in my YouTube demo folder. Remember LS or DIR. That's where my project file is. What I'm going to type in now is code space dot. As simple as that. And that's going to open VS studio code for me. And I'm already in this folder. You know, everything is ready for me to go. Let's go back now to our extensions. Let's go down down. Let's click on Julia and let's go to this little gear icon again. And say extension settings. When I scroll down now, you'll see there's an executable path. And again, that's where my Julia executable is in that binary folder. Remember, right to the beginning when we set it as an environment variable or added it to our path. And this time I'm just putting Julia after the button that's the executable. So I'm just telling VS studio code this Julia language support extension where my Julia executable is. So please do the same. And what that does, it adds this little Julia icon for me on the left hand side. When you use Julia inside of VS code, it's going to give you all sorts of information about the active workspace, some documentation and the plot navigator. Every time you create plots, there's going to be a list of these plots on the left hand side. It's a very nice coding environment for Julia. And there we go. Installing Julia, sitting up different environments, using it in a Jupyter notebook, in a Pluto notebook, and also in VS code. So I really hope you enjoyed that. I hope you give Julia a try in 2022 if you've already done so, and you haven't used some of these environments to write your code in. Give them a try. It's a lot of fun.