Live data from Hacker News

Why Swift for TensorFlow?

github.com

121–130 of 151 posts

Re: Why Swift for TensorFlow?

#121

I wonder what this means for iOS apps themselves

At the moment not much. Swift for TensorFlow is a fork of the language, with language-level support for some features which are useful for data science, for instance automatic differentiation and dynamically-callable objects.

Some of those features are making their way into the main branch, but at the moment you could not import the TensorFlow library into an iOS project and use it. Swift for TensorFlow needs to be built using a separate toolchain.

Re: Why Swift for TensorFlow?

#123
post #90

Earlier quoted context omitted.

I feel like GraalVM has a chance to solve some of this at least. I wonder if anyone will make an Octave GraalVM frontend, they already have one for R.

Isn't Graal an Oracle thing? I don't understand why anyone would want to touch that even with a 10-foot pole.

Yeah, I would tend to agree. If Google successfully appeals Oracle's suit against them for implementing Java, I might consider using it in a product, but Oracle makes it legally risky to use any of their products.

Re: Why Swift for TensorFlow?

#124
post #22

I can imagine swift really taking off in this space. It’s going to be a battle between Julia and Swift for who does the best automatic differentiation.

Google would need to make Swift a first class citzen on Windows, currently Julia is winning.

That's one of the outcomes I am hoping for in this. I would love for Swift to be a first-class language.

I believe the Swift for TensorFlow team is currently hiring for this.

Re: Why Swift for TensorFlow?

#125
post #100

Earlier quoted context omitted.

Ubuntu is supported (see https://swift.org/download/ ), but Windows is pretty early I think. See https://github.com/apple/swift/blob/master/docs/Windows.md and https://forums.swift.org/t/windows-nightlies/19174 for more info.

Ubuntu is "supported". The compiler might be available, but there are hardly many libraries available that would compile outside Apple platforms.

That's no longer true. The Foundation framework is basically complete on Linux, and the vast majority 3rd party libraries which are not iOS specific will work on Ubuntu. Even many of Apple's own libraries (i.e. SwiftNIO, a low-level, high performance networking library for things like implementing web-servers) are cross-platform.

Re: Why Swift for TensorFlow?

#126
post #125
post #100

Earlier quoted context omitted.

Ubuntu is "supported". The compiler might be available, but there are hardly many libraries available that would compile outside Apple platforms.

That's no longer true. The Foundation framework is basically complete on Linux, and the vast majority 3rd party libraries which are not iOS specific will work on Ubuntu. Even many of Apple's own libraries (i.e. SwiftNIO, a low-level, high performance networking library for things like implementing web-servers) are cross-platform.

Last time I checked, the "the vast majority 3rd party libraries which are not iOS specific" was actually quite tiny.

Re: Why Swift for TensorFlow?

#127

Earlier quoted context omitted.

From the article: We believe that Rust supports all the ingredients necessary to implement the techniques in this paper: it has a strong static side, and its traits system supports zero-cost abstractions which can be provably eliminated by the compiler. It has a great pointer aliasing model, a suitable mid-level IR, a vibrant and engaging community, and a great open language evolution process. A concern with using Ru…

As I pointed out in two lengthy comments on day one[1][2], that reasoning is nonsense. If Chris wants to use the language he created in this new endeavor for machine learning simply because he made it , that's totally fine and completely his prerogative, but he should just say so, rather than trying (and failing) to convince people that other languages aren't better suited for this task. From my point of view, a weak…

> If Chris wants to use the language he created in this new endeavor for machine learning simply because he made it, that's totally fine and completely his prerogative, but he should just say so, rather than trying (and failing) to convince people that other languages aren't better suited for this task.

Do you have any insider knowledge that Chris Lattner had the unilateral power to choose Swift for this project? I would imagine with the importance of TensorFlow at Google, the decision to go in this direction had to be agreed on by a number of people.

> The learning curve of Rust should not be relevant here, compared to Swift, which is also full of idiosyncrasies. Swift and Rust both have a large learning curve for someone coming from Python.

How exactly would Rust-Python interoperability work? Swift for Tensor Flow allows any python library to be called like a native library in Swift. Could you do that in Rust?

Re: Why Swift for TensorFlow?

#128

Earlier quoted context omitted.

More to the point static typing is just not that important for data scientists. Arguably it's not that important for backends devs either (e.g. lisp, erlang).

Should be prefaced with, "I think". Having done user research on this by speaking to data scientists, I can say that static typing is desired by a nonzero number of who practice what we would consider to be data science and machine learning. Much like how TypeScript is seen as a revelation to hordes of JavaScript programmers who have never used static types before, the ability to get some level of correctness verific…

The more time I spend with strongly typed languages the more I am convinced it is the right way to go. For modern languages with good type inference, and good tools for protocols/interfaces not tied to an inheritance hierarchy, it is a at worst minor inconvenience for a huge benefit.

Re: Why Swift for TensorFlow?

#129
post #113
post #105

Earlier quoted context omitted.

On the other hand, Julia can do the right thing dynamically . Your matrix happens to be symmetric? Julia will chose an appropriate factorisation and will propagate that knowledge through dynamic dispatch.

"Automagical" solutions tend to work until they don't. I would much rather have my solution be provably correct at compilation time than to depend on high-overhead runtime systems.

You don't know what you're talking about.

Re: Why Swift for TensorFlow?

#130
post #126
post #125

Earlier quoted context omitted.

That's no longer true. The Foundation framework is basically complete on Linux, and the vast majority 3rd party libraries which are not iOS specific will work on Ubuntu. Even many of Apple's own libraries (i.e. SwiftNIO, a low-level, high performance networking library for things like implementing web-servers) are cross-platform.

Last time I checked, the "the vast majority 3rd party libraries which are not iOS specific" was actually quite tiny.

You'd be surprised. There are a few reasonably well developed server-side frameworks, some of which are already used in production various places.

Also a lot of the libraries which are mostly used in iOS don't have any dependancies on the iOS platform: for instance promise or event emitter implementations etc.

IBM is actually supporting a number of open-source swift projects as well: https://github.com/IBM-Swift.

Between that and painless interop with C/C++, Swift does not feel under-supported on Linux in the least.

Post reply on HN