I am going to tag this as "off-topic" with hopes that people can steer me in the right direction.
I quickly read through the syntax guide and figured out how to deal with higher order functions, a Functor protocol, simple generics, pattern matching etc. The language looks really fun.
I am curious about folks doing data science with Swift who have come from Python. What libraries are you using to replace numpy, scipy, pandas? Even if they are incomplete. A big deal for me is that they don't depend on Accelerate (on Linux). I found Nifty, but development looks stalled.
Lastly, is anyone thinking about cross-platform implementation of Accelerate. I don't think this is something I could do, but it would be really useful from a usability standpoint. Personally, the vDSP library would be immensely useful.
This would be quite an undertaking. It's not impossible, but (parts of) Accelerate predates OS X; it represents 20+ years of development by a dedicated team. Pieces of it have good open-source analogues: OpenBLAS is pretty mature implementation of the BLAS. The open-source LAPACK project is high-quality, and has C bindings (and here you have a small advantage over Accelerate, which can't take breaking API changes and so is fixed on an older version). FFTW is an option for FFTs if the license is compatible with your projects. Another alternative is Intel's MKL libraries, which are available for multiple platforms.
There are also some pieces of Accelerate, like vImage, that don't have a real open-source analogue and which would be a significant challenge to re-implement.
All of these things have C API, which imports easily, if not idiomatically, into Swift. Defining Swift interfaces for these types of operations is something that a number of people are interested in on the forums here.
You can also fall back on using NumPy via Python imported into Swift; if you're coming from a Python background, that should feel pretty comfortable.
Looking forward, the Swift roadmap for these computational needs should have two complementary pieces:
Define Swift abstractions that let us wrap existing libraries to provide useful functionality in Swift, with approachable interfaces and without unnecessary abstraction costs.
Define the building blocks that allow us to write these types of libraries in Swift itself.
Hi Steve,
This is an off-topic reply to an off-topic thread, but I'm wondering whether you can elaborate on the history of Accelerate that predates OS X. I'm just interested for my own curiosity. I of course understand if it's not possible for you to say more.
Thanks for the detailed explanation,
Dave
Accelerate grew out of vecLib, which originally shipped on Mac OS 9.something. Some of the API defined by the component libraries are much older than that, of course; vDSP evolved from Mercury Systems' SAL, and parts of the BLAS API date back to the 1970s.
let t1 = HalfRadix2CooleyTukey_OutPlace_Benchmark(n) let t2 = HalfRadix2CooleyTukey_InPlace_Benchmark(n) let t3 = RealRadix2CooleyTukey_Benchmark(n) let t4 = vDSP_fft_zropD_Benchmark(n) let t5 = vDSP_fft_zripD_Benchmark(n)
let t1 = Radix2CooleyTukey_OutPlace_Benchmark(n) let t2 = Radix2CooleyTukey_InPlace_Benchmark(n) let t3 = vDSP_fft_zopD_Benchmark(n) let t4 = vDSP_fft_zipD_Benchmark(n)
Earlier tonight I heard that Jupyter has Swift support now (or will in the near future, I don’t recall which). You might be able to do something with that.
I am waiting on a PR for swift for Tensorflow. There is an issue with their Python 3 scripts for setting up swift. But, when that is available it should be useful.