News for hackers. Stuff that matters.
Re:Swift architecture at Uber by Entangled on Wednesday April 26, 2017 @08:25PM (#14208217)
> Android engineers are more welcome now. Especially if they write Kotlin.

I love Swift, and I love Kotlin.

To any young programmer out there (I'm in my fifties), learn these two languages and you will be highly employable for the next decade, on top of the wave.

Re:Swift architecture at Uber by jacquesm on Wednesday April 26, 2017 @09:02PM (#14208381)
A decade is a pretty short time for an investment of that magnitude. Learn C (yes, I know), COBOL, Java, Erlang, Python or any other non-niche language and you'll hopefully be employable for decades, or at least until general AI rolls around.
Re:Swift architecture at Uber by WhitneyLand on Wednesday April 26, 2017 @09:34PM (#14208525)
The languages actually aren't really the big investment. It's really two things:

1) Learning new concepts in computer science. For example Swift uses a lot of modern concepts around type safety, closures, parallelism, synchronization, etc. These are a big learning curve but they are not specific to Swift and you'll notice other modern languages are adopting the same concepts.

2) The UI frameworks are fundamentally different. If you're an option expert at XCode constraints, storyboards, etc, none of the applies to android and vice versa.

I can tell you this, if you do bite the bullet and learn both very well you'll be surprised how much it helps you learn other systems more quickly because you've see all the concepts before.

Re:Swift architecture at Uber by lacampbell on Wednesday April 26, 2017 @10:53PM (#14208829)
For example Swift uses a lot of modern concepts around type safety, closures, parallelism, synchronization, etc.

None of those things seem particularly modern to me. Does swift actually have any concepts that weren't already implemented in other languages by say, 1980?

It might seem like I'm being pedantic, but the flip side is - why not learn older, simpler, more mature languages that already have those concepts?

Re:Swift architecture at Uber by coldtea on Thursday April 27, 2017 @03:26AM (#14209821)
>None of those things seem particularly modern to me. Does swift actually have any concepts that weren't already implemented in other languages by say, 1980?

Modern for mainstream languages. Non-mainstream languages are irrelevant to the discussion, since nobody cares about theme except niche industries, hobbyists and academics...

>but the flip side is - why not learn older, simpler, more mature languages that already have those concepts?

Because those languages are not tied to a $50 billion app industry or have major adoption and increased support.

Re:Swift architecture at Uber by paulddraper on Wednesday April 26, 2017 @11:07PM (#14208880)
It has options instead of null
Re:Swift architecture at Uber by mbel on Thursday April 27, 2017 @03:35AM (#14209845)
To which the same argument applies.
Re:Swift architecture at Uber by paulddraper on Thursday April 27, 2017 @06:26AM (#14210449)
Which languages before 1980 had an option/maybe type?
Re:Swift architecture at Uber by steveklabnik on Thursday April 27, 2017 @07:13AM (#14210637)
https://en.wikipedia.org/wiki/Tagged_union#1960s (and so on in the rest of the article; you could make the argument that being able to express a sum type and using option/result pervasively are different things; I don't know much about early ML but it was from '73...)
Re:Swift architecture at Uber by paulddraper on Thursday April 27, 2017 @10:12AM (#14211575)
No, a sum type is the essence.

TIL that ML is ooold.

Re:Swift architecture at Uber by _delirium on Thursday April 27, 2017 @10:24AM (#14211652)
ML has roots that go back a long ways, but it wasn't developed as a general-purpose programming language (for use outside theorem provers) until the '80s, and I'd consider it properly "released" to the general public as something intended for real use only in the 1990s, with the publication of the Standard ML definition (1990) the release of OCaml (1996).
Re:Swift architecture at Uber by Tanegashima on Thursday April 27, 2017 @01:27AM (#14209368)
Protocol extensions.
Re:Swift architecture at Uber by jacquesm on Wednesday April 26, 2017 @09:36PM (#14208537)
It's never just the language. The libraries are where the time goes and a language without libraries is fairly useless these days.
Re:Swift architecture at Uber by Tanegashima on Thursday April 27, 2017 @01:30AM (#14209380)
This, and package managers.

For example, node.js, many people say its popular because lots or webdevs knew JS already, but that's not even close to true, most people went to node.js because they found a couple of usable libraries on npm that gave the trust necessary to start the project.

Re:Swift architecture at Uber by coldtea on Thursday April 27, 2017 @03:24AM (#14209816)
You got it reverse, since when Node started getting adoption npm wasn't even a thing or was still small. Back in the Node early days it was all "we can run JS we know on the server now" (plus some cargo cult hype about it being "fast because async").
Re:Swift architecture at Uber by shakna on Wednesday April 26, 2017 @11:41PM (#14209020)
> For example Swift uses a lot of modern concepts around type safety, closures, parallelism, synchronization, etc.

Ada. [0]

It's been around since before '83 (when it became an ANSI standard), and was developed for the DOD, to replace the hodge podge of languages they were using, with an emphasis on safety.

It has all the above, whilst focusing on being plain English.

Ada also has a few things that are considered to be fairly modern, and has had them for a long time. Such as:

* No Primitive Data Types

* Type Contracts

* Subtyping, operator overloading

The more languages change... The more they stay the same.

These concepts aren't new.

[0] http://www.adacore.com/adaanswers/about/ada

Re:Swift architecture at Uber by WhitneyLand on Monday May 01, 2017 @08:41AM (#14237060)
@Coldtea had it right - I meant it has many concepts that are new to the most popular platforms. For example C# is very popular, but what it has of these features has trickled in slowly over the years and many .NET programmers have had no need to master them, same with Java.

Ada was a beautiful design for its time. Maybe its most fundamental flaw was government oversight. So much about designing a widely successful language is non-technical, choosing the right features, trends, hardware, that builds enough momentum to support a self-sustaining ecosystem. To do so often requires an agility that the DOD just doesn't have. Ada is one of so many examples that reminds us technical superiority commonly loses out to pragmatism.

I do like the name, it would have been fascinating to know Ada Lovelace.

Re:Swift architecture at Uber by slavapestov on Thursday April 27, 2017 @12:04AM (#14209093)
Ada does not have parametric polymorphism, algebraic data types, Objective-C interoperability, etc.
Re:Swift architecture at Uber by shakna on Thursday April 27, 2017 @01:47AM (#14209447)
I wasn't criticising Swift. I criticised certain features of Swift being regarded as modern.

But, if you insist:

> Ada does not have parametric polymorphism.

Yes, it does. [1][2] It's supported through the use of generic units.

> Ada does not have ... algebraic data types

Ada does have tagged records, and other variant types, and has had for quite some time. [0] They aren't quite Sum Types, but are incredibly close.

> Ada does not have... Objective-C interoperability

GNAT does. It's part of the GNU Compiler Collection, and as such, can be linked against other languages supported by the toolchain. GCC also supports Objective-C.

[0] http://archive.adaic.com/standards/83rat/html/ratl-04-07.htm...

[1] https://rosettacode.org/wiki/Parametric_polymorphism#Ada

[2] https://en.wikibooks.org/wiki/Ada_Programming/Generics#Param...

Re:Swift architecture at Uber by mpweiher on Thursday April 27, 2017 @11:02AM (#14212013)
> GNAT does. It's part of the GNU Compiler Collection

Yay! :-)

One thing that's probably almost unknown these days is that Objective-<X> was always supposed to be something you can easily add to any <X>, and in fact there were quite a few of these, including Objective-Assembler.

Re:Swift architecture at Uber by slavapestov on Thursday April 27, 2017 @05:48PM (#14215031)
Turns out I was quite ignorant of Ada - thanks for the pointers.
Re:Swift architecture at Uber by pjmlp on Thursday April 27, 2017 @01:10AM (#14209323)
Ada surely has generics since 1983.

Ada 2012 probably even has more generic data containers on their standard library than Swift.

ADTs can be done via tagged records.

Re:Swift architecture at Uber by slavapestov on Thursday April 27, 2017 @01:25AM (#14209362)
> Ada surely has generics since 1983.

That's interesting, I did not know that.

From a quick glance it appears they do not have bounded polymorphism ("protocol-constrained generic parameters"), associated types, or existential types ("values of protocol type"). So for example if you have a generic Set data type you would have to pass in an equality and hash function to each operation instead of saying that the element type is Hashable, etc.

The explicit instantiation looks quaint, but it reminds me of ML functors for some reason:

    procedure Instance_Swap is new Swap (Float);
Re:Swift architecture at Uber by pjmlp on Thursday April 27, 2017 @02:21AM (#14209580)
> From a quick glance it appears they do not have bounded polymorphism

You can use abstract classes and interfaces for that.

Re:Swift architecture at Uber by jacquesm on Thursday April 27, 2017 @12:12AM (#14209121)
Do those first two strike you as extremely limiting if they are not present in a programming language?
Re:Swift architecture at Uber by slavapestov on Thursday April 27, 2017 @12:19AM (#14209140)
Yes. Having done a fair bit of C programming in the kernel, where generic data structures are simulated with preprocessor macros and unsafe casts, I much prefer either static languages with generics, or dynamically typed languages.
Re:Swift architecture at Uber by shakna on Thursday April 27, 2017 @01:52AM (#14209460)
Ada was designed for the DOD by the High Order Language Working Group for this.

They wanted something safe for embedded, and the original specification in '83 included generics, so you could handle data structures in a nice, safe, performant manner.

Re:Swift architecture at Uber by jacquesm on Thursday April 27, 2017 @12:22AM (#14209149)
That's a fair point. Personally I don't like that style either so I avoid it at all costs but I've seen it practiced. It usually revolves around creative use of 'void' pointers and terribly hard to isolate bugs.
Re:Swift architecture at Uber by fauigerzigerk on Thursday April 27, 2017 @04:38AM (#14210074)
>Swift uses a lot of modern concepts around [...] parallelism, synchronization

What does Swift have in terms of parallelism/concurrency?

Re:Swift architecture at Uber by bshimmin on Thursday April 27, 2017 @04:04AM (#14209949)
If you're in your fifties, a single decade is about all you need to take you through to retirement age.

To be honest, I would've said going deep on JavaScript right now (React, React Native, etc) would give you a shelf life of at least five years.

Kotlin seems like a bit of a random recommendation - it's not in the TIOBE top 50, and a quick search for Kotlin jobs on indeed.com (the first job search site I found from Google) reveals several orders of magnitude fewer jobs than for anything mainstream (hell, even Haskell beats it comprehensively). Perhaps it's the next big thing though!

Re:Swift architecture at Uber by coldcode on Thursday April 27, 2017 @09:08AM (#14211160)
Javascript frameworks change on an annual basis if not faster.
Re:Swift architecture at Uber by root_axis on Thursday April 27, 2017 @10:05AM (#14211518)
This is a trendy sentiment that is oft repeated but of dubious veracity. Seems to me that Angular and React have remained as the preeminent Javascript frameworks for quite a few years without much signs of a shakeup, with the exception of vue.js taking on some modest gains in popularity, but still decidedly in the shadow of Angular and React.
Re:Swift architecture at Uber by sedky on Thursday April 27, 2017 @09:41AM (#14211361)
I feel like Node, Angular, React have all been around for a few years each
Re:Swift architecture at Uber by TheAceOfHearts on Wednesday April 26, 2017 @11:20PM (#14208943)
If you find Erlang a bit weird at first, try out Elixir. Its syntax is more familiar, so it's a bit more approachable. One nice perk is modules can be shared between both languages.
Re:Swift architecture at Uber by sandGorgon on Wednesday April 26, 2017 @11:51PM (#14209048)
With all due respect, I would dispute that. That would be JavaScript based - today React Native... tomorrow something similar.

Already there are large apps that are built around React Native. But more importantly, js as a language is becoming indispensable.

A few days ago, there was a discussion about Netflix - who specifically re-engineered it's back end infrastructure to let it's app engineers (who are js) write API services in nodejs. We are talking 40% of The Internet here ?

There is a large boost in hive mind productivity with one programming language . If Java 9 Truffle/Graal.js is as good as everyone says, then it is pretty much js all the way down.

And for those who think js is a shitty language (god knows I did), please try out ES2017 or Typescript - you will be pleasantly surprised.

Re:Swift architecture at Uber by edgyswingset on Wednesday April 26, 2017 @11:55PM (#14209063)
Netflix is a polyglot shop which uses a number of different programming languages for different parts of their systems. Yes, Node and JS play a large part in that, but that really isn't the whole story.
Re:Swift architecture at Uber by sandGorgon on Thursday April 27, 2017 @12:07AM (#14209105)
This is part of a specific re-engineering effort to enable front end engineers write their APIs in single threaded nodejs ..And the platform takes care of scaling.

Because "they already knew js". I know that Hystrix is still core, but IMHO the shift has started.

Re:Swift architecture at Uber by xor1 on Wednesday April 26, 2017 @11:53PM (#14209053)
How about learn all 3