Fireship · @fireship
Mojo Lang… a fast futuristic Python alternative
Uploaded May 4, 2023 · Length 4:14
Summary
Mojo Lang, a fast futuristic Python alternative, is a superset of Python that's up to 35,000 times faster than Python, designed for AI Hardware and programming on GPUs.
- mojo lang
- python alternative
- ai hardware
- gpu programming
- faster python
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
it is May 4th 2023 and you are watching
- 0:03
the code report python is a wonderful
- 0:05
language for productive programming but
- 0:07
it has one big problem it's too slow and
- 0:09
going slow means you'll get made fun of
- 0:11
by the rust and C plus Chads of the
- 0:13
world but the tables are about to turn
- 0:14
thanks to a brand new programming
- 0:16
language called Mojo a superset of
- 0:18
python that's not just two times faster
- 0:20
not ten times faster but up to 35 000
- 0:23
times faster than your grandpa's Python
- 0:25
and that's a huge deal because Python's
- 0:27
the dominant language for artificial
- 0:28
intelligence but behind the curtain
- 0:30
anything that needs to go fast is
- 0:31
written in C or C plus plus in today's
- 0:33
video we'll take Mojo for a spin but
- 0:35
first here are five things that you need
- 0:37
to know about it one this is not some
- 0:39
random guy's side project on GitHub but
- 0:41
rather it comes from a company founded
- 0:43
by Chris lattner the guy who created the
- 0:44
Swift programming language and the llvm
- 0:46
compiler tool chain if anybody could fix
- 0:48
Python's problems it's him and if you
- 0:50
have no idea what llvm is check out this
- 0:52
video two it's a language designed for
- 0:54
programming on AI Hardware like gpus
- 0:56
running Cuda and other accelerators it
- 0:59
achieves this by Leverage multi-level
- 1:01
intermediate representation to scale to
- 1:03
Exotic Hardware types without a ton of
- 1:04
complexity and it even has built-in Auto
- 1:06
tuning to optimize your code for your
- 1:08
Target Hardware three it's designed as a
- 1:10
super set of python in the same way
- 1:12
typescript is a superset of JavaScript
- 1:14
so you don't need to learn another
- 1:15
language to take advantage of it and
- 1:17
this is unique compared to other modern
- 1:18
systems languages like rust Zig Nim and
- 1:21
so on which would have a higher learning
- 1:23
curve for existing python programmers it
- 1:25
does have a bunch of features on top of
- 1:26
python like VAR and Lut declarations and
- 1:29
structs but the base language is fully
- 1:31
compatible with python and it can also
- 1:32
interop with the python ecosystem which
- 1:34
means you can still use your favorite
- 1:35
libraries like numpy pandas Etc or it
- 1:39
adds strong type checking to the
- 1:40
language you can still use Dynamic types
- 1:42
if you prefer but static types are
- 1:44
essential for optimized performance and
- 1:45
error checking for memory management it
- 1:48
has an ownership system and borrow
- 1:49
Checkers similar to rust and also
- 1:51
supports manual memory management with
- 1:53
pointers like C plus plus it's a
- 1:55
pragmatic language that gives you safety
- 1:56
but also the flexibility to be unsafe
- 1:58
when needed now the final thing to know


