folks, in your opinion, what are the core features...
# announcements
a
folks, in your opinion, what are the core features that make kotlin unique?
g
Combination of not unique, but practical features
❤️ 12
p
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
How so Kotlin is “made out of Swift” if it was publicly unveiled 3 years before Swift?
👍 3
p
I think swift came first with using
?
to declare a nullable type reference.
g
Nope
p
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
This syntax was in Kotlin at least from early 2012, 2 years before any public announcements of Swift
p
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
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
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
I feel that Kotlin is a Ruby-based Java that attracted me.
🤔 2
e
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
Now that I see Breslav talk it makes me think the influence was in reverse order right.
e
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
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
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