Swift as a Numerical Computations Language

Recently I’ve seen Jeremy’s post about using Swift as a modern compiled language for numerical computations. I’ve started playing with swift a couple years ago, mostly for iOS development, and I agree that the language has a lot of awesome traits. I was very impressed when started using it, and every once in a while I am checking if there are any new libraries and frameworks for numerical computations and deep learning in this language. A great language with a bunch of cool toolsets and IDEs definitely deserves one’s attention.

So I wonder if anyone here uses this language for “general-purpose” development? I mean, writing web apps, console tools, etc. I would be happy to know about your experience and learning sources. There are plenty of tutorials about iOS/macOS development but probably not so many information about “plain” Swift coding.

Have anybody used Surge or maybe directly played with Accelerate? Am I right that idea behind BaseMath package from the aforementioned post is to implement numerical operations directly in Swift instead of building wrappers on top of C libraries?

I would like to use this language as a high-performance but still an easy-to-use alternative to C/C++ development (which makes me feel sad :smile:) Would be glad to know about your experience.

1 Like

i have used xamarin (c#) for IOS android. Xamarin is now part of visual studio code

Yeah, that’s correct, but I would like to know more about native Swift development and not iOS development per se :slight_smile:

Also, I am quite interested in Metal though don’t know too much about this language. Is it something compatible with CUDA? In terms of performance and capabilities?

metal, opengl and cuda are not comptable.

here is a good starting point: https://developer.apple.com/machine-learning/

Yes, correct. However, for the sake of clarity, here is more thorough explanation of my question :slight_smile:

I would like to know more about experience of people who use the Swift language in the field, outside Apple’s platforms and UI-driven apps. I know about CoreML framework but it is not a part of Swift language. So I wonder if somebody tried to write numerical computations using Swift/Metal, as one would do with C++/CUDA.

One day I would like to use Swift as a cross-platform language for things outside of Apple’s ecosystem. I know the language is already open-sourced, and LLVM is great. And, there are already a lot of web frameworks running on Linux machines driven by Swift. So I imagine that one day this language​ could become a great alternative for other compiled languages used for high-performant and time-critical computations.

1 Like