Fireship · @fireship

Mojo Lang… a fast futuristic Python alternative

Uploaded May 4, 2023 · Length 4:14

Mojo Lang… a fast futuristic Python alternative

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.

  1. 0:00

    it is May 4th 2023 and you are watching

  2. 0:03

    the code report python is a wonderful

  3. 0:05

    language for productive programming but

  4. 0:07

    it has one big problem it's too slow and

  5. 0:09

    going slow means you'll get made fun of

  6. 0:11

    by the rust and C plus Chads of the

  7. 0:13

    world but the tables are about to turn

  8. 0:14

    thanks to a brand new programming

  9. 0:16

    language called Mojo a superset of

  10. 0:18

    python that's not just two times faster

  11. 0:20

    not ten times faster but up to 35 000

  12. 0:23

    times faster than your grandpa's Python

  13. 0:25

    and that's a huge deal because Python's

  14. 0:27

    the dominant language for artificial

  15. 0:28

    intelligence but behind the curtain

  16. 0:30

    anything that needs to go fast is

  17. 0:31

    written in C or C plus plus in today's

  18. 0:33

    video we'll take Mojo for a spin but

  19. 0:35

    first here are five things that you need

  20. 0:37

    to know about it one this is not some

  21. 0:39

    random guy's side project on GitHub but

  22. 0:41

    rather it comes from a company founded

  23. 0:43

    by Chris lattner the guy who created the

  24. 0:44

    Swift programming language and the llvm

  25. 0:46

    compiler tool chain if anybody could fix

  26. 0:48

    Python's problems it's him and if you

  27. 0:50

    have no idea what llvm is check out this

  28. 0:52

    video two it's a language designed for

  29. 0:54

    programming on AI Hardware like gpus

  30. 0:56

    running Cuda and other accelerators it

  31. 0:59

    achieves this by Leverage multi-level

  32. 1:01

    intermediate representation to scale to

  33. 1:03

    Exotic Hardware types without a ton of

  34. 1:04

    complexity and it even has built-in Auto

  35. 1:06

    tuning to optimize your code for your

  36. 1:08

    Target Hardware three it's designed as a

  37. 1:10

    super set of python in the same way

  38. 1:12

    typescript is a superset of JavaScript

  39. 1:14

    so you don't need to learn another

  40. 1:15

    language to take advantage of it and

  41. 1:17

    this is unique compared to other modern

  42. 1:18

    systems languages like rust Zig Nim and

  43. 1:21

    so on which would have a higher learning

  44. 1:23

    curve for existing python programmers it

  45. 1:25

    does have a bunch of features on top of

  46. 1:26

    python like VAR and Lut declarations and

  47. 1:29

    structs but the base language is fully

  48. 1:31

    compatible with python and it can also

  49. 1:32

    interop with the python ecosystem which

  50. 1:34

    means you can still use your favorite

  51. 1:35

    libraries like numpy pandas Etc or it

  52. 1:39

    adds strong type checking to the

  53. 1:40

    language you can still use Dynamic types

  54. 1:42

    if you prefer but static types are

  55. 1:44

    essential for optimized performance and

  56. 1:45

    error checking for memory management it

  57. 1:48

    has an ownership system and borrow

  58. 1:49

    Checkers similar to rust and also

  59. 1:51

    supports manual memory management with

  60. 1:53

    pointers like C plus plus it's a

  61. 1:55

    pragmatic language that gives you safety

  62. 1:56

    but also the flexibility to be unsafe

  63. 1:58

    when needed now the final thing to know