Mojo Programming Language – Full Course for Beginners

preview_player
Показать описание
Learn Mojo in this full tutorial. The Mojo programming language combines the usability of Python with the performance of C. It's basically an enhanced version of Python specifically designed for Artificial Intelligence developers.

✏️ Course created by @elliotarledge

⭐️ Contents ⭐️
⌨️ (0:00:00) Intro
⌨️ (0:04:16) What is Mojo
⌨️ (0:07:57) Modular Community
⌨️ (0:12:06) Setting Up
⌨️ (0:17:04) Hello World
⌨️ (0:19:20) Local Jupyter Notebook
⌨️ (0:22:21) Variables, Declarations, and Datatypes
⌨️ (0:33:27) Getting User Input
⌨️ (0:36:28) IF/ELSE Statements
⌨️ (0:40:28) Loops & Functions
⌨️ (0:47:41) Python VS Mojo functions
⌨️ (0:52:26) OOP
⌨️ (1:05:21) Importing Libraries
⌨️ (1:08:48) Raises, Error handling, Exceptions
⌨️ (1:14:49) Inout, Borrowed, Owned, and With Statements
⌨️ (1:21:49) Variable Scope
⌨️ (1:24:46) Mojo CLI
⌨️ (1:35:54) SIMD (single instruction, multiple data)
⌨️ (1:43:47) Decorators & Metaprogramming
⌨️ (1:46:01) Speed test (Mojo VS Python)
⌨️ (1:58:48) How to Ask Questions & Post Errors
⌨️ (2:08:13) Final Comments
⌨️ (2:11:49) Outro

🎉 Thanks to our Champion and Sponsor supporters:
👾 davthecoder
👾 jedi-or-sith
👾 南宮千影
👾 Agustín Kussrow
👾 Nattira Maneerat
👾 Heather Wcislo
👾 Serhiy Kalinets
👾 Justin Hual
👾 Otis Morgan
👾 Oscar Rahnama

--

Рекомендации по теме
Комментарии
Автор

As a Python enthusiast i believe this will soon become my favorite language and thanks to you guys for providing amazing free content, once again!

Cahangir
Автор

Cant believe darth vader is teaching me mojo.such a deep voice 🎉🎉

TGIF
Автор

So i did a little research with the exotic behaviour of Int datatype:
Int8 stores 127 positive number, null and 128 negative numbers. So when you type 127 in Int8 you'll get 127, but when you type 128 you'll receive -128 and further initial increment just reduces the negative num by +1 (Int8 129 = -127 and so on).
Also when binary grid overflow occurs the bit pointer just continues to move from left to right overlapping past bit.
As shown in the video 6000 became 112. The representation of 6000 in binary is 1011101110000 and for 112 is 01110000, as you can see these are the last 8 bits of 6000 in binary.

baldeagle
Автор

The functionality of Python and the speed of C make Mojo a promising language 🔥 it's far from replacing Python at the moment but we will be waiting for it to evolve. Thank you for the tutorial

soheirabdelmoneim
Автор

Mojo has a lot of potential to take over the world. Hopefully it gets a lot of support.

VectorAlphaSec
Автор

58:02 I think it would be better example for "rhs" if you overload operator in that struct. Such as fn __add__(self, rhs: Banana) -> Float32: return self.Length + rhs.Length. Since you only return self.Rype or Length or Color, include "rhs" argument wasn't necessary.

vulamnguyen
Автор

I’m so glad you guys made this video, but I’d appreciate better audio quality.

Buntaqwerty
Автор

I was waiting for this since I heard about Mojo about six months ago!

agentm
Автор

Thank you so very much <3. A course on Scala along with some projects next please 🙏🏻.

raidenshgun
Автор

@30:54 people are going to get confused when Elliot says an Int8 can go from minus 255 to 255. That's not correct. If you take 2^8 bits (two to the eighth power or 2x2x2x2x2x2x2x2) you get 256 available values within any 8 bits or binary digit positions. In a signed integer, this is represented in decimal from minus 127 down to 0 and then up to to 127, totaling 255 possibilities (plus "negative 0" gives you 256, but nevermind that). So it's really only minus 127 to plus 127, not minus 255 to 255. The trick is the "sign bit" -- the leftmost bit position of the 8-bit byte that can of course be either 0 or 1. If 0, then the number is positive (7 bits going from 0-127) and if 1 the sign bit is set and the number is negative (7 bits going from negative 0 to negative 127). The other 7 of the 8 bits are used for the actual number. With an unsigned integer UInt, the sign bit is not used for negative numbers, but it is used instead for an additional 128 positive integers to take you from 0 to 255. This is convenient if you don't have any intention of the variable to go negative. A signed Int16 or 16-bit integer can give you 2^15 possibilities in both the negative and positive direction, or minus 32767 to +32767, and a 32-bit integer can give you (2^32 / 2) over 2 billion in either direction. Python is nice because it doesn't bother us with this, but this is also why Python is not as efficient as Mojo or C. So, when you start wanting high performance speed in your code, you have to start considering the bit and byte level to speed up many of your operations. Eventually it becomes second nature to know what purpose the variable or data element is being used for.

In general, the difference between a high-level developer and a regular programmer is more or less this understanding and not a great deal more. If you learn this well (and it's not really that impenetrable, I promise), you will have a richer understanding and a new level of ability with computers.

peterzelchenko
Автор

Thanks for the intro! Mojo looks very promising, , but anything that needs a huge speedup would be called from a Python library containing compiled functions. If there's no existing library, it takes extra time and effort to create a custom one in C or some other language compatible with the Python ABI. Yes, great advantage that Mojo compiles directly, but it is definitely possible to get good performance with Python.

MBeutnagel
Автор

The 'let' keyword is no longer supported in Mojo as of the 24.2 release. Instead, Mojo now only supports 'var' variables and undeclared variables (similar to Python) inside 'def' functions or in top-level code in the REPL. Therefore, you should use 'var' instead of 'let' for variable declarations.

noblackbox
Автор

I’m sure we’re a few years away from this but, imagine a game engine built in Mojo using Mojo as the scripting language. ❤

GiantsOnTheHorizon
Автор

Python based AI is usually implemented using the PyTorch library, which uses Lua (C based code) for optimizations.

plarion
Автор

nice, with the speed test with cuda/torch sometimes it delays the initialization of a lot of the cuda packages untill you start using torch. so can mean moving a few 100mb over once at the start of the program.
Just didnt want anyone to make the mistake - gpu is going to be much faster at doing most things esp parallellizable stuff.

Amazing tutorial thanks!

LeePenkman
Автор

This language is pretty cool 🤩. The syntax is just like that od Python and Kotlin.

nelmatrix
Автор

Thanks for the video. Honestly I’m not sure it really makes sense from a beginner perspective because a beginner would just be confused by Mojo, as they don’t understand the underlying Python. IMO it would have made more sense to write a tutorial for people who already know Python and how they could use this to speed up their programs.

JeremyJanzen
Автор

24 hours without this channel feels like a day

sknazrulislam
Автор

Thank finally some mojo
All do, I have a problem, remember the time you opened Jupyter Notebook? a made the same thing, write "Jupiter notebook" in the terminal, and other enter that link, but it does not open in my browser.

Anthemy_beats
Автор

It seems very clean! and I am liking it

latheeshvmv
join shbcf.ru