Switching from Python to Mojo programming language | Chris Lattner and Lex Fridman
Вставка
- Опубліковано 2 чер 2023
- Lex Fridman Podcast full episode: • Chris Lattner: Future ...
Please support this podcast by checking out our sponsors:
- iHerb: lexfridman.com/iherb and use code LEX to get 22% off your order
- Numerai: numer.ai/lex
- InsideTracker: insidetracker.com/lex to get 20% off
Thanks to Tinker Assist for thumbnail image: www.tinkerassist.com/blog/moj...
GUEST BIO:
Chris Lattner is a legendary software and hardware engineer, leading projects at Apple, Tesla, Google, SiFive, and Modular AI, including the development of Swift, LLVM, Clang, MLIR, CIRCT, TPUs, and Mojo.
PODCAST INFO:
Podcast website: lexfridman.com/podcast
Apple Podcasts: apple.co/2lwqZIr
Spotify: spoti.fi/2nEwCF8
RSS: lexfridman.com/feed/podcast/
Full episodes playlist: • Lex Fridman Podcast
Clips playlist: • Lex Fridman Podcast Clips
SOCIAL:
- Twitter: / lexfridman
- LinkedIn: / lexfridman
- Facebook: / lexfridman
- Instagram: / lexfridman
- Medium: / lexfridman
- Reddit: / lexfridman
- Support on Patreon: / lexfridman - Наука та технологія
Full podcast episode: ua-cam.com/video/pdJQ8iVTwj8/v-deo.html
Lex Fridman podcast channel: ua-cam.com/users/lexfridman
Guest bio: Chris Lattner is a legendary software and hardware engineer, leading projects at Apple, Tesla, Google, SiFive, and Modular AI, including the development of Swift, LLVM, Clang, MLIR, CIRCT, TPUs, and Mojo.
"Oh that's the origin story..." Masterful hosting! Way to get him back to discussing something new regarding which Python package might be rewritten first. Of course, he didn't actually answer that either. ;)
My usual use case for python has been to prototype a concept quickly and then replace parts of the code or do a full rewrite for the sake of performance. If Mojo allows me to not have to chop shop or rewrite I am 100% using it.
Which language do you use for performance?
I'd have picked up Python long a go for serious stuff if it was more performant, Mojo can change the industry a lot.
This has really high potential. If you can use the same libraries and the same code but Refactor a little to use things like struck SIMD. You can get on board a lot of people to do great things that already use python. I’m already trying the alpha notebooks.
if you have access to the notebooks, can you test actual performance differences and publish them somewhere? because their hype comparisons to python for loops were just crazy, what has to be done is comparing to SIMD-utilizing functions in eg. numpy at the very least, and since they're running it distributed on a cluster, it would only be fair to use sth like pyspark. So if you can, run a performance test using sth like pyspark and numpy on the same cluster in pure Python, and then compare it to their built-in functions, only then will you know whether their performance claims hold up at all or simply use tools like pyspark or numpy underneath the hood (which we can't know since it's proprietary)
So Python is not going to be replace by Julia? Why Mojo over Julia?
From my understanding is that Julia is for science, mojo is for AI, everything else will just use python
mojo integrates (nearly) seamlessly into existing Python code. You can write Python code and run it using mojo. Then you can alter it using mojo constructs to improve its safety and performance. mojo has slightly stronger language features than Julia (mojo borrows ideas from Rust) but the main benefit is the interoperability with Python.
What about codon? Isn’t this just the same thing just behind a closed closed beta?
@@thomaskragerud8039 The idea behind codon is awesome, much better than what mojo offers, the only issue with codon is that it's proprietary (BSL license), aka the source code is available but it's only free for personal use. By 2026 it's expected to change to Apache 2 license and if the project matures by that time, it might be something amazing, but before that it's not really worth looking into. But it's still more interesting than Mojo which is nothing more than vaporware for now.
Julia will die.
the sad reality is the python library community has made it impossible for other python runtimes to reach 100% comparability. Lots of other implementations claimed significant speed improvement, but none of them are able to replace cpython. I've tried other python implementations and every time I ran into issues.
If only guido had taken time to formalize the language with a full detailed spec and stuck to it. Sadly that didn't happen and today no one has reached 100% compatibility.
Nice I have been wondering about this quite a bit lately and have high hopes for Mojo.
Mr. Lex Fridman, you are a wonderful person. You made me desire science and knowledge more than I used to be, and made me love life more after I was pessimistic and sad. You are a friend and a teacher at the same time. I am one of your viewers from the country that invented writing. 🧡
So, are you in Iraq?
@@alonzoperez2470 Yes 😊
Hey guys, I´m not pretty technical on the mojo use yet. If someone could kindly answer my question, let me set I know yet into AI, but I have a kind of warehouse app, and I would benefit in the speed If I re-write the app on mojo?? or this speed more for AI proposed at the moment?
Lattner is an international treasure.
This Mojo is way a much more attractive language than Rust. I'm looking forward to trying Mojo.
My use of pythong is in an engine that uses pygame that uses python, for somebody like me, two levels of frameworks have to switch before I can.
I assume that would be the case for most others, the frameworks have to switch before they do, or better frameworks have to pop up on mojo.
Amazing video. Does anyone know if Mojo can even run Numpy or Panda faster? And, does this mean we can train AI models faster too?
What exactly is the business case for Mojo? Can Chris commit to making it open source? Julia is academia-driven. Python has huge open-source backers. Neither of them is a product of a startup like Mojo is for Modular.
If Mojo is made free and publicly available, who's paying the bills for Modular? Will it have a licensing tier structure for academia/research/commercial use like other software vendors (Mathematica/Matlab) do?
The entire "closed beta with a wait list" approach that Modular is taking with Mojo has made me skeptical about it's open source viability. Any clarifications would be welcome!
I'm sorry but I'm not going to *WatchMojo*.
I hope that the popularity of the Mojo language will eventually hide most of that time wasting content
@@JerryThings 🤣🤣 haha, just checked it out to see what you were talking about. I was curious at first...
This had me rolling 😂😂
@@surajjain7119 it was cringe
@@AmpersAndAI for you..
The real question is. Can I use it with py_script. Or Mojo_Script.
Though there's no way to install mojo at the moment 👀
we already had cython if you really needed super tightened code granted at more complexity but it will be interesting to see how this stands up against rust which had already started to gain traction finally even at the os level
this looks more for AI , rust not necessarily for AI
@@powerHungryMOSFET python is great for ml that is not exaxctly the same as the umbrella term ai which will be supplanted by agi this could work but most of those ml libraries even python uses are actually written in straight c which rust may be viewed or favored as a replacement for
But then rust came with a bunch of wack policies which seem to have turned a lot of people away from rust again lol
@@lmnts556what are the policies ?
@@lmnts556also curious to know
Will it run PyScript?
It's totally 2 separate systems that have something to do a bit but can be without it. Like financial system, healthcare system, and eSports and gambling system and gaming. So one is to reduce Inequality at ground level and another for creativity and arts development. And mojo maybe also is another more customer centric one that may not apply to some. So it's so complicated that even wall street gets disconnected. Haha the commentators seem surprised that they are hyping on nothing. But generally it's 3 separate issues that can be separated like currency exchanges. Swift is the banking One? Or the keyboard?
does it run pytorch?
yes
I see Chris is hinting at something which would replace Mojo.
MISTER MOJO RISIN
i want to use rhe fire emoji now! and leave a legacy ...
jokes aside, this optimisation could be a game changer. I'm comforted by Chris's intellect., He kinda reminds me of Feynman in the way he illustrates his concepts
Python has got a simplier syntax than Mojo tho lol
But less speed. Speed is always king if the other aspects are equal.
@@lmnts556 Not for adaptability. Pythons whole selling point is how much more convenient it is compared to other languages.
@@pranavmarla It is also unfathomably slow without using Python as only glue and then using code written in other languages... then as glue it hinders or prevents parallelism...
Python is great as a syntax and language for accessibility but runs into actual real world demands that force rewrites and moves away to other languages.
@@pranavmarla Does not matter really. Speed is the most important part if everything in python has to be re-written in other languages due to it being too slow. Then it's useless. Hoping Mojo will fix that.
@@lmnts556 Ah, I get your point. But my point is that I don't see it being as popular as python if it's less convenient.
I was good at Python 2.7, thanks.
Another julia wanne be. Julia has come a long way and very nice syntax.
is this mojo language just for AI?
Yes
👍
Miojo? Gosto muito, com exceção do tempero no pacotinho - que é prejudicial à saúde.
MOJO sound scary as fuck
python had 2 problems when i saw it.... 1 was the python 3 was altering how to write the code.... and the other that could have been promising is c to python conversion, like when you want to switch from c fast language to python you could transfer natively...
Everyone is using numpy anyway. How does mojo compare to numpy
The "fire emoji" file extension is one of the dumbest things ever.
Let's not be anti-cool here. We're entering Mojo territory now
It's just whatever but it really isn't dumb
Cope harder
Actually yo tech is starting to scare me yo is someone gonna break into my house with teleportation code
Fortran in 2023?
- proprietary software
- no source code available
- *no binary available*
- unverifiable crazy performance claims
- comparing to worst case scenario
yep, it's vaporware hype time, no one will remember this project a year from now when it becomes clear that it's no different than using equivalent python modules
Yeah because the guy who made LLVM has no credibility when it comes to performance.
They've said it will be open sourced. Most of this sort of tech starts off closed while the initial architecture and design are fleshed out. Then they are opened. On the Modular site there's a video where they take a Python matrix multiplication sample and progressively Mojo-ise it up to 400x or something. I can't remember the factor now. I take the claimed 35Kx maximum speedup with a pinch of salt but I've no doubt the final product will be at least equivalent to C. But let's see what happens at 1.0.
@@kevinmcfarlane2752 What type of python matrix multiplication, some list of lists nonsense or did they utilize SIMD by using sth like numpy? Also this would still imply that python was running on a single thread while mojo was running on a cluster, if they wanted to make it fair, they'd use python in conjunction with sth like pyspark. If mojo is significantly faster than that, i'll be impressed, but even then it'd still be vaporware until it's actually released and open sourced, because if they end up using some crappy license like BSL and charge for commercial use, none of this will matter anyway and the project will die. Also, "at least equivalent to C"? C is the fastest high level language out there so this is definitely not happening, not even Rust is as fast as C though it comes close. Unless of course you want to compare SIMD operations with multiple executors on a cluster to a single threaded for loop.
The easier language becomes, perhaps even AGI has created or assisted. Would not that become concerning? Unchecked?
I am reminded of the movie Close Encounters. It's possible that music is the universal language. However if you remember, the controls was turned over to (although they didn't say) AGI. What if there's a problem with the message, communication that might be detrimental to humans?
Layoff the weed bro
@@BlackDub21 actually he's got a point.
Mojo really wants to promote their product through UA-camrs, but this strategy might not be sustainable in the long run. Once Python transitions to Python 4, Mojo will struggle to keep up with the changes and advancements.
there will not be python 4
Wao^^
Isn't mojo a proprietary closed source thing?
it is, and not even released yet, simply overhyped vaporware
It is planned to become open source. It's just not finished yet.
@@volbla sure...
@@zombizombi Why not? Dude is co-creator of LLVM and Clang. They're both open source.
@@volbla Why not open source from start? As far as I can tell this is all just hype until it happens.
meow
MEOW!
Why is there so much talk about a programming language that doesn't exist yet? Plus why is their marketing scheme so strong and going through youtube? Publish it and let your work speak
too much talk, red flags start popping up
There's a website, so go have a look. The other languages were also talked about before they existed.
this programming language doesn't exist yet. what is going on here??
exactly this, fabricated hype around some vaporware that everyone will forget about a year from now because once it releases it'll be clear that it's no different than simply using appropriate python modules to achieve the same performance xD
I have access to the beta... you can sign up for the waitlist and try it out
@@veebeeTV nah. first open source, then I'll think about trying it
@@DMSBrian24 What if there is no library? Then you need to use compiled language. This is the point of mojo that you wont need to do this.
@@nemanjatrivic9505 what do you mean no library? every feature i've seen Mojo advertise can be done with a combination of pyspark and numpy, former being written in Scala, latter in C, they're both fast af and are basically a standard and I wouldn't be surprised if Mojo just used them under the hood as it is. Mojo is also narrowing down its focus to essentially just AI which is really stupid for a language to do and also indicates that they're just trying to ride the recent AI hype wave. But regardless of all of this, they keep the project closed source and don't even distribute a binary, this language basically doesn't exist, i'd get buying into the hype once it's released and open sourced, as it is it's vaporware
So fed-up with Python - so many add-ons that I hate the whole thing now.
Its not even out yet.
And?
@@kevinmcfarlane2752 I got excited to try it but found out it’s in early development and waitlist only. Looks promising according to their website though.
First
Last thing we need is new programming language
Let python alone 2:11
You are thinking about it in the wrong way. If mojo lives up to its promise it will mean that existing Python users will be able to expand their capabilities with their existing Python skills. New users who may never have considered Python because it is not suitable can be introduced.
Laughing in R
What a ridiculous name lol
Agree
I am not a python lover but an emoji as the file extension and thinking that people would want to learn new programming languages when AI is here to do it all - is stupid.
I thought python script-kiddies were ridiculous. Now we're supposed to use a language called "Mojo"?! what a joke...
What a dumb comment.
Anchor is so dead, boring 😂
Nothing better than c... Except rust
So a more accurate statement would be "Some things are better than Rust"
Stupid comment. Languages are tools for addressing certain classes of problem. "Better" or "worse" is meaningless without specifying a context. E.g., C is better than JavaScript for embedded software development but not for website development.
@@kevinmcfarlane2752 "Don't take everything seriously what you read on the Internet." - Sir Winston Churchill