TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why data scientists should start learning Swift

55 pointsby Ethcadabout 7 years ago

20 comments

goatloverabout 7 years ago
Why would you use Swift as your new data science language when Julia was made for that purpose and Swift was not? Julia's data structures, functions, syntax and libraries were all designed with scientific computing in mind. Swift was designed for general purpose app development.
评论 #16929448 未加载
评论 #16929416 未加载
评论 #16929103 未加载
评论 #16948102 未加载
curiousgalabout 7 years ago
&gt;engineers need a language that treats machine learning as a “first class citizen”<p>Machine&#x2F;Deep Learning are not some novel application, we&#x27;ve been multiplying matrices since forever.
评论 #16929054 未加载
therealmarvabout 7 years ago
hm, no! data scientist are not using only Tensorflow... in the article libraries like Numpy, Scipy, Pandas are mentioned and swift does not have it or not in that maturity at all. It&#x27;s not only about the beauty of a language, especially for data scientiest it&#x27;s the variety and maturity of third party packages designed for data scientist and Tensorflow is only ONE part. Don&#x27;t get me wrong... swift is beautiful and it is great to have Tensorflow natively running on it for certain scenarios but I don&#x27;t see swift as a bright and good language outside the apple ecosystem (look at C#, great language, still mostly Windows).<p>If you are starting with Python definitely start with Python 3 and you are future safe...
ktpsnsabout 7 years ago
Just to give an example why a &quot;domain specific&quot; language like Julia is more appealing then a &quot;general purpose&quot; language like Swift: I would like to demonstrate this on the old and classy Fortran vs C++ discussion in numerical computing.<p>In Fortran, you can write linear algebra on n-dimensional arrays (similar as in numpy and julia) very compactly, i.e.<p><pre><code> d(i) = TRANSPOSE(MATMUL(B(i,:),c)) </code></pre> Writing something like this in C++ is absolutely possible and elegant with modern templates libraries such as `eigen`. However, the compilation will be slower, the compiler errors will be hard to read and it is hard to beat Fortrans runtime efficiency of such code.<p>But it get&#x27;s more interesting. Think of tensor contractions. This is something where you probably want to implement your own algebra (say for relativistic quantum mechanics or for general relativity) -- or you just stick to the n-dimensional array again and use index-wise loops:<p><pre><code> DO i=1,4 DO j=1,4 DO k=1,4 DO l=1,4 A(i,j) = B(k,l)*C(i,k)*D(l,j) ! note: compe up with better examples END DO END DO END DO END DO </code></pre> I maintain a templated C++ library to write such expressions in one line instead of 4 loops. But contrary to this Fortran code, in order to understand my code, you first have to learn this library. Means you need to learn C++, then the library. In Fortran, it is just Fortran. Nothing more.<p>Believe it or not: Many scientists are no good programmers. Cut-down domain specific languages are perfect to avoid them to loose time on weird compiler features such as &quot;const&quot;, templates and all that overhead which is hard to regain in time.
评论 #16931059 未加载
okketabout 7 years ago
Correct title: Why TensorFlow developers should start learning Swift<p>Why on earth should data scientists ditch the IPython&#x2F;Jupyter&#x2F;SciPy&#x2F;etc. ecosystem?
评论 #16948114 未加载
PeterisPabout 7 years ago
While the author says &quot;Don’t mistake Swift for TensorFlow as a simple wrapper around TensorFlow to make it easier to use on iOS devices.&quot; , the only thing Python is missing from his wishlislist of features is &quot;6. Native execution on mobile&quot;.<p>&quot;7. Performance closer to C&quot; is a non-issue - all the parts where performance matters are going to run on CUDA anyway and there&#x27;s no performance hit there, and very little computing time is spent in the actual python code.
评论 #16929218 未加载
acmecorpsabout 7 years ago
Does Swift have the libraries that Python&#x2F;Matlab has? My wife is doing some kind of fMRI analysis&#x2F;research for her PhD and she&#x27;s using Matlab. I&#x27;m an iOS developer, so I&#x27;d love it if I can get her to use Swift!
评论 #16928921 未加载
评论 #16928998 未加载
评论 #16929293 未加载
评论 #16928993 未加载
diskandar27about 7 years ago
Google just release tensorflow support javascript and swift. I don&#x27;t understand why would somebody go with swift for this, if javascript is the language for the web. with javascript you could not just make a web app but also potentially like almost native app using frameworks. so, where is the use case for swift? probably running on IOT devices? or is swift is faster than javascript?<p>Javascript should just upgraded its syntax to be more swift syntax in the near future, that would be a game changer.
acqqabout 7 years ago
I haven&#x27;t followed the news about Chris Lattner. For those who like me who haven&#x27;t seen that he&#x27;s in Google now:<p><a href="http:&#x2F;&#x2F;nondot.org&#x2F;sabre&#x2F;" rel="nofollow">http:&#x2F;&#x2F;nondot.org&#x2F;sabre&#x2F;</a><p>&quot;I worked for Apple from July 2005 to January 2017, holding a number of different positions over the years&quot; &quot;This included managing the Developer Tools department, which was responsible for Swift Playgrounds for the iPad, Xcode, and Instruments, as well as compilers, debuggers, and related tools. In early 2017, I briefly ran the Tesla Autopilot team. We built a lot of great things, but Tesla wasn&#x27;t the right fit for me.&quot;<p>Joined &quot;Google Brain&quot; in August 2017.<p><a href="https:&#x2F;&#x2F;techcrunch.com&#x2F;2017&#x2F;08&#x2F;14&#x2F;swift-creator-chris-lattner-joins-google-brain-after-tesla-autopilot-stint&#x2F;" rel="nofollow">https:&#x2F;&#x2F;techcrunch.com&#x2F;2017&#x2F;08&#x2F;14&#x2F;swift-creator-chris-lattne...</a>
srikuabout 7 years ago
The end to end application building aspect of python is not yet there with swift (swift for servers?). Also if folks keep sticking to tools well tuned for their jobs, maybe something like graalvm may provide enough interoperability and performance eventually ... in the &quot;good enough is the competitor to the best&quot; sense.
评论 #16929477 未加载
lucas_membraneabout 7 years ago
&gt;&gt; A clean, automated way of compiling code for specialized hardware from TPUs to mobile chips<p>If it is so good at that, why are we waiting so long for expeditiousness on run-of-the-mill industry-standard non-specialized non-Apple linux machines?
breatheoftenabout 7 years ago
I hope swift gets serious about serving the needs of data scientists tool — it would not take that much work to improve swift playgrounds to the point to enable a far better dx than can be had with Jupyter notebooks or matlab ...
评论 #16948142 未加载
bltabout 7 years ago
I don&#x27;t know anything about Swift, but I really wish ML had settled on a language with higher performance. Interpreter speed doesn&#x27;t bottleneck vision stuff but reinforcement learning really suffers.
kreetxabout 7 years ago
Honest question: isn&#x27;t python just glue over the well-performamt c++ tensorflow library? I thought it was, but given this article does python do more then? There wouldn&#x27;t be much to gain by swappinge the wrapper.
jwilbsabout 7 years ago
It may sound weird, but I believe if any data scientists switch to a ‘nontypical’ language for the domain, it should be JavaScript.<p>What’s required for data science is a healthy ecosystem of scientific computing tools. While js obviously isn’t as mature as python (anaconda stack + Jupiter, etc) or R (tidyverse etc) in this aspect, it has made great strides recently: - tensorflow.js - observable notebooks - mathjs - simple-statistics &#x2F; jstat<p>Furthermore, with tools like d3 + leaflet, js has very little competition when it comes to data visualiation.<p>A big thing holding js back is a mature library for data manipulation, hopefully this changes in the future (anybody know of any potential fills for this gap?).
edemabout 7 years ago
Maybe you should use Kotlin instead. It runs native on IoS, on the server, and on Android as well.
SwiftKickInTheabout 7 years ago
Honestly I don&#x27;t even use Swift for serious iOS apps, just for &#x27;throwaway&#x27; apps for lack of a better word. Swift would need to stabilize for at least 5-10 years before I would consider building anything with Swift as the foundation. I strongly believe in backwards compatibility, the Swift team does not.
评论 #16929108 未加载
laughfactoryabout 7 years ago
Swift? Um, okay... Good language, yes, but it&#x27;s still very iOS-centric. I generally agree with the assessment of Python, but I&#x27;ll stick with R for everything it can do. I use Python for everything else. If Swift breaks out of the iOS box then maybe I&#x27;ll think about learning it.
nielsbotabout 7 years ago
Python seems a lot more &quot;fun&quot; than Swift IMO
评论 #16929427 未加载
2RTZZSroabout 7 years ago
Please stop balkanizing the scientific software development community. Python has excellent wrappers for many other excellent scientific libraries which in turn leverage C and Fortran for high performance computing.
评论 #16929302 未加载