Learn to Program in Mojo Tutorial for Beginners

  Рет қаралды 3,760

Cameron McKenzie

Cameron McKenzie

Күн бұрын

The Mojo programming language is poised to revolutionize software development in the AI and ML space, and if you don't get ahead of it now, you'll find yourself falling behind.
This quick Mojo tutorial for beginners will get you started with the Mojo programming language from Modular.
In this quick Mojo crash course, we'll show you how to install Mojo on Ubuntu, install VSCode and configure the Mojo plugin, and then introduce you to the basics of the Mojo programming language.
Want to learn Mojo? Need a quick tutorial on how to program in Mojo? This Mojo crash course is definitely for you!
0:00 Mojo Tutorial Intro
2:12 Install Modular CLI
5:20 Modular clean command
5:55 Install Mojo
6:15 Set Mojo env variables
6:50 Mojo Hello World
8:40 Visual Studio & Mojo
9:00 VSCode Mojo Plugin
10:45 VSCode Hello World
12:30 Variables in Mojo
13:40 let vs var
16:15 def vs fn
17:45 Mojo methods
20:00 Variable scope
22:00 Conditional statements
24:20 Iterative loops
26:05 Unroll in Mojo
27:30 Mojo structs
29:44 Objects in Mojo
31:30 Mojo course conclusion

