Exception vs Errors | Chris Lattner and Lex Fridman

Sdílet
Vložit
  • čas přidán 4. 06. 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
    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
  • Věda a technologie

Komentáře • 19

  • @LexClips
    @LexClips  Před rokem

    Full podcast episode: czcams.com/video/pdJQ8iVTwj8/video.html
    Lex Fridman podcast channel: czcams.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.

  • @garanceadrosehn9691
    @garanceadrosehn9691 Před rokem +7

    My favorite quote: *"The art of API design is actually really profound."*

  • @quintrankid8045
    @quintrankid8045 Před rokem +21

    Nesting should be illegal? Wait until Lex hears about decorators.

    •  Před 28 dny

      😂😂

  • @piotrjasielski
    @piotrjasielski Před rokem +8

    Nesting is beautiful, powerful and profound. Programming without nesting is not programming and should be illegal.

  • @avi7278
    @avi7278 Před rokem +1

    FIZIRST!

  • @spiritualpolitics8205
    @spiritualpolitics8205 Před rokem +1

    A little too in the weeds and did not quite address the more global question of Hey let's just get rid of errors altogether. What of the not having NULL debate? You mention Rust, I assume to consider that. A lot of missing points here.

    • @KenOtwell
      @KenOtwell Před rokem +4

      I assume you meant "lets get rid of error HANDLING altogether." The only way to actually get rid of errors is not to write any code at all. And before you say let ChatGPT do it... I spent hours trying to work with ChatGPT to write a method with no errors, and every time ChatGPT assured me that THIS version was right...

  • @KenOtwell
    @KenOtwell Před rokem +2

    "Think about a function that doesn't return anything..." Uh.. functions are defined as code that ONLY returns things with no side effects. If you have a function that doesn't return anything, then it doesn't do anything whatsoever. Chris actually meant "method", not function. Of course, Python also labels methods as functions, so.... consistency is the hobgoblin of little minds?

    • @KenOtwell
      @KenOtwell Před 6 měsíci

      @@imagudspellr1644That's like saying, "you can be a virgin if you only have sex once a month."

    • @KenOtwell
      @KenOtwell Před 6 měsíci

      @@imagudspellr1644 From Microsoft's co-pilot: Functional programming has its roots in academia, evolving from the lambda calculus, a formal system of computation based only on functions1. The early functional programming languages include:
      Lisp
      LISP: Defined by McCarthy in the late 1950s, LISP uses Church’s λ notation for functions2.
      Iswim: Developed by Peter Landin in the 1960s, Iswim significantly pushed the functional programming paradigm2.
      APL
      APL: Developed by Iverson in the 1960s, APL also contributed to the advancement of functional programming2.
      These languages laid the foundation for modern functional languages like Common Lisp, Scheme, Clojure, Wolfram Language, Racket, Erlang, Elixir, OCaml, Haskell, and F#1.
      Learn more
      1
      en.wikipedia.org
      2
      cse.psu.edu
      3
      en.wikipedia.org
      4
      codedocs.org
      which functional languages were pure, i.e., did not allow for side-effects?
      Searching for: pure functional programming languages
      Generating answers for you…
      Pure functional programming languages are those that do not allow for side-effects. In these languages, functions depend only on their arguments, regardless of any global or local state1. Here are some examples of pure functional languages:
      Haskell: Haskell is a statically typed, purely functional programming language with type inference and lazy evaluation2.
      Mercury: Mercury is a logic/functional programming language which combines the clarity and expressiveness of declarative programming with advanced static analysis and error detection features2.
      Clean: Clean is a general purpose, state-of-the-art, pure and lazy functional programming language designed for making real-world applications2.
      These languages ensure that when a pure function is called with some given arguments, it will always return the same result, and cannot be affected by any mutable state or other side effects3. This is in contrast with impure procedures, common in imperative programming, which can have side effects3.

    • @_____case
      @_____case Před 2 měsíci

      If you pass a function F as an argument to a function G which invokes F, but doesn't return anything, would you really say that G doesn't do anything?
      In JavaScript, if a function performs an I/O operation, is that considered a "side effect"?

    • @KenOtwell
      @KenOtwell Před 2 měsíci

      @@_____case Yes, if G is a function and never returns anything, the only thing it does is noncomputational - i.e., it wastes time. But if it returns something or not depending on its inputs, then it is doing work and making a binary decision at least. And yes, if the Javascript I/O function changes the state of the system and if that state can then be queried - it's not a real function and has side-effects. That's a method, not a function.

    • @_____case
      @_____case Před 2 měsíci

      @@KenOtwell If a function in JS performs an HTTP request and then doesn't return anything, that's still a method?