Exception vs Errors | Chris Lattner and Lex Fridman
HTML-код
- Опубликовано: 25 авг 2024
- Lex Fridman Podcast full episode: • Chris Lattner: Future ...
Please support this podcast by checking out our sponsors:
- iHerb: lexfridman.com... and use code LEX to get 22% off your order
- Numerai: numer.ai/lex
- InsideTracker: insidetracker.... 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...
Apple Podcasts: apple.co/2lwqZIr
Spotify: spoti.fi/2nEwCF8
RSS: lexfridman.com...
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: ruclips.net/video/pdJQ8iVTwj8/видео.html
Lex Fridman podcast channel: ruclips.net/user/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.
My favorite quote: *"The art of API design is actually really profound."*
Nesting should be illegal? Wait until Lex hears about decorators.
😂😂
Nesting is beautiful, powerful and profound. Programming without nesting is not programming and should be illegal.
nah
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.
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...
FIZIRST!
"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?
@@imagudspellr1644That's like saying, "you can be a virgin if you only have sex once a month."
@@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.
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"?
@@_____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.
@@KenOtwell If a function in JS performs an HTTP request and then doesn't return anything, that's still a method?