Python vs Swift | Chris Lattner and Lex Fridman

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ต.ค. 2020
  • Lex Fridman Podcast full episode: • Chris Lattner: The Fut...
    Please support this podcast by checking out our sponsors:
    - Blinkist: blinkist.com/lex and use code LEX to get a free week of premium
    - Neuro: www.getneuro.com and use code LEX to get 15% off
    - MasterClass: masterclass.com/lex to get 15% off annual sub
    - Cash App: cash.app/ and use code LexPodcast to get $10
    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
    CONNECT:
    - Subscribe to this TH-cam channel
    - Twitter: / lexfridman
    - LinkedIn: / lexfridman
    - Facebook: / lexfridmanpage
    - Instagram: / lexfridman
    - Medium: / lexfridman
    - Support on Patreon: / lexfridman
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 305

  • @lessmoneylessproblems5145
    @lessmoneylessproblems5145 3 ปีที่แล้ว +360

    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.

    • @botfantasies6229
      @botfantasies6229 3 ปีที่แล้ว +3

      it's called normal conversation behavior, not sure why this is blowing your mind

    • @HaroldVonAnusIII
      @HaroldVonAnusIII 2 ปีที่แล้ว +10

      @@botfantasies6229 it’s called “letting someone know that you appreciate them”
      You should try it sometime, it feels really good

    • @mayankbhaisora2699
      @mayankbhaisora2699 ปีที่แล้ว +6

      @@botfantasies6229 no one said it’s blowing their mind. It’s called appreciating someone’s work, not sure why this is making you mad

    • @budomushin
      @budomushin 20 วันที่ผ่านมา

      @@botfantasies6229 probably because it should be normal, but according to the status quo it hardly ever is "normal"

  • @alfonshomac
    @alfonshomac 3 ปีที่แล้ว +184

    coming soon to python:
    from pyswift import *

    • @R3negade638
      @R3negade638 3 ปีที่แล้ว +2

      😂

    • @MASBHANOMAN
      @MASBHANOMAN 3 ปีที่แล้ว

      :D

    • @chris9352
      @chris9352 3 ปีที่แล้ว +5

      here you go gist.github.com/jiaaro/e111f0f64d0cdb8aca38

    • @tad1706
      @tad1706 3 ปีที่แล้ว +2

      @@chris9352 No wayyy!! That's actually hilarious

    • @jorge1869
      @jorge1869 3 ปีที่แล้ว

      🤣

  • @kleetus88
    @kleetus88 3 ปีที่แล้ว +37

    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.

  • @hackerculture7391
    @hackerculture7391 3 ปีที่แล้ว +156

    Love seeing this pure CS stuff. Please include more pure CS! So interesting. Would be awesome to see people involved in Rust.

    • @fetalfirefight
      @fetalfirefight 3 ปีที่แล้ว +7

      Chris is especially good at it too, easy to see why he's had an awesome career so far

    • @itsbk6192
      @itsbk6192 3 ปีที่แล้ว +7

      Rust was exactly what I was thinking of when he was talking about mutable references and the annoying bugs that could ensue. I really like rust's borrowing and ownership design and its strict compiler

    • @ConernicusRex
      @ConernicusRex 3 ปีที่แล้ว +1

      Why use Rust when you can use Swift? It's like making an action movie and really angling to cast Frank Stallone.

    • @hackerculture7391
      @hackerculture7391 3 ปีที่แล้ว

      @@ConernicusRex Swift is not a serious language when it comes to systems programming. It's a good language but the future of systems and the web is WebAssembly and Rust.

    • @ConernicusRex
      @ConernicusRex 2 ปีที่แล้ว +2

      @@hackerculture7391 web and systems are entirely separate fields.

  • @henrymach
    @henrymach 3 ปีที่แล้ว +33

    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.

    • @nieczerwony
      @nieczerwony ปีที่แล้ว +1

      Exactly. You have full control over your code, but with great power comes great responsibility 😉

    • @ivanpavlov2201
      @ivanpavlov2201 8 หลายเดือนก่อน

      @@RuslanMasinjila C level* 😁

  • @honestinsky
    @honestinsky 3 ปีที่แล้ว +25

    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+

  • @konrain7299
    @konrain7299 3 ปีที่แล้ว +171

    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.

    • @konrain7299
      @konrain7299 3 ปีที่แล้ว +2

      @@dixztube 👍

    • @grapy83
      @grapy83 3 ปีที่แล้ว +1

      @@dixztube That's great

    • @donk8961
      @donk8961 3 ปีที่แล้ว +13

      It pains me every time I find out a client’s app is in Objective C and not swift.

    • @matthiasschuster9505
      @matthiasschuster9505 3 ปีที่แล้ว

      And is there something like a full HM type system like in OCaml and FSharp? Do I need to specify the types, or can do the compiler do that? Complete type inference and pure function checking? Can I check if a given function is pure or not? And is pattern matching exhaustive?

    • @evergreen-
      @evergreen- 3 ปีที่แล้ว +1

      @@matthiasschuster9505 type inference is present in swift, and it’s pretty good. The functional aspect of Swift is lagging, things like function purity aren’t checked. Pattern matching is exhaustive by default. As for the type system, not sure; however, HKT aren’t yet supported

  • @TheVincent0268
    @TheVincent0268 3 ปีที่แล้ว +4

    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
    @asdqwe4427 3 ปีที่แล้ว +5

    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

  • @wholenutsanddonuts5741
    @wholenutsanddonuts5741 3 ปีที่แล้ว +6

    Ooo. I love both of these languages. Thanks for doing a comparison!

    • @fishfire_2999
      @fishfire_2999 3 ปีที่แล้ว +1

      I prefer python .

    • @konrain7299
      @konrain7299 3 ปีที่แล้ว +1

      @@fishfire_2999 why?

  • @wholenutsanddonuts5741
    @wholenutsanddonuts5741 3 ปีที่แล้ว +54

    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.

    • @fishfire_2999
      @fishfire_2999 3 ปีที่แล้ว

      Exactly

    • @Julia-zi9cl
      @Julia-zi9cl 3 ปีที่แล้ว +1

      What is references semantic

    • @magnushoklandhegdahl1218
      @magnushoklandhegdahl1218 3 ปีที่แล้ว +12

      @@Julia-zi9cl
      a = [1,2,3]
      b = a
      a[1] = 4
      print(b) # will print [1, 4, 3]

    • @wow5heyy
      @wow5heyy 3 ปีที่แล้ว

      @@magnushoklandhegdahl1218 is this because when assigning a to b, b gets a pointer to the location in memory of the original array a? so when you change the values at that location in memory, it effects the value assigned to b? whereas if you were to pass by value a copy would be made, and changing the values at location a would no longer effect the value of b?

    • @magnushoklandhegdahl1218
      @magnushoklandhegdahl1218 3 ปีที่แล้ว

      @@wow5heyy in python there is no pass by value. every assignment is a reference. you can however make an explicit copy by doing b = list(a) instead

  • @rudolflovrencic
    @rudolflovrencic 3 ปีที่แล้ว +46

    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.

    • @R3negade638
      @R3negade638 3 ปีที่แล้ว +8

      Exactly, it’s great. Ive never used swift but I think he explains that they took that same concept even further by hiding away things like const, private, reference, etc, but making them available if you know what you’re doing and need them.

    • @TheBrainDunne
      @TheBrainDunne 3 ปีที่แล้ว +5

      I agree C++ does this the best.

    •  3 ปีที่แล้ว +7

      No swift experience here, but worked with tons of C++. C++ does give you utmost control of value/references/constness. The real downside of C++ to me is how convoluted the wording gets. &, * and const can be mixed in various ways and each of these symbols/keyword have different meanings in different contexts. I love the expressiveness of C++ but it could have been worded better I guess

    • @9SMTM6
      @9SMTM6 3 ปีที่แล้ว +2

      Well, you can't really beat Rust here though.
      Rust has learned from C++ and made it better.
      Like C(++) Rust is "value semantics by default", but also references are const by default, which means that default is also better used.
      Rust also is move semantics by default, you have to explicitly copy if you want to continue using a variable.
      So like C++ a function signature in Rust gives pretty much all the Information, but because of better defaults and the enforcement of certain features by the compiler (I. E. That not two mutable references be active at the same time), the function signatures tend to be even better related to the way the values will be used.

    •  3 ปีที่แล้ว +1

      @@9SMTM6 I believe you, gotta try rust yet, been away from low level stuff for quite a while. If I may ask, would Rust be a good option for coding the low level AI/ML code, like the heavy math? I see it being mentioned a lot for system programming but I am not sure how good it is for SIMD/GPU

  • @TheCsupertramp
    @TheCsupertramp ปีที่แล้ว

    Increíble podcast, gracias.

  • @vincentweber1359
    @vincentweber1359 3 ปีที่แล้ว +3

    Really reminds me of the Borrow Checker of the language Rust.

  • @gandalfgrey91
    @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?

  • @josuegisber8150
    @josuegisber8150 3 ปีที่แล้ว +4

    I like to listen to Chris cause the way he explain things is fairly easy to understand

  • @blenderpanzi
    @blenderpanzi 3 ปีที่แล้ว +2

    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.

    • @Art-is-craft
      @Art-is-craft 5 หลายเดือนก่อน

      The main difference is that Swift can be used as a complete software engineering language which Rust cannot.

    • @blenderpanzi
      @blenderpanzi 5 หลายเดือนก่อน +1

      @@Art-is-craft What does that even mean? How do you define a "software engineering language"? Can you create UML diagrams in Swift?

    • @Art-is-craft
      @Art-is-craft 5 หลายเดือนก่อน

      @@blenderpanzi
      Software is a computer program that run a single machine.

    • @blenderpanzi
      @blenderpanzi 5 หลายเดือนก่อน

      @@Art-is-craft Ah, ok, you're a bot.

    • @Art-is-craft
      @Art-is-craft 5 หลายเดือนก่อน

      @@blenderpanzi
      You said you did not know what I was talking about. I now defined what software is so next I can describe what software engineering is and try to relate it to my original comment.
      There are very few languages at commercial scale that can build a complete software program Rust and Python are not that. Even C does not get used as a compete package and C++ is starting to fade.

  • @andreasnulein782
    @andreasnulein782 ปีที่แล้ว +1

    Lex's face change when Chris says "copy on write" and the question that was piling up in his head is answered. :)

  • @skewty
    @skewty 3 ปีที่แล้ว +1

    So basically Swift neither passes by value, nor passes by reference; it passes by proxy. The proxy is smart enough to keep track of who should get the new value and who should get the old value when mutation occurs. Is this correct?

  • @stueygewy
    @stueygewy 3 ปีที่แล้ว +2

    Chris Lattner has the mannerisms to be one of those Thermian aliens from the movie Galaxy Quest.

  • @vivekvarma3079
    @vivekvarma3079 3 ปีที่แล้ว +3

    Java maintains String objects as immutable, but they use String objects pool to reduce consumption of Heap memory while runtime. So the concern guest is saying is very minimal in real world performance and memory consumption.

    • @ronensuperexplainer
      @ronensuperexplainer ปีที่แล้ว

      Java is a monster of memory consumption.
      A "hello world" Java program takes 1 gigabyte of RAM.
      Swift chooses reference counting instead of Java-style garbage collection.
      That means that Swift apps use more memory, but Java apps are faster.
      In fact, Java memory allocation is faster than C++ memory allocation.

  • @alpineflauge909
    @alpineflauge909 3 ปีที่แล้ว

    awesome, thanks

  • @botfantasies6229
    @botfantasies6229 3 ปีที่แล้ว +1

    I don't understand why programmers have a hard time choosing between or understanding reference and value semantics. Do you want that object to exist on its own or not?

  • @johnngo9690
    @johnngo9690 3 ปีที่แล้ว +1

    That cauliflower ear is getting noticable

  • @AndrewEbling
    @AndrewEbling 3 ปีที่แล้ว +1

    Great video! Could a whiteboard or blackboard aid communication and discussion?

  • @anata.one.1967
    @anata.one.1967 3 หลายเดือนก่อน

    From my experience, Swift has both value and reference semantics, value for `struct` and reference for `class`? Am I wrong or is Chris talking about non-custom data types?

  • @stevenabbott7508
    @stevenabbott7508 3 ปีที่แล้ว +17

    This is functional programming pilled

  • @mccallionr
    @mccallionr 3 ปีที่แล้ว +1

    Thanks Lex, thanks Chris :) .

  • @coke2679
    @coke2679 3 ปีที่แล้ว +12

    Started Swift about 2 years, it almost immediately became my favourite language. Going from Swift to Dart felt like such a downgrade.

    • @isaac80745
      @isaac80745 11 หลายเดือนก่อน

      Same here swift is awesome. Apple poured everything to make swift do everything we want so we can use it in ios development.

  • @EdsonMedina
    @EdsonMedina 3 ปีที่แล้ว +1

    PHP arrays also do copy on write.

  • @PixelPhobiac
    @PixelPhobiac 3 ปีที่แล้ว

    Very interesting

  • @GigaMarou
    @GigaMarou ปีที่แล้ว

    Good Design!!!

  • @JethroYSCao
    @JethroYSCao 3 ปีที่แล้ว

    If the tensors (and other objects in general) are being passed by value and cloned in Swift, isn't that inefficient? That's the whole point of using references for objects, arrays, maps, etc. is it not?

    • @evergreen-
      @evergreen- 3 ปีที่แล้ว +2

      No, he explains that no unnecessary copying is made in Swift.

  • @TrippSaaS
    @TrippSaaS ปีที่แล้ว

    "Actually good design is something you can feel" totally agreed. I bought a google phone and miss apple design

  • @nobody12316
    @nobody12316 3 ปีที่แล้ว +3

    Should try to get Rich Hickey on the show!

  • @clivefernandes5435
    @clivefernandes5435 3 ปีที่แล้ว +1

    So when are we getting swiftpy

  • @tupierorosa723
    @tupierorosa723 2 ปีที่แล้ว +1

    "Good design is something you can feel"
    That's called subjectivity lll

  • @fishfire_2999
    @fishfire_2999 3 ปีที่แล้ว +8

    Python and java is all you need to manifest a Lamborghini

  • @frikkied2638
    @frikkied2638 2 ปีที่แล้ว

    Such a nice bloke

  • @jerryplayz101
    @jerryplayz101 3 ปีที่แล้ว +4

    I prefer python for its both pass by value and reference. For the game I’m making in python, I use the fact that I can have multiple pointers to objects to help pass values dynamically between classes without global variables.

    • @TrevorANNEDENISE
      @TrevorANNEDENISE 2 ปีที่แล้ว +3

      You can also do this in Swift though, it's just that it encourages the use of value types where it makes sense, but when you actually need shared values you still have solutions for it (for example classes and actors are reference types).

    • @deerlow1851
      @deerlow1851 2 ปีที่แล้ว

      I think that this is actually a bad thing, i prefer Java because it forces you to work around this, making your code cleaner, more readable, and faster. Harder though but not really, because it's actually easier in the long run

  • @madsteeez
    @madsteeez 3 ปีที่แล้ว +4

    Whenever I hear about these fancy features of some fancy language, I think: matlab can do that..

    • @catcherboy96
      @catcherboy96 3 ปีที่แล้ว +1

      Mat lab is the best calculator

  • @jamesnankervis8029
    @jamesnankervis8029 3 ปีที่แล้ว +2

    Both Swift and F# have value semantics, unlike languages such as C# and Java. He's wrong in saying that immutability means lots of copying. That's not how immutability is implemented in most functional programming languages. His description of what Swift does to implement value semantics is essentially what most functional programming languages do to to get efficient immutability and value semantics. For instance immutable lists and maps in F# are NOT copied when passed as parameters to other functions. Same goes for other data structures.

    • @Art-is-craft
      @Art-is-craft 5 หลายเดือนก่อน

      Most functional languages are simply not suitable for general software engineering.

  • @neiltropolis
    @neiltropolis 3 ปีที่แล้ว +2

    I remember this dude from Galaxy Quest.

    • @ChrisBrowncaptainchris45
      @ChrisBrowncaptainchris45 3 ปีที่แล้ว

      DUDE!!!

    • @BenGras
      @BenGras 3 ปีที่แล้ว +1

      You are our only hope!?

    • @infernofia
      @infernofia 3 ปีที่แล้ว

      Holy crap I was thinking that in my head and thought of posting a comment but here it is

  • @catcherboy96
    @catcherboy96 3 ปีที่แล้ว +2

    I’m a mechanical engineering student just getting introduced to programming languages Like matlab, python, and I think C or something used for arduino. Swift sounds interesting; should I get familiar with for my field or should I focus on what I’m learning rn?

    • @hunggarchristian
      @hunggarchristian 3 ปีที่แล้ว

      As someone who switched from mech to cs. Focus on what you are learning now, as those are the most imperative to what you’ll do in the real world. Swift is basically only used for platform software development most of which you won’t be ever using. Fluids and control systems operate in the strong typed.

  • @buddyguy7175
    @buddyguy7175 3 ปีที่แล้ว +2

    Isn't this the same idea as pass by value or pass by reference in C? I think thsts what im hearing explained here. Do you pass the memory address of what you give to a function or a copy with the same value. Its hard to wrap your head around sometimes because you can pass a variable to a function in C, increment it, but the original variable has not changed because C is a pass by value default language. If you want the function to modify the original variable you pass a pointer to the variable. The pointer is then passed by value and now you have access to the original variable inside the function. I think this is the concept hes talking about.

    • @alexxx4434
      @alexxx4434 3 ปีที่แล้ว +4

      There is an additon in Swift apparently, which is "copy-on-write". That is, objects are passed by reference, but if a function tries to change an object, the copy is created with those changes instead.

  • @ManthaarJanyaro
    @ManthaarJanyaro 3 ปีที่แล้ว +1

    One should consider making a compiler for python; which will compile python code (obviously optimized) to Machine Language to speed it up...

    • @JaapVersteegh
      @JaapVersteegh 3 ปีที่แล้ว +1

      you mean cython?

    • @ManthaarJanyaro
      @ManthaarJanyaro 3 ปีที่แล้ว

      @championchap back in days when everything was written in Assembly (or preferably in Machine) language Unix proved it that even an OS can be written in a High Level Language like C. And today after 2~3 decades compilers are so good at compiling that they can produce a much better apps than an average programmer. That's why I think that we should be writing programs in much higher level languages and leave it on compilers to optimize them and with feed back loop improve their capabilities (which is now possible with A.I. and Machine learning).

    • @ekremdincel1505
      @ekremdincel1505 3 ปีที่แล้ว

      You need a runtime for the python to make it work.

  • @Havsnsnd
    @Havsnsnd ปีที่แล้ว

    Five seconds in, “pythons not great at building libraries because C” 😂😂😂

    • @Art-is-craft
      @Art-is-craft 5 หลายเดือนก่อน +1

      It is the main reason why Python is not an industry standard for software engineering.

  • @johnjoyce
    @johnjoyce 3 ปีที่แล้ว +2

    Chris is ever the indefatigable pragmatist!

  • @jerry8405
    @jerry8405 3 หลายเดือนก่อน

    Was just wondering how swift handles this and TH-cam algo came up with this video. I didn’t know the exact terms to search for lol

  • @mrmillburnt
    @mrmillburnt หลายเดือนก่อน +1

    Thumbs up for value semantics

  • @DeadtomGCthe2nd
    @DeadtomGCthe2nd 3 ปีที่แล้ว +51

    Wow, this is a smart programmer who talks sense.

    • @R3negade638
      @R3negade638 3 ปีที่แล้ว +2

      He’s a legend in the programming world.

    • @mccallionr
      @mccallionr 3 ปีที่แล้ว +6

      He invented Swift (coded the POC himself), but maybe more importantly, he invented (and created the POC) of LLVM, the compiler framework that Go, Swift, Rust, Julia (and more) are all built on top of. He enabled the current generation of programming languages. His knowledge of LLVM is invaluable.

  • @sharinganuser1539
    @sharinganuser1539 3 ปีที่แล้ว +3

    Not particularly a fan of python...but also not convinced by functionality of swift....it certainly is elegant...very clear...as language.....So if u can get things done by using one set of tools...why do u switch to new tools...for doing same task...unless....there is huge performance difference...or some added abilities....

    • @adsick_ua
      @adsick_ua 3 ปีที่แล้ว

      You're god damn right

  • @ucmasshankar
    @ucmasshankar 3 ปีที่แล้ว +2

    I love swift

  • @slob5041
    @slob5041 7 หลายเดือนก่อน

    Thank you Lex... Also thank you for calling out the BS indirectly!! As an engineer they're pretty much like politicians because we're not allowed to say no, just that things could theoretically happen.

  • @sacredgeometry
    @sacredgeometry 2 ปีที่แล้ว

    also 3:59 if people are doing work and havent learned about value/ reference types or pointers which is day 1 programming 101 basic stuff then they should probably not be.

  • @CristiNeagu
    @CristiNeagu 3 ปีที่แล้ว +2

    The thing that really annoys me about Python is that you can't really compile it.

  • @techobsessed1
    @techobsessed1 3 ปีที่แล้ว +1

    Who is choosing Swift for things that they'd choose Python + C for if Swift didn't exist?

  • @gandalfgrey91
    @gandalfgrey91 2 ปีที่แล้ว

    8:05 is he talking about Singletons?

  • @ChadZeluff
    @ChadZeluff 3 ปีที่แล้ว

    For someone curious about defining these in Swift: define the thing as a ‘struct’ to get value semantics, and a ‘class’ for reference semantics.

  • @Alex-xf8pl
    @Alex-xf8pl 3 ปีที่แล้ว

    Scala

  • @erickbarbosa5476
    @erickbarbosa5476 3 ปีที่แล้ว +1

    Swift fan boy here

  • @yashwanth.k5545
    @yashwanth.k5545 3 ปีที่แล้ว +1

    hat kirkirii 🔥🔥

  • @fishfire_2999
    @fishfire_2999 3 ปีที่แล้ว

    2:50 i know exactly what they r talking about.

  • @RM-di6oe
    @RM-di6oe 3 ปีที่แล้ว +3

    Swift Rocks

  • @wow5heyy
    @wow5heyy 3 ปีที่แล้ว +1

    I am superrr new to programming. Are they talking about "pass by reference" vs "pass by value" ?

  • @sacredgeometry
    @sacredgeometry 2 ปีที่แล้ว

    Chris is so likeable and although I mostly agree with him so that might be bias.

  • @arianvc8239
    @arianvc8239 3 ปีที่แล้ว +26

    Coming from a C and Linux background, Python feels like a natural evolution. Swift feels weird, kind of like JS does.

    • @arianvc8239
      @arianvc8239 2 ปีที่แล้ว +1

      @Balaji Thiruvengadasamy I don't mean to troll but I'm guessing you are using Python wrong. If you want numerical performance you can embed C/CUDA code or use related libs. If you make applications learn to scale.

  • @PierLim
    @PierLim 3 ปีที่แล้ว +2

    Has swift gone out of the Apple ecosystem yet? I think the real problem for swift adoption outside of Apple is their priorities

  • @nickskywalker2568
    @nickskywalker2568 3 ปีที่แล้ว +6

    Swift vs Julia?

    • @Ureallydontknow
      @Ureallydontknow 3 ปีที่แล้ว

      No comparison. Julia is extremely domain specific for linear algebra.

  • @sergiobost4891
    @sergiobost4891 ปีที่แล้ว

    4:10 Enter Rust

  • @alexshaykevich509
    @alexshaykevich509 3 ปีที่แล้ว +20

    I know it's his baby but does he know what Apple is actually doing with/to it? Let's put to bed the idea that anyone outside of iOS is actually using it seriously, that's a non-starter. In the iOS environment, it's turning into a monstrosity with a new paradigm introduced every other week, MVC, MVVM, SwiftUI. There is no sign that Swift can or will outgrow the very limited iOS ecosystem and even that will be cannibalised by Flutter as a reaction to the overstuffed verbosity of the other mobile languages. It's also strange that in the same train of thought that he suggests C has to do the heavy lifting for Python, he goes on a big tear about the need to pass by value. One of the major reasons everyone always ultimately reverts back to C/C++ for performance is the ability to engineer efficient memory use and speed through proper management of references, specifically opposite of the paradigm Swift is pushing. Jeremy Howard was on a little while ago namedropping Swift as a poor language for computation which is why he was sticking with Python. Even in iOS, most of the heavy lifting is still managed at the C/assembly layer.

    • @alexshaykevich509
      @alexshaykevich509 3 ปีที่แล้ว +1

      What about it do you find great?

    • @alexshaykevich509
      @alexshaykevich509 3 ปีที่แล้ว

      @@playea123 Ok. But it just sounds like it's a language with support for a framework you need. Frankly, I think people make far too big a deal of languages when in fact, it's the environment (mobile, web, etc...) or frameworks they are actually interested in. As you eluded, you could likely do just as well in Java, and some of us prefer more verbose, often clearer code. But then Java doesn't have as natural a bridge to M/L, so Python or Swift are better choices for that use case.

    • @farrellraafi1301
      @farrellraafi1301 3 ปีที่แล้ว +2

      @@alexshaykevich509 if someone considers Swift slow for computation why would they choose a gazillion times slower language named python as a better alternative??

    • @alexshaykevich509
      @alexshaykevich509 3 ปีที่แล้ว

      @@playea123 You're assuming all else being equal. If you prefer Java, but have to write an iOS app, you won't be writing Java.

    • @alexshaykevich509
      @alexshaykevich509 3 ปีที่แล้ว +3

      @@farrellraafi1301 Simple, because for heavy lifting tasks, as the video points out, the heavy lifting has been abstracted out to C/C++ and CUDA. So FRAMEWORKS, have made Python a good choice for computationally intensive tasks.

  • @RoboticusMusic
    @RoboticusMusic 3 ปีที่แล้ว +1

    This is why "learning to code" is not meant to be taken literally. You should learn how to bypass having to use code as much as possible hahah

  • @a0um
    @a0um ปีที่แล้ว

    Clojure is another language with value semantics.

  • @logusgraphics
    @logusgraphics 3 ปีที่แล้ว +23

    “Actually good design is something we can feel”. And that’s why Steve Jobs was right since the beginning and Apple is most valuable. Developer experience is of most importance. When it feels good, you build better products.

    • @chiboreache
      @chiboreache 3 ปีที่แล้ว +3

      oh that's why iOS is the worsets platform for developers..

  • @myronwoods40
    @myronwoods40 ปีที่แล้ว

    Looks like a young Bill Belichick

  • @__hannibaalbarca__
    @__hannibaalbarca__ 3 หลายเดือนก่อน

    I start programming in swift not because is good language, only because i want to make something in iOS and MacOS, but
    __there nothing like C and C++__

  • @souslicer
    @souslicer 3 ปีที่แล้ว +1

    Just use const. Value semantics are inefficient

  • @ketuscorpion3717
    @ketuscorpion3717 3 ปีที่แล้ว +2

    #Lex is a drug, I am getting addicted bro👍

    • @Ryan-xq3kl
      @Ryan-xq3kl 3 ปีที่แล้ว

      you may want to check yourself into rehab

  • @losthighway4840
    @losthighway4840 ปีที่แล้ว

    Not sure there’s much difference really. You need to decide in both languages whether you’re using value/reference semantics. In python this is just done his clone().

  • @lescobrandon2202
    @lescobrandon2202 2 ปีที่แล้ว +2

    Python is kids language.

  • @prashkd7684
    @prashkd7684 3 ปีที่แล้ว

    The entire language performance discussion is in reference to current CPU technology but if Intel manages to perfect quantum processors and someone like Microsoft manages to build home computers out of it, will performance still be of any concern at all? Wouldn't it make sense for all programmers to build on C and Python rather then learning 10 different languages for different applications in the market?

  • @stabkauaiPALAMA
    @stabkauaiPALAMA 3 ปีที่แล้ว +1

    Andrew Madsen is the Swift God.

  • @yukostiuk
    @yukostiuk 3 ปีที่แล้ว

    Go is the best;)))

  • @zeeeeeeeeeavs
    @zeeeeeeeeeavs 3 ปีที่แล้ว +2

    Love Swift!

  • @dr.hunter1092
    @dr.hunter1092 ปีที่แล้ว

    Hey Lex, new programmer here. One mistake I can easily point out in this conversation is you both have an Aquafina water. Please fix in the next update

  • @devnekoboi7812
    @devnekoboi7812 3 ปีที่แล้ว +4

    Two words: Functional Programming ;)

  • @birendrakathariya3517
    @birendrakathariya3517 3 ปีที่แล้ว +1

    Julia may be a better choice!!

    • @adsick_ua
      @adsick_ua 3 ปีที่แล้ว

      Finally found Julia comment)

  • @noomade
    @noomade 3 ปีที่แล้ว +9

    This is basically a really good example of why Rust is good....

    • @tsunghan_yu
      @tsunghan_yu 3 ปีที่แล้ว

      Could you elaborate?

    • @ekremdincel1505
      @ekremdincel1505 3 ปีที่แล้ว +1

      @@tsunghan_yu rust has a borrow checker which prevents all those bad things about mutability on compile time and makes the mutability very explicit in your code. You also don't need clone on write because of that, but the standart library gives you this functionality via the generic "Cow" type (stands for "clone on write") . In rust, you are choicing whether to pass the value or reference *in the call site* explicitly. There is also copy semantics which allows implicit copying of cheap things like integers. And you can always explicitly deep copy (clone) almost any type if you want.

  • @paul_e123
    @paul_e123 2 ปีที่แล้ว +2

    Didn’t realise graham stephan knew so much about programming

  • @TheRealDrWho
    @TheRealDrWho 3 ปีที่แล้ว +1

    Lex's IQ is so high, love watching this guy

  • @davidchopin6583
    @davidchopin6583 3 ปีที่แล้ว

    This is such a random comparison lol

  • @mcoon1987
    @mcoon1987 2 หลายเดือนก่อน

    This is like nerd wars lol.

  • @igordemetriusalencar5861
    @igordemetriusalencar5861 3 ปีที่แล้ว +3

    Julia is better than both.

    • @Art-is-craft
      @Art-is-craft 5 หลายเดือนก่อน

      Julia will never be a software engineering language and will just be an academic tool.

  • @JkyLi
    @JkyLi 3 ปีที่แล้ว +1

    The thing that swift really bothers me is the discouragement of using pointer. It is so often that something can be done easily with some usage of pointers at the very low level of the structure. But in swift, not only do you have to declare it as UnsafePointer, the usage is pretty disconnecting from the other swift codes. So I would rather go back to objc for some really low-level staffs.

    • @ConernicusRex
      @ConernicusRex 3 ปีที่แล้ว

      So you're trying to write code for 1980 in a language written in 2013. Gotcha.

  • @steelyburt
    @steelyburt 3 ปีที่แล้ว +1

    Total beginner here. Former Art Student. Craving rules and objectivity. Angry at subjectivity. Starting my coding journey, upon recommendation from a friend, with Swift Playgrounds. Pretty much everything in this video going over my head 🤷‍♂️

  • @TestTest-tj9io
    @TestTest-tj9io 3 ปีที่แล้ว +1

    I never understood phyton popularity in intense projects, and i would never indulge in apple stuff.

    • @mattizzle81
      @mattizzle81 2 ปีที่แล้ว

      I used to be very anti-Apple but recently have gone over to the dark side. Their stuff is really good and I really enjoy programming on their platform. Their tight software/hardware integration has advantages. Apple doesn’t half ass things, they get it done right. Google etc have had so many half-hearted or abandoned projects like ARCore as their “response” to Apple’s ARKit. It’s half baked and now almost abandoned while Apple did it right.

    • @Art-is-craft
      @Art-is-craft 5 หลายเดือนก่อน

      @@mattizzle81
      The biggest problem google has it is a back end company that has its hands in to many pies.

  • @adsick_ua
    @adsick_ua 3 ปีที่แล้ว +2

    Julia is better for ML and data science

  • @SevenDeMagnus
    @SevenDeMagnus ปีที่แล้ว

    Coolness, Apple I think should be the one so the best is Swift coz' they will support it and Apple product is the future (also Tesla if Elon makes smartphones and computers).
    God bles..

  • @Ureallydontknow
    @Ureallydontknow 3 ปีที่แล้ว +2

    I am surprised lex doesn't already know this coming from MIT specializing in python AI.

    • @Art-is-craft
      @Art-is-craft 5 หลายเดือนก่อน

      Lex is trying to keep the topic manageable and to not get too technical.

  • @anb4351
    @anb4351 3 ปีที่แล้ว +2

    python is overrate