I’ve been programming for decades, though usually for myself, not as a profession. My current go-to language is Python, but I’m thinking of learning either Swift (I’m currently on the Apple ecosystem), or Rust. Which one do you think will be the best in terms of machine learning support in a couple of years and how easy is it to build MacOS/ iOS apps on Rust?

  • mrkite@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Rust is the only language I know of that is actively being used at the kernel level all the way through to the web app level. Compare that with Swift which is not only mostly tied to a single ecosystem, but even the “cross platform” stuff like libdispatch is littered with code like:

    if #available(macOS 10.12, iOS 10.0, tvOS 10.0, watchOS 3.0, *)

  • farcaller@fstab.sh
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    I think Python is still unmatched when it comes to ML, and nothing can beat Swift in terms of Apple ecosystem support. Why not learn both, though? I find Swift a bit harder to reason with than rust, but both have merit (and both have interesting use cases). Just see what uses you will find for them as you progress.

  • 257m@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Other than having first class support on Apple’s hardware Swift dosen’t have much going for it. There is no killer feature in Swift, it dosen’t widespread features and it only has a small niche. If you want to develop for mainly Apple devices I would say go for it as that is the niche it was designed for. Although I see from your post you want to do ML, Python for the high level stuff + C++ for the low level stuff is probably your best pick for that. May I ask what type of ML are you going for? Are you mainly using libraries like Tensorflow, Pytorch etc… or are you into the nitty gritty of building these things yourself and writing the required code for the matrix math and training algorithms.

    • philm@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Swift is a nice language though.

      But I’m obviously on team Rust^^ for various reasons (one being that you can do the whole stack in Rust (not that it’s necessarily the best choice for each level, but it really composes well and with a little bit of trait-magic abstraction in the higher levels it works quite well IME)

      For ML, python yes, certainly for high-level stuff at least currently. I wouldn’t be so sure in the future about the lower stack though, Rust seems to gain momentum there as well (potentially replacing use-cases where currently python is dominant too).

  • dartos@reddthat.com
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    I think rust is good for learning some low level concepts, especially coming from python.

    I don’t think Python is going anywhere in the ML space though.

  • leclownfou@sh.itjust.works
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    If you’re trying to prepare for a couple of years in advance, it might be worth spending a day playing with each language just to see which one feels best to you. Both languages should be able to do anything you want but some things will probably be more difficult in one or the other. I’ve never used swift, but I know rust can have a rather steep learning curve. That may be deterrent enough for some people, but that’s up to you to decide if that struggle is worth it.