Live data from Hacker News

Why data scientists should start learning Swift

heartbeat.fritz.ai

41–50 of 67 posts

Re: Why data scientists should start learning Swift

#41
I haven't followed the news about Chris Lattner. For those who like me who haven't seen that he's in Google now:

http://nondot.org/sabre/

"I worked for Apple from July 2005 to January 2017, holding a number of different positions over the years" "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't the right fit for me."

Joined "Google Brain" in August 2017.

https://techcrunch.com/2017/08/14/swift-creator-chris-lattne...

Re: Why data scientists should start learning Swift

#42
post #28
post #24

Earlier quoted context omitted.

"Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration." -- Stan Kelly-Bootle

Also: $[ = 1; (Yes, I'm _old_...)

And don't forget the venerable:

   $| = 1;

Re: Why data scientists should start learning Swift

#43
post #36

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.

> Julia's [was] designed with scientific computing in mind. Swift was designed for general purpose app development. General purpose always wins. Or should always win. Because in reality nobody has any idea what "the purpose" is in the grand scheme of things. Python succeeded because it was general-purpose enough. Javascript too. We don't want more narrow purpose languages that force us to change the language every ti…

You really should give Julia a go. It's as or more expressive in the general purpose sense of things as Python. It's the best of MATLAB and Python in one neat package.

Edit: Plus, you can pass your data structures out to Python or C for processing. And you can use a whole host of visualization tools.

Re: Why data scientists should start learning Swift

#44
It may sound weird, but I believe if any data scientists switch to a ‘nontypical’ language for the domain, it should be JavaScript.

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 / jstat

Furthermore, with tools like d3 + leaflet, js has very little competition when it comes to data visualiation.

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?).

Re: Why data scientists should start learning Swift

#45
post #43
post #36

Earlier quoted context omitted.

> Julia's [was] designed with scientific computing in mind. Swift was designed for general purpose app development. General purpose always wins. Or should always win. Because in reality nobody has any idea what "the purpose" is in the grand scheme of things. Python succeeded because it was general-purpose enough. Javascript too. We don't want more narrow purpose languages that force us to change the language every ti…

You really should give Julia a go. It's as or more expressive in the general purpose sense of things as Python. It's the best of MATLAB and Python in one neat package. Edit: Plus, you can pass your data structures out to Python or C for processing. And you can use a whole host of visualization tools.

I did. And it seems awesome.

I just dont see people with "software engineering" background taking any serious liking to it. So it creates DIVIDE between the "software engineering folks" (that want regular-looking-OOP-and-basic-FP architecting feature for APIs and stuff) and "data science folks" who just want to focus on the algorithms.

The litmus test for a "truly general purpose language" to me would be:

(1) write some algorithmic code in it (with not much concurrency and parallelism)

(2) write some (purposefully heavily overengineered) GUI or web-app (full-stack) code in it in a team of 3+ including at least one guy who's both really junior and another guy who's really sloppy

(3) write something making heavy use of networking, concurrency and parallelism

If all three feel EQUALLY natural in a language, than you've got a truly general purpose language. If not, look for something else.

And I know, people hate general purpose solutions just as much as they hate "expert generalist" people, and they have good reasons too, as we've all (or most) been burnt bad by contact with both such "solutions" and with such self-labeled people in the past. But just because we generally suck at "general purpose" doesn't mean we should stop trying!

Re: Why data scientists should start learning Swift

#46
post #45
post #43

Earlier quoted context omitted.

You really should give Julia a go. It's as or more expressive in the general purpose sense of things as Python. It's the best of MATLAB and Python in one neat package. Edit: Plus, you can pass your data structures out to Python or C for processing. And you can use a whole host of visualization tools.

I did. And it seems awesome. I just dont see people with "software engineering" background taking any serious liking to it. So it creates DIVIDE between the "software engineering folks" (that want regular-looking-OOP-and-basic-FP architecting feature for APIs and stuff) and "data science folks" who just want to focus on the algorithms. The litmus test for a "truly general purpose language" to me would be: (1) write s…

> Python succeeded because it was general-purpose enough.

> I just dont see people with "software engineering" background taking any serious liking to it.

I guess my point is that if you found Python general purpose enough, you'd likely find Julia general purpose enough too. If people with "software engineering background" take a serious liking to Python but not to Julia, then the reason probably isn't the language itself, but a combination of lack of popularity and a pre-conceived notion that the language is meant to be "scientific" not "general-purpose", that there aren't enough libraries, that the language might not survive, etc.

Re: Why data scientists should start learning Swift

#47
post #26

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.

When people say Python, I never know if they mean 2.7, 3.x, or both, or are unaware that there's a difference, or don't realize how much it matters in practice... so a language that has clear forward momentum, focuses on the latest version, and quickly deprecates old versions is pretty welcome.

The Python community focuses on stability and maintains each major and minor release for a long time so applications built with a particular version of Python continue to work with updates for a long time

Re: Why data scientists should start learning Swift

#48
post #43
post #36

Earlier quoted context omitted.

> Julia's [was] designed with scientific computing in mind. Swift was designed for general purpose app development. General purpose always wins. Or should always win. Because in reality nobody has any idea what "the purpose" is in the grand scheme of things. Python succeeded because it was general-purpose enough. Javascript too. We don't want more narrow purpose languages that force us to change the language every ti…

You really should give Julia a go. It's as or more expressive in the general purpose sense of things as Python. It's the best of MATLAB and Python in one neat package. Edit: Plus, you can pass your data structures out to Python or C for processing. And you can use a whole host of visualization tools.

Expressiveness of the language is one thing. Does it have the vast numbers of quality and well tried and tested libraries that Python does? That's generally more important than expressiveness.

Re: Why data scientists should start learning Swift

#49
Just to give an example why a "domain specific" language like Julia is more appealing then a "general purpose" language like Swift: I would like to demonstrate this on the old and classy Fortran vs C++ discussion in numerical computing.

In Fortran, you can write linear algebra on n-dimensional arrays (similar as in numpy and julia) very compactly, i.e.

   d(i) = TRANSPOSE(MATMUL(B(i,:),c))
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.

But it get'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:

   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
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.

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 "const", templates and all that overhead which is hard to regain in time.

Re: Why data scientists should start learning Swift

#50
post #49

Just to give an example why a "domain specific" language like Julia is more appealing then a "general purpose" language like Swift: I would like to demonstrate this on the old and classy Fortran vs C++ discussion in numerical computing. In Fortran, you can write linear algebra on n-dimensional arrays (similar as in numpy and julia) very compactly, i.e. d(i) = TRANSPOSE(MATMUL(B(i,:),c)) Writing something like this in…

> But contrary to this Fortran code, in order to understand my code, you first have to learn this library

Do you ? I've used Eigen and boost a lot of times and didn't ever need to "learn how the sausage is made", just looking at examples is enough to get stuff to work.

Post reply on HN