4 ms·
I love the idea of Swift for Tensorflow : powerful automatic differentiation and a solid type system in a single language. That's something that is not seen els
by nestorD 7y ago
I love the idea of Swift for Tensorflow : powerful automatic differentiation and a solid type system in a single language.
That's something that is not seen elsewhere and that would make it a perfect fit to write deep learning code targeting production systems.
Now the language needs two things in order to be safe from an hypothetical abandon from Google :
- running smoothly on linux (I though it was already there but your post seem to imply that it is not the case)
- getting the auto-diff out of the alpha stage where people can build framework on top of it (fastai seem to be ready to jump on that ball which is nice)
- pjmlp 7y agoHere, https://swift.org/getting-started/#using-the-repl https://swift.org/getting-started/#using-the-repl > On macOS 1> import Darwin 2> arc4random_uniform(10) $R0: UInt32 = 4 > On Linux 1> import Glibc 2> random() % 10 $R0: Int32 = 4 Any of the languages that Swift is competing against, doesn't need to have OS specific imports for basic stuff.
- zer0zzz 7y agoDude you’re literally illustrating Swifts strength here. The whole point is to have a safe easy to use language that reuses existing system libraries.
- pjmlp 7y agoAny mainstream programming language can do that.
- coldtea 7y agoFew as elegant, as safe, or as performant combined...
- pjmlp 7y agoDelphi, D, .NET, Eiffel, Ada, Rust, Nim. And lets not put Swift and performance on the same sentence, they still need to catch up a bit. https://github.com/ixy-languages/ixy-languages https://github.com/ixy-languages/ixy-languages
- coldtea 7y agoWhat is this, a cabinet of curiosities? Aside from .NET and Rust, all the others are not players in 2020.
- pjmlp 7y agoAh, that might be the reason why NVidia is adopting Ada for their firmware, ebay and Netflix decided to use D for some of their projects, the Turkish government decided to invest into Delphi for their education system,... By the way, it is a list of languages with compilers that currently outperform Swift.
- coldtea 7y ago>Ah, that might be the reason why NVidia is adopting Ada for their firmware, ebay A, the "some part of some huge player with 2000 divisions uses some otherwise niche language, surely said language is making a comeback" argument. You can find all kinds of niche/sidestepped languages if you look hard enough on any organization that has 200 products, 1000 inside projects, and tons of engineers. Doesn't mean said languages are making a comeback anytime soon. For languages that actually thrive nobody needs to enumerate major and minor projects where they're used, because they're too many to mention. But when the main news for "Planet language X" is "big corp decided to use X for something among the 100s things they do", well, they need all the straws they can grasp. Same way Latin remains a dead language whether some Oxford professor recently published a book of new poems he wrote in it or not...
- zer0zzz 7y agoNot many use an actual c/c++ compiler (clang) to generate language native calling convention wrappers for calling into C/ObjC code (not sure how well c++ interop works these days).
- slavapestov 7y agoSwift 4.2 (2018) introduced a cross platform random number API. (0..<10).randomElement()
- pjmlp 7y agoYet they didn't bother to update the example on the introduction to Swift. There are plenty of other examples I can look for, like file handling.
- slavapestov 7y agoFile handling can be done using Foundation, which I believe has API parity between Darwin and Linux at least. I think the point of the example was to demonstrate importing platform-specific modules, not random number generation per se. But you're right, it should probably be updated to do something else.
- coldtea 7y ago>Yet they didn't bother to update the example on the introduction to Swift. There are widely popular FOSS languages with much much less documentation...
- OkGoDoIt 7y agoBut for context, the previous sentence on that page is: “You can also import any available system modules, such as Darwin on macOS and Glibc on Linux” The random number examples aren’t saying that’s the right way to generate random numbers in a platform-independent way, it is specifically demonstrating how to import system libraries on your local platform.
- asveikau 7y agoHaving distinct Darwin or Glibc imports seems a little crazy for these examples. When you code in c, libc is just there. It has minor variations from platform to platform, but you always think of it as libc. (Even if Darwin calls it libsystem etc. Or if Microsoft's is mscvrt and it kind of sucks.) It would be more reasonable to call it libc. (If I run on BSD do I still call it "glibc" with no actual GNU present? And if the arc4random APIs present in libc there look a lot like Darwin's because they actually share code? Maybe they have not considered porting to non-linux?) Basically they set a portability boundary in the wrong place.
- mark_l_watson 7y agofor what it is worth: a few days ago I installed the latest Swift and TensorFlow in Swift on both my little MacBook and my Linux laptop (1070 GPU, i7, fast laptop). I had to manually set LD_LOAD_PATH on macOS, but then everything worked on macOS and Linux.