Python vs Swift | Chris Lattner and Lex Fridman

Published 2020-10-20
Lex Fridman Podcast full episode:    • Chris Lattner: The Future of Computin...  
Please support this podcast by checking out our sponsors:
- Blinkist: and use code LEX to get a free week of premium
- Neuro: and use code LEX to get 15% off
- MasterClass: to get 15% off annual sub
- Cash App: and use code LexPodcast to get $10

Podcast website:
Apple Podcasts:
Full episodes playlist:    • Lex Fridman Podcast  
Clips playlist:    • Lex Fridman Podcast Clips  

- Subscribe to this YouTube channel
- Twitter:
- LinkedIn:
- Facebook:
- Instagram:
- Medium:
- Support on Patreon:

All Comments (21)
  • I love that you interrupt the conversation to clarify on statements your guests make. Many of the times the viewer is wondering the same thing.
  • @alfonshomac
    coming soon to python: from pyswift import *
  • Love seeing this pure CS stuff. Please include more pure CS! So interesting. Would be awesome to see people involved in Rust.
  • @kleetus88
    love how Chris gets into the details of how value semantics is achieved in a thoughtful and novel way compared to purely functional languages or Java using string immutability. Copy on write has been around for decades of course, but Swift brings it up the stack considerably.
  • @henrymach
    When I learned C and Pascal, the first thing that I liked is that you can pass practically anything by either value or reference to anything else.
  • @honestinsky
    Excellent clip Lex, thanks for posting, much appreciated. Your channel is one of the best in the world. Thanks for interviewing remarkable brilliant guests and sharing them with the world. A+
  • @TheVincent0268
    C# knows both value and reference types and has an implicit operation called (un)boxing to switch between value and reference type when needed.
  • @asdqwe4427
    You don't have to copy lists in functional languages. Generally speaking of you add something to a list in FP, you create list that points to the old one and your new value. Typically they are implemented as a tree to achieve this
  • @konrain7299
    Swift really is an elegant language, its taking everything we've learned in the last 30+ years of programming languages and starting on a clean slate.
  • @rudolflovrencic
    In my humble oppinion, C++ does this the best since value semantics is default, reference semantics is opt-in. Furthermore, you can pass by constant reference to provide a read-only view over the data without copying. Then, there is move semantics which is required if you want to make value semantics efficient.
  • Man I can’t tell you the number of times I’ve gotten stuck by that reference semantic thing with Python. It is super annoying and very confusing especially when you’re using someone else’s Library. Thank you for mentioning that.
  • @gandalfgrey91
    what happens in swift if there is a reference to a string that you are asking to append to? does it then create a copy to that string?
  • @blenderpanzi
    Swift sounds great, but if I understood everything correctly something to some degree similar is done in Rust. There is no copy on write, if you own a string you can just manipulate it. But once you give out a borrow you can't manipulate it anymore. And the receiver can't store away a reference that can change, but if you pass ownership to someone else that one can of course store and change it, if they want to. So you get pretty much the same advantages as with Swift, but you don't need any runtime checks (as you would need with copy on write - there you need to check if you need to make a copy on every write operation). You can do some of that with C++ (e.g. Qt's QString is copy on write internally), but it doesn't track ownership the way Rust does.
  • @AndrewEbling
    Great video! Could a whiteboard or blackboard aid communication and discussion?
  • @josuegisber8150
    I like to listen to Chris cause the way he explain things is fairly easy to understand
  • Lex's face change when Chris says "copy on write" and the question that was piling up in his head is answered. :)