Пікірлер: 23
@lloydfaver4659
@lloydfaver4659 29 күн бұрын
I am a retired IT programmer with 50 years of experience. Yeah, I wired pegboards back in the 60's. The speed of Mojo has sparked an interest in me once again, even at the age of 75. It appears to me that the Google Chromebook plus OS platform will be a major contender in the IT world. What are the chances of Google stepping up to the plate on Mojo. By the way I just subscribed.
@Little-bird-told-me
@Little-bird-told-me 5 ай бұрын
I always loved your git videos, infact use it as a reference guide often. Great to see you in the mojo world. All the best and looking forward to seeing you more often.
@cameronmcnz
@cameronmcnz 5 ай бұрын
Thanks for the kind words! Yeah, my short Git videos got popular. I've always been a Java dev at heart, but I see Mojo really changing the game. More content to come!
@testpdgolegole
@testpdgolegole 5 ай бұрын
Hello sir how to accept integer variable in mojo
@user-qr4kt7dh4m
@user-qr4kt7dh4m 15 күн бұрын
Mojo is the future of Python.
@zaidkhan7196
@zaidkhan7196 5 ай бұрын
Awesome ❤,Damn I was waiting for the videos ... Flow up and All !!! Request You for more Content On Mojo And When Can we get official on Windows
@cameronmcnz
@cameronmcnz 5 ай бұрын
I'm working on it! So much more to cover! I'm looking forward to full native Windows support from Mojo myself!
5 ай бұрын
Great tutorial, great pace even at 1x, slowly collected well put explanations and examples. No biases or brainwashing, really well explained! But Darcy told us __init__ was a python flaw, yet it's in Mojo... sadness...
@cameronmcnz
@cameronmcnz 5 ай бұрын
Darcy? You mean the @Scrumtuous one?
@crab-cake
@crab-cake 2 ай бұрын
thank you for this. i have never used python before so the documentation wasn't very clear to me. i am interested in mojo coming from rust because of the ownership model and other rust features such as traits and strong typing. i think this language has a lot of potential even beyond ai.
@cameronmcnz
@cameronmcnz 2 ай бұрын
Thanks for the kind words! Lots has changed since I uploaded this. I need to make a new one! The ownership model is one of the biggest changes I need to get used to as a Java dev. Maybe you could help me out with that on the next video?
@crab-cake
@crab-cake 2 ай бұрын
​@@cameronmcnz i can give you a little rundown of ownership/borrowing. it's how memory is managed in rust. essentially each value has a variable that's called it's owner. there can only be one owner at a time and when that variable goes out of scope, memory is freed automatically. when you assign a value to one variable and then to another, the ownership is moved to the new variable. functions work similarly in that when you pass a value to a function, memory is freed. one important aspect though is that it's only freed when you actually take ownership. if you only borrow the value, the memory isn't freed, because you don't own value. i'll touch on borrowing a bit below, but conceptually this model is kind of a combination of garbage collection and manual memory management, but with the performance benefits of manual memory management. now i'll get into borrowing a little bit. there is a difference between borrowing an immutable value and borrowing a mutable value. when you borrow an immutable value, you're only allowed to read from it by default. you can't modify the value until you've given it a reference using the & syntax. so basically by using a reference, you're borrowing the immutable value. when you have a mutable value, you have to reference with the &mut syntax. there can only be one mutable reference to a piece of data in a specific scope, which hypothetically prevents data races because no other references to the data can exist at the same time in the same scope. i recommend reading "the rust book" which is their official online book/tutorial because i've skipped over some important details that would make this comment too long. there's only so much i can put in a comment but this is more of a basic rundown of some of the core concepts.
@crab-cake
@crab-cake 2 ай бұрын
​@@cameronmcnz i can give you a little rundown of ownership/borrowing. it's how memory is managed in rust. essentially each value has a variable that's called it's owner. there can only be one owner at a time and when that variable goes out of scope, memory is freed automatically. when you assign a value to one variable and then to another, the ownership is moved to the new variable. functions work similarly in that when you pass a value to a function, memory is freed. one important aspect though is that it's only freed when you actually take ownership. if you only borrow the value, the memory isn't freed, because you don't own value. i'll touch on borrowing a bit below, but conceptually this model is kind of a combination of garbage collection and manual memory management, but with the performance benefits of manual memory management. now i'll get into borrowing a little bit. there is a difference between borrowing an immutable value and borrowing a mutable value. when you borrow an immutable value, you're only allowed to read from it by default. you can't modify the value until you've given it a reference using the & syntax. so basically by using a reference, you're borrowing the immutable value. when you have a mutable value, you have to reference with the &mut syntax. there can only be one mutable reference to a piece of data in a specific scope, which hypothetically prevents data races because no other references to the data can exist at the same time in the same scope. i recommend reading "the rust book" which is their official online book/tutorial. i've skipped over some important details and there's a lot more information that you should know before making a video that would be too long for a comment.
@crab-cake
@crab-cake 2 ай бұрын
@@cameronmcnz do you have a discord server or something? i've tried to comment but i think it's being marked as spam because it's so long.
@cameronmcnz
@cameronmcnz 2 ай бұрын
@@crab-cake I keep intending to set one up with the team but haven't yet. I guess we probably should given the videos telling everyone about it. I'd love it if you were the first to join!
@zaidkhan7196
@zaidkhan7196 5 ай бұрын
Hoping for tutorials on how We can Use Python script with Mojo
@cameronmcnz
@cameronmcnz 5 ай бұрын
The good old Mojo PythonObject! It's an interesting resource that can go back and forth between Mojo and Python worlds. Video to come!
@10G0D
@10G0D 5 ай бұрын
how exactly can i find your server in discord? or simply put an invitation link or server link here. Thank you
@cameronmcnz
@cameronmcnz 5 ай бұрын
Imma be honest with you man. I'm building a team of Mojo enthusiasts and everything is happening so fast that we haven't yet set up the server. That was 'forward thinking' but I haven't set that up yet. Let me get someone on the team to do that this week.
@10G0D
@10G0D 5 ай бұрын
no worries. we are all enthusiasts in MOJO be cause it's too new and too young but also too promising. keep up.@@cameronmcnz
Mojo - the BLAZINGLY FAST new AI Language? | Prime Reacts
25:18
ThePrimeTime
Рет қаралды 170 М.
100+ Linux Things you Need to Know
12:23
Fireship
Рет қаралды 263 М.
Smart Sigma Kid #funny #sigma #comedy
00:25
CRAZY GREAPA
Рет қаралды 14 МЛН
孩子多的烦恼?#火影忍者 #家庭 #佐助
00:31
火影忍者一家
Рет қаралды 44 МЛН
KINDNESS ALWAYS COME BACK
00:59
dednahype
Рет қаралды 88 МЛН
I wish I could change THIS fast! 🤣
00:33
America's Got Talent
Рет қаралды 106 МЛН
Mojo🔥: a deep dive on ownership with Chris Lattner
48:50
Why Learn Mojo | Mojo Programming for Beginners
2:53
Numeryst
Рет қаралды 3,2 М.
Master Go Programming With These Concurrency Patterns (in 40 minutes)
46:15
Mojo Is FASTER Than Rust
19:22
ThePrimeTime
Рет қаралды 112 М.
Embedding Lua in C++ Part 3: Meh... Just use Sol...
31:10
javidx9
Рет қаралды 26 М.
Intro to the Zig Programming Language • Andrew Kelley • GOTO 2022
50:14
[UPDATE] Mojo Is Faster Than Rust - Mojo Explains More
52:09
ThePrimeTime
Рет қаралды 242 М.
Smart Sigma Kid #funny #sigma #comedy
00:25
CRAZY GREAPA
Рет қаралды 14 МЛН