Live data from Hacker News

Why data scientists should start learning Swift

heartbeat.fritz.ai

31–40 of 67 posts

Re: Why data scientists should start learning Swift

#31

Earlier quoted context omitted.

A bunch of wrongs don't make a right :-) And honestly, it's because I do numerical programming that I value zero-based offsets. In addition to subscripting arrays (which I could do in any base), I use those subscripts in the math itself. For instance, the zeroth bin of an FFT indicates the zero frequency. I also choose the zeroth array element to represent the constant term (zeroth power) of a polynomial, and so on.…

> A bunch of wrongs don't make a right :-) Funny how I always thought zero-based numbering[0] was a hack. Just in computer science a hack will become the right way? Any other fields where hacks became the new norm due to technical restrictions? Your statement is a opinion. To add to the list of languages using arrays in a "gross" way: pgsql, pascal, lua. [1]: https://en.wikipedia.org/wiki/Zero-based_numbering#Origin

The way I've thought about this is that it's about whether an index is the name or the offset of an element of an array. Indices have a torsor-like structure, where you can subtract indices i and j to get an offset j-i from index i, and there is the relationship a[j] == a[i + (j-i)]. Zero-indexing is the special case that the name is the offset from the first element.

Because of this, I figure any language that supports 1-indexing should also support arbitrary ranges for the indexing, like in Ada. (Basically, what's so special about 1?)

Re: Why data scientists should start learning Swift

#32

Earlier quoted context omitted.

A bunch of wrongs don't make a right :-) And honestly, it's because I do numerical programming that I value zero-based offsets. In addition to subscripting arrays (which I could do in any base), I use those subscripts in the math itself. For instance, the zeroth bin of an FFT indicates the zero frequency. I also choose the zeroth array element to represent the constant term (zeroth power) of a polynomial, and so on.…

> A bunch of wrongs don't make a right :-) Funny how I always thought zero-based numbering[0] was a hack. Just in computer science a hack will become the right way? Any other fields where hacks became the new norm due to technical restrictions? Your statement is a opinion. To add to the list of languages using arrays in a "gross" way: pgsql, pascal, lua. [1]: https://en.wikipedia.org/wiki/Zero-based_numbering#Origin

I always thought it neatly mimicked the way we think of age. When you are born you start at 0. You only turn 1 after you have lived a year.

Re: Why data scientists should start learning Swift

#33

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.

> Swift was designed for general purpose app development.

Swift is a general-purpose language, but I would say that its first purpose is for mobile development. (Or, at least, that's where it started.)

> Why would you use Swift as your new data science language when Julia was made for that purpose and Swift was not?

The author calls out Swift as being good because (1) TensorFlow is now supported for it specifically and (2) it is optimized for mobile development. The author seems to feel that being able to deploy machine learning applications to mobile devices (and optimized) is a great boon, and Python is not well-suited to this.

Re: Why data scientists should start learning Swift

#34
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 "good enough is the competitor to the best" sense.

Re: Why data scientists should start learning Swift

#35

Python seems a lot more "fun" than Swift IMO

How do you mean?

I'm a big fan of Python, so I'm just curious what you mean here. Swift has a lot of great language features that Python lacks, in my opinion. (My first favorite: native option types. Second favorite: internal and external function parameter names. There are more, but these are my top two.)

Re: Why data scientists should start learning Swift

#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 time we change the fragment of the stack we work on.

We need an ultra-general purpose language with good support for both OOP and FP, non-retarded type-system, decent performance, and a good "compile to readable JS" story... to unify this damn mess of "diversity" that forces us to over-specialize in narrow niches and drowns us in complexity.

(No, otoh, I don't think "general purpose" should mean "infinite power" or "maximum expressivity". There's are reason why we're not all using Common Lisp and Scala...)

Re: Why data scientists should start learning Swift

#38
post #34

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 "good enough is the competitor to the best" sense.

Swift runs on Linux and there are also plenty of web frameworks, so it’s definitely possible to run on a server

Re: Why data scientists should start learning Swift

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

It's a lot easy to "quickly deprecate" when the ecosystem is small and breakage is acceptable. Let's see how Swift handles the situation at a similar point in it's life cycle. Bear in mind that most criticisms of the Python2/3 situation came from people that wanted less breakage - not more.
Post reply on HN