News for hackers. Stuff that matters.
Re:Swift for TensorFlow Shuts Down by MrPowers on Friday February 12, 2021 @02:40PM (#26117691)
It seemed like Swift looked like a promising language for data science a few years ago. I'm not familiar with Swift. Can anyone provide additional context as to why the language seemed promising for data?
Re:Swift for TensorFlow Shuts Down by SatvikBeri on Friday February 12, 2021 @02:46PM (#26117759)
I disagree with the pitch, but the pitch I heard when this was announced was:

* Swift lets you write code that's as concise as Python while still being fast, and therefore allows you to get away from the problem of having to write ML code in multiple languages (TensorFlow is actually mostly C++, which makes it difficult for a Python developer to debug.)

* That the lack of static typing is a major pain point in Python, and Swift's type system would help write code with fewer errors.

Re:Swift for TensorFlow Shuts Down by ljm on Friday February 12, 2021 @03:14PM (#26118043)
> Swift lets you write code that's as concise as Python while still being fast,

> (TensorFlow is actually mostly C++, which makes it difficult for a Python developer to debug.)

To be honest, if I had to choose between Python and Swift I'd still choose Python. Swift is a nice evolution from Obj-C and all but it is nowhere near as simple as Python, or Ruby, or PHP, or Javascript, or Kotlin. And Apple's documentation of these things is pretty woeful at the best of times lately.

I also disagree with the pitch, is what I'm saying.

Re:Swift for TensorFlow Shuts Down by aplummer on Friday February 12, 2021 @03:30PM (#26118193)
To say that Swift is "nowhere near as simple" as Javascript or Kotlin is a very strange opinion to me, and I have experience with all 3.

Simple as in syntax, memory management, or in what regard? I can't think of a single example where Swift is not equivalent or better. Do you have the same criticism of Scala?

Re:Swift for TensorFlow Shuts Down by ljm on Friday February 12, 2021 @04:30PM (#26118779)
I do. Scala is insanely complicated once you inherit a codebase full of implicits and custom operators.
Re:Swift for TensorFlow Shuts Down by aplummer on Friday February 12, 2021 @05:20PM (#26119199)
If misuse of a language feature is a criticism of the language, I have bad news about javascript.
Re:Swift for TensorFlow Shuts Down by saagarjha on Friday February 12, 2021 @06:39PM (#26119894)
Scala seems to encourage misuse :(
Re:Swift for TensorFlow Shuts Down by The_rationalist on Friday February 12, 2021 @10:36PM (#26121181)
Swift has no traced garbage collector which means you cannot represent circular data structure/references. Also swift support for interfaces (protocol) is sub-par with today standards
Re:Swift for TensorFlow Shuts Down by andrekandre on Saturday February 13, 2021 @04:47AM (#26122559)
> Also swift support for interfaces (protocol) is sub-par with today standards

interesting, what could be added/changed to make it better?

Re:Swift for TensorFlow Shuts Down by The_rationalist on Saturday February 13, 2021 @09:42AM (#26123832)
No support for default implementation methods. No support for generics in protocol.

There might be workarounds but for a newcomer, this is a red flag of reinventing a basic and universal construct (interfaces) in a sub-par one, this show a dangerous mentality from the swift vm devs, what else did they wrongfully reinvent in a sub-par way?

Re:Swift for TensorFlow Shuts Down by aplummer on Saturday February 13, 2021 @02:38PM (#26126078)
As the other commenter pointed out, default implementations (with genetic constraints!) are supported, they actually my favourite swift feature.
Re:Swift for TensorFlow Shuts Down by liuliu on Saturday February 13, 2021 @11:09AM (#26124390)
There is support for default implementation method in protocol for a while now.

Generics are supported through associated types.

Re:Swift for TensorFlow Shuts Down by skohan on Friday February 12, 2021 @03:34PM (#26118248)
I think considering swift as merely an evolution of obj-c is a drastic underestimation. Swift is a very nice language in its own right. Having spent time with most of the languages you've mentioned, while the learning curve might be a bit steeper, I think Swift is much easier to manage a medium or large project with than any of those options with the exception of maybe Kotlin, and personally I find some of the design choices a bit better in Swift than in Kotlin.
Re:Swift for TensorFlow Shuts Down by int_19h on Saturday February 13, 2021 @10:10PM (#26129312)
> TensorFlow is actually mostly C++, which makes it difficult for a Python developer to debug.

I'm curious if you've seen https://docs.microsoft.com/en-us/visualstudio/python/debuggi..., and if so, to what extent it helps with C++/Python interop in TensorFlow context?