An introduction to Mojo (for Python developers)

  Рет қаралды 8,688

Underfitted

Underfitted

Күн бұрын

This is an unconventional introduction to Mojo. I'll start with a Python script, port it to Mojo, and finish with an implementation that's 20 times faster than the initial code.
Mojo is incredible!
Here is the GitHub repository where you'll find the code in this video: github.com/svp...
I teach a live, interactive program that'll help you build production-ready Machine Learning systems from the ground up. Check it out here:
www.ml.school
To keep up with my content:
• Twitter/X: / svpino
• LinkedIn: / svpino
🔔 Subscribe for more stories: / @underfitted

Пікірлер: 28
@grzegorzryznar5101
@grzegorzryznar5101 3 ай бұрын
I am following Mojo development from quite a while, but I love your style and it was a pleasure to watch
@AC-go1tp
@AC-go1tp 3 ай бұрын
Awesome Underfitted!
@drm8164
@drm8164 2 ай бұрын
Excuse me Sir, please can I ask you a question: I just decided to pay for the OpenCV certification, its 1500 canadian dollars, and I m pretty convinced that it is a great investment for my future career in CV. Please can you give me your opinion? It will be a great help Thank you in advance :)
@underfitted
@underfitted 2 ай бұрын
Hard to tell, honestly. OpenCV is a great library, but I can't comment whether the content of that certification will be worth $1,500. Here is what I can tell you: 1. If this certification will help you learn, then yes, take it. 2. If this certification is only about getting a "certificate", then don't take it. Hope this helps!
@drm8164
@drm8164 2 ай бұрын
@@underfitted Thank you for your answer. Well I consider that having a certification is a Big Plus and it can really help me to be upgraded in a massive pool of candidates. I m a fresher data scientist and as I want to be a freelancer and work abroad I think having OpenCV and Tensorflow certifications will give me more credit. Do you believe in certifications values ? Thank you Sir :)
@grave0x
@grave0x 21 күн бұрын
The requirement of a main function to run a script implies any without a main is a library. And cleans up code a bit
@JesseWalker-v8t
@JesseWalker-v8t 3 ай бұрын
Worth mentioning that the original python module could have been run in Mojo. Your mojo program should work with something like: ``` from python import Python fn main() raises: Python.add_to_path(".") # the file path to the directory with the python module you want var search = Python.import_module("search") # this is how you import a Python Module search.main() # running the python module function as you'd expect ``` TBF, you're likely going to see the most dramatic performance increases from pure Mojo.
@underfitted
@underfitted 3 ай бұрын
Yes. I wanted to do the “translation” for the extra gains
@s1nistr433
@s1nistr433 2 ай бұрын
My only gripe with Mojo is that I wish it was marketed less towards AI and more towards general usage. It literally fixes the 2 major issues with Python that being lack of static typing and bad performance, if they market it as general purpose this could be a drop in replacement for python
@youflix_24
@youflix_24 Ай бұрын
i think after 5 years before we can fully use this programming language.
@fire17102
@fire17102 3 ай бұрын
Does mojo support dynamic dictionaries? Or do you have to specify the value's type? I want a faster python but I don't want everything pydantic Thanks for the video ❤
@orlandogarcia885
@orlandogarcia885 Ай бұрын
What is the environment in which Mojo is installed? Is it possible to create a conda environments and use it there?
@TheCommunistRabbit
@TheCommunistRabbit 24 күн бұрын
THE POLICE AT THE END IS THE CHERRY ON TOP
@eladiomendez8226
@eladiomendez8226 3 ай бұрын
The first one was great. This one was just as great !
@underfitted
@underfitted 3 ай бұрын
Thanks! I made a mistake before, so decided to fix it here.
@ericgroppe2095
@ericgroppe2095 3 ай бұрын
Thanks for correcting the info there Santi! Eager to see more mojo videos, but with the 🔥 instead of .mojo 😅. Good work man 🙏
@underfitted
@underfitted 3 ай бұрын
Yeah I need to start using the emoji extension
@harshitdubey8673
@harshitdubey8673 3 ай бұрын
what was wrong with the last one 🤔
@underfitted
@underfitted 3 ай бұрын
I made a big mistake by not using the output of the function, so Mojo didn’t call it. That’s why is was so crazy fast.
@harshitdubey8673
@harshitdubey8673 3 ай бұрын
@@underfitted at that time I was really got shocked how it can be that fast. But as everyone will agree we are still wondering because it’s still much faster than python.
@swdev245
@swdev245 Ай бұрын
@@harshitdubey8673 In Julia the program takes ~0.18 seconds on a 8-year-old Core i7-6700K
@isaiases
@isaiases 2 ай бұрын
I’ve becoming more and more disappointed with Mojo . The resulting language is nothing alike python, which is great for its simplicity and readability. And the overall performance is not really better than rust or other languages …
@perc-ai
@perc-ai 2 ай бұрын
not true Mojo will be the fastest language among all of them because its optimized for data centers while rust and other languages don't.
@the_mastermage
@the_mastermage 2 ай бұрын
I do have to concur, i hope it becomes great but I honestly hoped for mojo to go more pythony instead of adding like seperate function and class anotations. I would have prefered if mojo had just added gradual typing and (similar to how it works in Julia) and then worked from there.
@bobweiram6321
@bobweiram6321 2 ай бұрын
@@the_mastermageStrong typing is your friend. You'll appreciate it if you ever worked on large code bases.
@bobweiram6321
@bobweiram6321 2 ай бұрын
It is a lot more readable and safer than Python because it uses less type inferencing. It's already faster than Rust and in some cases faster than C++.
@perc-ai
@perc-ai 2 ай бұрын
@@bobweiram6321 that is absolutely correct.
Generics are VITAL in typed Python
16:54
Carberra
Рет қаралды 9 М.
Amazing Parenting Hacks! 👶✨ #ParentingTips #LifeHacks
00:18
Snack Chat
Рет қаралды 23 МЛН
Как подписать? 😂 #shorts
00:10
Денис Кукояка
Рет қаралды 8 МЛН
The Joker wanted to stand at the front, but unexpectedly was beaten up by Officer Rabbit
00:12
A gentle introduction to RAG (using open-source models)
50:10
Underfitted
Рет қаралды 9 М.
Mojo - the BLAZINGLY FAST new AI Language? | Prime Reacts
25:18
ThePrimeTime
Рет қаралды 173 М.
How to fine-tune a model using LoRA (step by step)
38:03
Underfitted
Рет қаралды 10 М.
Exploring FastHTML: making webstuff easier for Python people
15:06
Avoid These BAD Practices in Python OOP
24:42
ArjanCodes
Рет қаралды 55 М.
Why are vector databases so FAST?
44:59
Underfitted
Рет қаралды 17 М.
Modern Python logging
21:32
mCoding
Рет қаралды 189 М.
The most important Python script I ever wrote
19:58
John Watson Rooney
Рет қаралды 199 М.
Amazing Parenting Hacks! 👶✨ #ParentingTips #LifeHacks
00:18
Snack Chat
Рет қаралды 23 МЛН