Live data from Hacker News

Why Swift for TensorFlow?

github.com

51–60 of 151 posts

Re: Why Swift for TensorFlow?

#51
post #29

It's interesting how it's going to play out. On one hand side, Swift is a pleasant language to work with (despite its infancy). But on the other, having a Tensorflow API doesn't suddenly give it a bunch of libraries for statistics, comp. vision, modeling, visualisation, etc. that Python/R/Julia cough MATLAB cough have. Nowadays, it's difficult enough to convince people to drop e.g. MATLAB for R or Python for Julia (l…

Swift is a nice language but its reliance on reference counting means you have to work a lot harder to avoid retain cycles than you do in a garbage collected language.

That might have been the right choice for Apple’s uses of Swift where GC pauses affect the user experience but for most other use cases it’s too much of a cognitive burden IMO.

Re: Why Swift for TensorFlow?

#52
post #44

Earlier quoted context omitted.

It looks pretty straightforward, see the Linux section of https://swift.org/download/#using-downloads

Yeah, going through two screenfuls of text every time I want to upgrade is not "straightforward".

Sorry, I just didn't want to give people the impression that it's more difficult than other languages. To upgrade you'd just have to remove the original install directory and untar the new release.

I'm not familiar with Snap, but I did find https://snapcraft.io/swift

Also, upgrading will be less common than Rust since almost everyone uses the latest release/toolchain. There's not really a reason to use the daily builds unless you're contributing to the Swift project.

Re: Why Swift for TensorFlow?

#53

I feel bad for the Julia community. They must be sad that they didn't get picked over Swift.

I don't think it's over yet really. Tensorflow might be moving their code base to Swift, but there's other frameworks and TF isn't the be-all-and-end-all of ML frameworks. Having used it, I'd really hope it isn't, because it's incredibly painful to use. I'm personally excited for the likes of Julia's Flux framework to get a bit more production ready, I think that's got serious legs.

I particularly enjoy that Flux.jl is an AD framework and a couple lines of Julia code defining convenience functions for ML, and it is all written in Julia so it invites exploration.

Tim Besard gave a talk at a Tensorflow meetup recently that walked through the Julia stack (GPU&ML) that I would highly recommend: https://docs.google.com/presentation/d/1y93Kg8ZizvabKAGs-zmA...

Re: Why Swift for TensorFlow?

#54
Julia would have been a much better and more cost effective choice in my opinion.

It's a superior platform to on which develop this sort of thing, and further along at that. Also easier to use.

Re: Why Swift for TensorFlow?

#55

Why not Rust? Edit: I wonder if Swift could be replaced with Rust for iOS development?

Chris Latner is the driving technical force behind the project and he wrote Swift. So they were able to fix any issues with Swift so the trade study was “unfair” in that regards.

Re: Why Swift for TensorFlow?

#56
post #44

Earlier quoted context omitted.

Yeah, going through two screenfuls of text every time I want to upgrade is not "straightforward".

Sorry, I just didn't want to give people the impression that it's more difficult than other languages. To upgrade you'd just have to remove the original install directory and untar the new release. I'm not familiar with Snap, but I did find https://snapcraft.io/swift Also, upgrading will be less common than Rust since almost everyone uses the latest release/toolchain. There's not really a reason to use the daily buil…

For comparison, for Go, it's "sudo snap refresh go". For Rust it's "rustup update stable". I mean, how hard would it be to properly package this stuff, and why should tens of thousands of users deal with all this manual downloading and unpacking? Assuming, of course, that Swift folks don't deliberately want to make the language unpolular, like Haskell.

Re: Why Swift for TensorFlow?

#57

Well written explanation! I really enjoy Swift but it's not as accessible as some of the other languages mentioned. I have a 2011 Macbook Pro and wanted to use the latest and greatest new Swift features. Unfortunately, my machine is too old to upgrade to Mojave which means I can't download the latest version of xcode, which means no new version of Swift. I'm not mad at Apple in the least bit. I just wish I could use…

FWIW, you can install Xcode 10.1 on High Sierra, and use the Swift.org 5.0 toolchain ( https://swift.org/download/#snapshots ) or build swift from source. You can't ship App Store apps this way, but it works great for experiments.

My machine is too old to upgrade to High Sierra.

Re: Why Swift for TensorFlow?

#58
post #29

It's interesting how it's going to play out. On one hand side, Swift is a pleasant language to work with (despite its infancy). But on the other, having a Tensorflow API doesn't suddenly give it a bunch of libraries for statistics, comp. vision, modeling, visualisation, etc. that Python/R/Julia cough MATLAB cough have. Nowadays, it's difficult enough to convince people to drop e.g. MATLAB for R or Python for Julia (l…

> why on Earth would they pick Swift

Because of iOS?

Re: Why Swift for TensorFlow?

#59
post #29

It's interesting how it's going to play out. On one hand side, Swift is a pleasant language to work with (despite its infancy). But on the other, having a Tensorflow API doesn't suddenly give it a bunch of libraries for statistics, comp. vision, modeling, visualisation, etc. that Python/R/Julia cough MATLAB cough have. Nowadays, it's difficult enough to convince people to drop e.g. MATLAB for R or Python for Julia (l…

Swift is a nice language but its reliance on reference counting means you have to work a lot harder to avoid retain cycles than you do in a garbage collected language. That might have been the right choice for Apple’s uses of Swift where GC pauses affect the user experience but for most other use cases it’s too much of a cognitive burden IMO.

Personally, I find that this only really comes up rarely. Most of the time strong references are fine.

Re: Why Swift for TensorFlow?

#60
post #29

It's interesting how it's going to play out. On one hand side, Swift is a pleasant language to work with (despite its infancy). But on the other, having a Tensorflow API doesn't suddenly give it a bunch of libraries for statistics, comp. vision, modeling, visualisation, etc. that Python/R/Julia cough MATLAB cough have. Nowadays, it's difficult enough to convince people to drop e.g. MATLAB for R or Python for Julia (l…

Julia doesn't tick the "compile to .o/.h" box. As far as I can tell, the use case for AOT Julia is avoiding package compilation overhead, not delivery of standalone code objects. _edit_ seems JuliaC does support this sort of thing: https://juliacomputing.com/blog/2016/02/09/static-julia.html

Julia does already support this kind of thing. Moreover with a minuscule fraction of the money that’s being poured into making Swift usable for data science and machine learning, truly top notch support for generating standalone binaries from Julia could readily be developed. Which is kind of frustrating but what can you do?
Post reply on HN