https://kotlinlang.org logo
#announcements
Title
# announcements
a

amadeu01

10/11/2019, 1:09 AM
folks, in your opinion, what are the core features that make kotlin unique?
g

gildor

10/11/2019, 1:30 AM
Combination of not unique, but practical features
❤️ 12
p

Pablichjenkov

10/11/2019, 4:10 AM
To me Kotlin is basically a Frankenstein made out of Scala, C#, Swift and Java but with productivity at its core design. The word "unique" I don't think applies to any major language these days, since they basically copy each other popular features.
g

gildor

10/11/2019, 4:42 AM
How so Kotlin is “made out of Swift” if it was publicly unveiled 3 years before Swift?
👍 3
p

Pablichjenkov

10/11/2019, 4:44 AM
I think swift came first with using
?
to declare a nullable type reference.
g

gildor

10/11/2019, 4:44 AM
Nope
p

Pablichjenkov

10/11/2019, 4:44 AM
So who copy who?
As far as I know they are the only 2 languages using this syntax for nullable types. The rest is using the monadic Optional<T> variant
g

gildor

10/11/2019, 4:48 AM
This syntax was in Kotlin at least from early 2012, 2 years before any public announcements of Swift
p

Pablichjenkov

10/11/2019, 4:55 AM
I see, as per Wikipedia Swift started internal development in 2010 the same year as Kotlin. Their syntax is very similar although kotlin syntax reassembles Scala too. Since Swift gained more popularity first I thought kotlin copy some of its syntax. But the release dates do not backup my theory. There was probably internal communication between the 2 teams who knows 🤔
g

gildor

10/11/2019, 4:56 AM
I highly doubt that Apple discuss anything about unreleased products with another companies
as per Wikipedia Swift started internal development in 2010 the same year as Kotlin.
We don’t know anything about state of Swift or syntax at this point
p

Pablichjenkov

10/11/2019, 4:59 AM
Swift was opened source but not at that point, right. What about the force unwrap
!!
operator, haven't seen it in any other languages.
I do think members of both teams talk at some point. Is too much syntax coincidence. Maybe they share some language design thesis paperwork, or a research, something.
m

magisu

10/11/2019, 7:33 AM
I feel that Kotlin is a Ruby-based Java that attracted me.
🤔 2
e

elizarov

10/11/2019, 2:37 PM
You can learn the authoritative answer from Andrey Breslav: https://2018.geekout.ee/andrey-breslav/
Shoulders of giants: Languages Kotlin learned from
And there’s definitely zero Swift influence, since Swift was in secret close-source development at the time when Kotlin foundations were laid down. I don’t know if there was any influence in reverse, though. I have not seen a similar talk from Swift’s lead language designer.
p

Pablichjenkov

10/11/2019, 3:23 PM
Now that I see Breslav talk it makes me think the influence was in reverse order right.
e

elizarov

10/11/2019, 3:26 PM
We’ll never know that. Apple would never admit they took idea from somewhere or even had been influenced. That’s a taboo topic for them. Their whole presentation on “Combine” framework that’ve recently unveiled (which is essentially Rx ported to Swift) in an appalling example of that. They failed to give even slightest credit to its roots.
4
My guess, though, is that there was no direct Kotlin-Swift influence. This kind of syntax was simply in the air at that time and C# already had this syntax for their primitive types.
p

Pablichjenkov

10/11/2019, 3:37 PM
Didn't know about C#
?
nullable mark. However, still a mystery for
!!
and
if let
. Although the usage of
if let
syntax in Swift is slightly different from pure
?.let
in Kotlin.
e

elizarov

10/11/2019, 4:10 PM
Kotlin design went though a very different route. The goal was to minimize core syntax and to double-down on functional composition. That’s why, for example, Kotlin’s built-in constructs like
if (...) { ... }
use parenthesis. The desire was to ensure that function calls with lambdas like
synchronized(ref) { ... }
looks similarly to built-in constructs.
🤯 1
🧠 1