11 ms·
Swift Numerics
- jph00 7y agoYou may find this article I wrote useful background for understanding the capabilities of numerical computing in Swift, including details about a library which provides features overlapping with the new Swift package: https://www.fast.ai/2019/01/10/swift-numerics/ https://www.fast.ai/2019/01/10/swift-numerics/
- Cybiote 7y agoThanks, it is a well written article. The only part which tarnishes an otherwise excellent article is the language comparisons portion. Such things are best avoided as they almost always reflect the biases of or where the author has the most experience. As you acknowledge, you were unfair to Julia. Julia has excellent support for general purpose programming. It has support for multiple dispatch, a quite powerful organizational construct rarely found in other languages, for example. Where it might fall short is in the number of general purpose libraries but that shouldn’t matter as much for ML. It certainly isn’t lacking for numeric libraries. For Java, it’s unclear what you mean by JVM issues but with GraalVM and Scala or Kotlin, I fail to identify any major issues. F# on .net core can be distributed without installing a runtime nor does garbage collection limit its expressiveness. It is among the fastest, in the Go/Java/Ocaml/Swift tier, which is next fastest after C/C++/Rust/Fortran. Compare https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/fsharpcore-java.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... to https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/swift.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/.... Setting aside the problems of microbenchmarks and unidiomatic code, they’re both within spitting distance of each other, both wining and losing with no significant margin. Their runtime also recently introduced SIMD and fine-grained memory management support. I'd say practically speaking, Swift's current great weakness is its cross platform support, when compared to Julia, Kotlin/Scala or C#/F#. Swift is an excellent language and it’s great a numeric programming ecosystem is being built for it. There’s no need to justify its existence by misrepresenting or downplaying the capabilities of competing ecosystems. I also saw this occur for why differentiable programming in Swift and not Julia. The more the merrier, I say. Let the various communities collaborate and share ideas in order to better explore the space of possibilities and ideas.
- throwlaplace 7y ago>F# on .net core can be distributed without installing a runtime how?
- Cybiote 7y agoBy bundling. I believe there are couple a options to reduce the resulting package size some. As with all things, it's a matter of priorities when weighing language and deployment options.
- ZeroCool2u 7y agoOn paper F# seems pretty great. Unfortunately, in practice it was the first and so far the only language I've ever used that I never found myself enjoying. I wrote a simple, but relatively robust toy language interpreter in it, so the time I put in wasn't trivial and I kept thinking it would get better, but no such luck. This is just my anecdotal experience though, I know some companies have been wildly successful with F# as the technical foundation for their entire platform. Jet is a great example of one such company.
- Cybiote 7y agoCertainly, not every language will fit everyone's preferred style of thinking and approach to breaking down problems. This is why I think a diversity in available options is so useful.
- zelly 7y ago> JVM issues stop the world GC (my car ran you over because of a random unpredictable pause!) its bytecode is object-oriented impossible at the moment to do CUDA style GPU programming without horrible JNI calls > F# on .net core can be distributed without installing a runtime nor does garbage collection limit its expressiveness F# has two big crippling factors: (1) the .NET at the end of its name and (2) functional programming, which is a huge barrier for 99% of developers (and it's not functional enough for the other 1%). F# is dead in the water--I mean that respectfully. To replace Python for deep learning, you need a language that other people will actually use, not should.
- coldcode 7y agoReally looking forward to ShapedArray. Eventually a lot of what one might do with Python may be available in Swift.
- xvilka 7y agoYou can already use Julia language for more "native" experience and more computational syntax.
- wnissen 7y agoI am also happy to see that sometime in the last several years slices of arrays became views rather than copies. https://developer.apple.com/documentation/swift/arrayslice https://developer.apple.com/documentation/swift/arrayslice
- ericlewis 7y agoYes, and it makes working with Data so fast and easy.
- artfulhippo 7y agoAwesome. Now who wants to make a hypercomplex numbers library (quaternions, Clifford, Cayley-Dixon...) in Swift?
- bsder 7y agoPersonally, I'd rather get the Swift equivalent of java.util.concurrent.
- vyshane 7y agoHow about the equivalent of RxJava instead: https://developer.apple.com/documentation/combine https://developer.apple.com/documentation/combine Unfortunately not available on Linux, so server side is out :(
- mbroncano 7y agoThere’s an open source implementation that can be worth exploring: https://github.com/broadwaylamb/OpenCombine https://github.com/broadwaylamb/OpenCombine
- zelly 7y agoDoes anyone use Swift (in production) for backend services not related at all to the Apple ecosystem? It seems like a better Golang to me, but the tooling space only targets Apple stuff.
- todd3834 7y agoI recently tried to use Swift for a UDP server that was meant to run on Linux. I quickly realized the Network Framework is for iOS/MacOS/iPadOS only. I ended up using Go and I'm happy with it. I really wanted to do full stack Swift though. Just so I could become better at the language.
- favorited 7y agoHonestly that's no different than realizing that AVFoundation or CoreGraphics is Apple-platform-only... Network.framework is an Objective-C framework (I'm honestly surprised I don't seen any C++ symbols in the binary) – it was never supposed to be a cross-platform framework. SwiftNIO is the official base of the OSS Swift cross-platform networking toolchain. It's the equivalent of Java's Jetty package.
- deleted 7y ago[deleted]
- manojlds 7y agoThere's a lot of work being done to make Swift a good choice for ML. TensorFlow for Swift for example - https://www.tensorflow.org/swift https://www.tensorflow.org/swift
- xvilka 7y agoI wonder what it can offer vs Julia language for HPC.