SlideShare una empresa de Scribd logo
1 de 44
Shoulders of Giants
Andrey Breslav
Sir Isaac Newton
If I have seen further it is
by standing on the
shoulders of Giants
Letter to Robert Hooke, 1675
Bernard of Charters
[Dicebat Bernardus Carnotensis nos esse quasi]
nanos gigantium
humeris incidentes.
XII c.
Why I’m giving this talk
The right question
Why don’t all language designers give such talks?
Every language has learned from others
Is it morally wrong? Or maybe even illegal?
“In science and in art, there are, and can be, few, if any things, which in
an abstract sense are strictly new and original throughout. Every book
in literature, science, and art borrows, and must necessarily borrow,
and use much which was well known and used before.”
Supreme Court Justice David Souter
Campbell v. Acuff-Rose Music, Inc., 510 U.S. 569 (1994)
Does it make them worse?
• Is originality what really matters to you as a developer?
• Put in on the scale with productivity and maintainability 
• But I want to
• … stand out
• … be proud of my language (and its authors)
• ... win arguments with fans of other languages
• … write awesome software, maybe? 
What do language designers think?
• The Kotlin team had productive discussions with
• Brian Goetz
• Martin Odersky
• Erik Meijer
• Chris Lattner
• … looking forward to having more!
My ideal world
• Everyone builds on top of others’ ideas
• Everyone openly admits it and says thank you
• Difference from academia: it’s OK to not look at some prior work 
So, what languages has Kotlin
learned from?
From Java: classes!
• One superclass
• Multiple superinterfaces
• No state in interfaces
• Constructors (no destructors)
• Nested/inner classes
• Annotations
• Method overloading
• One root class
• toString/equals/hashCode
• Autoboxing
• Erased generics
• Runtime safety guarantees
Leaving things out: Java
• Monitor in every object
• finalize()
• Covariant arrays
• Everything implicitly nullable
• Primitive types are not classes
• Mutable collection interfaces
• Static vs instance methods
• Raw types
• …
From Java…
class C : BaseClass, I1, I2 {
class Nested { ... }
inner class Inner { ... }
}
From Scala, C#...
class C(p: Int, val pp: I1) : B(p, pp) {
internal var foo: Int
set(v) { field = check(v) }
override fun toString() = "..."
}
Not Kotlin
class Person {
private var _name: String
def name = _name
def name_=(aName: String) { _name = aName }
}
Not Kotlin
class Person {
private string _Name;
public string Name {
get { return _Name; }
set { _Name = value }
}
}
Kotlin
class Person {
private var _name = "..."
var name: String
get() = _name
set(v) { _name = v }
}
Leaving things out: Interfaces vs Scala Traits
• No state allowed
• no fields
• no constructors
• Order doesn’t matter
• no linearization rules
• Delegation through by
Some (more) differences…
class C(d: Intf) : Intf by d {
init { println(d) }
fun def(x: Int = 1) { ... }
fun test() {
def(x = 2)
}
}
And a bit more…
val person = Person("Jane", "Doe")
val anonymous = object : Base() {
override fun foo() { ... }
}
From Scala…
object Singleton : Base(foo) {
val bar = ...
fun baz(): String { ... }
}
Singleton.baz()
Companion objects
class Data private (val x: Int) {
companion object {
fun create(x) = Data(x)
}
}
val data = Data.create(10)
Companion objects
class Data private (val x: Int) {
companion object {
@JvmStatic
fun create(x) = Data(x)
}
}
val data = Data.create(10)
BTW: Not so great ideas
• Companion objects 
• Inheritance by delegation 
From C#...
class Person(
val firstName: String,
val lastName: String
)
fun Person.fullName() {
return "$firstName $lastName"
}
Not Kotlin
implicit class RichPerson(p: Person) {
def fullName = s"${p.firstName} ${p.lastName}"
}
class PersonUtil {
public static string FullName(this Person p) {
return $"{p.firstName} {p.lastName}"
}
}
It’s Groovy time!
mylist
.filter { it.foo }
.map { it.bar }
Not Kotlin
mylist.filter(_.foo).map(_.bar)
mylist.stream()
.filter((it) -> it.getFoo())
.map((it) -> it.getBar())
.collect(Collectors.toList())
mylist.Where(it => it.foo).Select(it => it.bar)
Not Kotlin (yet…)
for (it <- mylist if it.foo)
yield it.bar
from it in mylist where it.foo select it.bar
[it.bar for it in mylist if it.foo]
It’s Groovy time!
val foo = new Foo()
foo.bar()
foo.baz()
foo.qux() with(foo) {
bar()
baz()
qux()
}
DSLs: Type-Safe Builders
a(href = "http://my.com") {
img(src = "http://my.com/icon.png")
}
Not Kotlin 
10 PRINT "Welcome to Baysick Lunar Lander v0.9"
20 LET ('dist := 100)
30 LET ('v := 1)
40 LET ('fuel := 1000)
50 LET ('mass := 1000)
60 PRINT "You are drifting towards the moon."
Not Kotlin 
object Lunar extends Baysick {
def main(args:Array[String]) = {
10 PRINT "Welcome to Baysick Lunar Lander v0.9"
20 LET ('dist := 100)
30 LET ('v := 1)
40 LET ('fuel := 1000)
50 LET ('mass := 1000)
60 PRINT "You are drifting towards the moon."
}
}
From Scala: Data Classes
data class Person(
val first: String,
val last: String
) {
override fun equals(other: Any?): Boolean
override fun hashCode(): Int
override fun toString(): String
fun component1() = first
fun component2() = last
fun copy(first: String = this.first, last: String = this.last)
}
val (first, last) = myPerson
Not Kotlin
val greeting = x match {
case Person(f, l) => s"Hi, $f $l!"
case Pet(n) => s"Hi, $n!"
_ => "Not so greetable O_o"
}
From Gosu: Smart casts
val greeting = when (x) {
is Person -> "Hi, ${x.first} ${x.last}!"
is Pet -> "Hi, ${x.name}!"
else -> "Not so greetable o_O"
}
From Groovy, C#: Elvis and friends
val middle = p.middleName ?: "N/A"
persons.firstOrNull()?.firstName ?: "N/A"
nullable!!.foo
(foo as Person).bar
(foo as? Person)?.bar
Java/Scala/C#: Generics
abstract class Read<out T> {
abstract fun read(): T
}
interface Write<in T> {
fun write(t: T)
}
Java/Scala/C#: Generics
class RW<T>(var t: T): Read<T>, Write<T> {
override fun read(): T = t
override fun write(t: T) {
this.t = t
}
}
fun foo(from: RW<out T>, to: RW<in T>) {
to.write(from.read())
}
Do other languages learn from Kotlin?
• I can't be 100% sure, but looks like they do
• xTend
• Hack
• Swift
• Java?
• C#?
• But let them speak for themselves!
My ideal world
• Everyone builds on top of others’ ideas
• Everyone openly admits it and says thank you
• Difference from academia: it’s OK to not look at some prior work 
P.S. My Personal Workaround
In practice, languages are often
selected by passion, not reason.
Much as I’d like it to be the other way around,
I see no way of changing that.
So, I’m trying to make Kotlin a
language that is loved for a reason 

Más contenido relacionado

La actualidad más candente

GEOMORFOLOGIA ESTRUCTURAL
 GEOMORFOLOGIA ESTRUCTURAL GEOMORFOLOGIA ESTRUCTURAL
GEOMORFOLOGIA ESTRUCTURALDanielOreSalazar
 
Ciencias de la tierra. guia 4
Ciencias de la tierra. guia 4Ciencias de la tierra. guia 4
Ciencias de la tierra. guia 4EDN25
 
Using 3-D Seismic Attributes in Reservoir Characterization
Using 3-D Seismic Attributes in Reservoir CharacterizationUsing 3-D Seismic Attributes in Reservoir Characterization
Using 3-D Seismic Attributes in Reservoir Characterizationguest05b785
 
Use of Rock-Eval pyrolysis
Use of Rock-Eval pyrolysis Use of Rock-Eval pyrolysis
Use of Rock-Eval pyrolysis selim Haouari
 
Unconventional Reservoir Characterization
Unconventional Reservoir CharacterizationUnconventional Reservoir Characterization
Unconventional Reservoir Characterizationshehabhosny1
 
PITFALLS IN 3-D SEISMIC INTERPRETATION
PITFALLS IN 3-D SEISMIC INTERPRETATION PITFALLS IN 3-D SEISMIC INTERPRETATION
PITFALLS IN 3-D SEISMIC INTERPRETATION Debabrata Majumder
 
Well logging for petrophysics, Ricardo Castrejon, UNAM
Well logging for petrophysics, Ricardo Castrejon, UNAMWell logging for petrophysics, Ricardo Castrejon, UNAM
Well logging for petrophysics, Ricardo Castrejon, UNAMGlobal CCS Institute
 

La actualidad más candente (9)

Petrel F 1 getting started- 2018 v1.1
Petrel F 1 getting started- 2018 v1.1Petrel F 1 getting started- 2018 v1.1
Petrel F 1 getting started- 2018 v1.1
 
Source and reservoir of pakistan
Source and reservoir of pakistanSource and reservoir of pakistan
Source and reservoir of pakistan
 
GEOMORFOLOGIA ESTRUCTURAL
 GEOMORFOLOGIA ESTRUCTURAL GEOMORFOLOGIA ESTRUCTURAL
GEOMORFOLOGIA ESTRUCTURAL
 
Ciencias de la tierra. guia 4
Ciencias de la tierra. guia 4Ciencias de la tierra. guia 4
Ciencias de la tierra. guia 4
 
Using 3-D Seismic Attributes in Reservoir Characterization
Using 3-D Seismic Attributes in Reservoir CharacterizationUsing 3-D Seismic Attributes in Reservoir Characterization
Using 3-D Seismic Attributes in Reservoir Characterization
 
Use of Rock-Eval pyrolysis
Use of Rock-Eval pyrolysis Use of Rock-Eval pyrolysis
Use of Rock-Eval pyrolysis
 
Unconventional Reservoir Characterization
Unconventional Reservoir CharacterizationUnconventional Reservoir Characterization
Unconventional Reservoir Characterization
 
PITFALLS IN 3-D SEISMIC INTERPRETATION
PITFALLS IN 3-D SEISMIC INTERPRETATION PITFALLS IN 3-D SEISMIC INTERPRETATION
PITFALLS IN 3-D SEISMIC INTERPRETATION
 
Well logging for petrophysics, Ricardo Castrejon, UNAM
Well logging for petrophysics, Ricardo Castrejon, UNAMWell logging for petrophysics, Ricardo Castrejon, UNAM
Well logging for petrophysics, Ricardo Castrejon, UNAM
 

Similar a Shoulders of giants: Languages Kotlin learned from

2022 May - Shoulders of Giants - Amsterdam - Kotlin Dev Day.pdf
2022 May - Shoulders of Giants - Amsterdam - Kotlin Dev Day.pdf2022 May - Shoulders of Giants - Amsterdam - Kotlin Dev Day.pdf
2022 May - Shoulders of Giants - Amsterdam - Kotlin Dev Day.pdfAndrey Breslav
 
Feel of Kotlin (Berlin JUG 16 Apr 2015)
Feel of Kotlin (Berlin JUG 16 Apr 2015)Feel of Kotlin (Berlin JUG 16 Apr 2015)
Feel of Kotlin (Berlin JUG 16 Apr 2015)intelliyole
 
Kotlin Austin Droids April 14 2016
Kotlin Austin Droids April 14 2016Kotlin Austin Droids April 14 2016
Kotlin Austin Droids April 14 2016DesertJames
 
Kotlin Slides from Devoxx 2011
Kotlin Slides from Devoxx 2011Kotlin Slides from Devoxx 2011
Kotlin Slides from Devoxx 2011Andrey Breslav
 
Crystal presentation in NY
Crystal presentation in NYCrystal presentation in NY
Crystal presentation in NYCrystal Language
 
Let's fly to the Kotlin Island. Just an introduction to Kotlin
Let's fly to the Kotlin Island. Just an introduction to KotlinLet's fly to the Kotlin Island. Just an introduction to Kotlin
Let's fly to the Kotlin Island. Just an introduction to KotlinAliaksei Zhynhiarouski
 
Kotlin 101 for Java Developers
Kotlin 101 for Java DevelopersKotlin 101 for Java Developers
Kotlin 101 for Java DevelopersChristoph Pickl
 
Kotlin: A pragmatic language by JetBrains
Kotlin: A pragmatic language by JetBrainsKotlin: A pragmatic language by JetBrains
Kotlin: A pragmatic language by JetBrainsJigar Gosar
 
Intro to Kotlin
Intro to KotlinIntro to Kotlin
Intro to KotlinMagda Miu
 
Meetup di GDG Italia - Leonardo Pirro - Codemotion Rome 2018
Meetup di GDG Italia - Leonardo Pirro -  Codemotion Rome 2018 Meetup di GDG Italia - Leonardo Pirro -  Codemotion Rome 2018
Meetup di GDG Italia - Leonardo Pirro - Codemotion Rome 2018 Codemotion
 
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)Andrés Viedma Peláez
 
Kotlin for Android Developers - 3
Kotlin for Android Developers - 3Kotlin for Android Developers - 3
Kotlin for Android Developers - 3Mohamed Nabil, MSc.
 
Kotlin coroutines and spring framework
Kotlin coroutines and spring frameworkKotlin coroutines and spring framework
Kotlin coroutines and spring frameworkSunghyouk Bae
 
KotlinForJavaDevelopers-UJUG.pptx
KotlinForJavaDevelopers-UJUG.pptxKotlinForJavaDevelopers-UJUG.pptx
KotlinForJavaDevelopers-UJUG.pptxIan Robertson
 
Build a compiler using C#, Irony and RunSharp.
Build a compiler using C#, Irony and RunSharp.Build a compiler using C#, Irony and RunSharp.
Build a compiler using C#, Irony and RunSharp.James Curran
 

Similar a Shoulders of giants: Languages Kotlin learned from (20)

2022 May - Shoulders of Giants - Amsterdam - Kotlin Dev Day.pdf
2022 May - Shoulders of Giants - Amsterdam - Kotlin Dev Day.pdf2022 May - Shoulders of Giants - Amsterdam - Kotlin Dev Day.pdf
2022 May - Shoulders of Giants - Amsterdam - Kotlin Dev Day.pdf
 
Just Kotlin
Just KotlinJust Kotlin
Just Kotlin
 
Feel of Kotlin (Berlin JUG 16 Apr 2015)
Feel of Kotlin (Berlin JUG 16 Apr 2015)Feel of Kotlin (Berlin JUG 16 Apr 2015)
Feel of Kotlin (Berlin JUG 16 Apr 2015)
 
Kotlin Austin Droids April 14 2016
Kotlin Austin Droids April 14 2016Kotlin Austin Droids April 14 2016
Kotlin Austin Droids April 14 2016
 
Kotlin @ Devoxx 2011
Kotlin @ Devoxx 2011Kotlin @ Devoxx 2011
Kotlin @ Devoxx 2011
 
Kotlin Slides from Devoxx 2011
Kotlin Slides from Devoxx 2011Kotlin Slides from Devoxx 2011
Kotlin Slides from Devoxx 2011
 
Crystal presentation in NY
Crystal presentation in NYCrystal presentation in NY
Crystal presentation in NY
 
Let's fly to the Kotlin Island. Just an introduction to Kotlin
Let's fly to the Kotlin Island. Just an introduction to KotlinLet's fly to the Kotlin Island. Just an introduction to Kotlin
Let's fly to the Kotlin Island. Just an introduction to Kotlin
 
Kotlin 101 for Java Developers
Kotlin 101 for Java DevelopersKotlin 101 for Java Developers
Kotlin 101 for Java Developers
 
Kotlin: A pragmatic language by JetBrains
Kotlin: A pragmatic language by JetBrainsKotlin: A pragmatic language by JetBrains
Kotlin: A pragmatic language by JetBrains
 
Intro to Kotlin
Intro to KotlinIntro to Kotlin
Intro to Kotlin
 
Meetup di GDG Italia - Leonardo Pirro - Codemotion Rome 2018
Meetup di GDG Italia - Leonardo Pirro -  Codemotion Rome 2018 Meetup di GDG Italia - Leonardo Pirro -  Codemotion Rome 2018
Meetup di GDG Italia - Leonardo Pirro - Codemotion Rome 2018
 
Scala fundamentals
Scala fundamentalsScala fundamentals
Scala fundamentals
 
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
Poniendo Kotlin en producción a palos (Kotlin in production, the hard way)
 
Kotlin for Android Developers - 3
Kotlin for Android Developers - 3Kotlin for Android Developers - 3
Kotlin for Android Developers - 3
 
Crystal Rocks
Crystal RocksCrystal Rocks
Crystal Rocks
 
Why Kotlin is your next language?
Why Kotlin is your next language? Why Kotlin is your next language?
Why Kotlin is your next language?
 
Kotlin coroutines and spring framework
Kotlin coroutines and spring frameworkKotlin coroutines and spring framework
Kotlin coroutines and spring framework
 
KotlinForJavaDevelopers-UJUG.pptx
KotlinForJavaDevelopers-UJUG.pptxKotlinForJavaDevelopers-UJUG.pptx
KotlinForJavaDevelopers-UJUG.pptx
 
Build a compiler using C#, Irony and RunSharp.
Build a compiler using C#, Irony and RunSharp.Build a compiler using C#, Irony and RunSharp.
Build a compiler using C#, Irony and RunSharp.
 

Más de Andrey Breslav

Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?Andrey Breslav
 
JVMLS 2016. Coroutines in Kotlin
JVMLS 2016. Coroutines in KotlinJVMLS 2016. Coroutines in Kotlin
JVMLS 2016. Coroutines in KotlinAndrey Breslav
 
Flexible Types in Kotlin - JVMLS 2015
Flexible Types in Kotlin - JVMLS 2015Flexible Types in Kotlin - JVMLS 2015
Flexible Types in Kotlin - JVMLS 2015Andrey Breslav
 
Introduction to Kotlin: Brief and clear
Introduction to Kotlin: Brief and clearIntroduction to Kotlin: Brief and clear
Introduction to Kotlin: Brief and clearAndrey Breslav
 
Kotlin for Android: Brief and Clear
Kotlin for Android: Brief and ClearKotlin for Android: Brief and Clear
Kotlin for Android: Brief and ClearAndrey Breslav
 
Kotlin (Introduction for students)
Kotlin (Introduction for students)Kotlin (Introduction for students)
Kotlin (Introduction for students)Andrey Breslav
 
Kotlin: Challenges in JVM language design
Kotlin: Challenges in JVM language designKotlin: Challenges in JVM language design
Kotlin: Challenges in JVM language designAndrey Breslav
 
Kotlin gets Reflection
Kotlin gets ReflectionKotlin gets Reflection
Kotlin gets ReflectionAndrey Breslav
 
Language Design Trade-offs
Language Design Trade-offsLanguage Design Trade-offs
Language Design Trade-offsAndrey Breslav
 
Kotlin: Incompetence * Motivation = Innovation?
Kotlin: Incompetence * Motivation = Innovation?Kotlin: Incompetence * Motivation = Innovation?
Kotlin: Incompetence * Motivation = Innovation?Andrey Breslav
 
Who's More Functional: Kotlin, Groovy, Scala, or Java?
Who's More Functional: Kotlin, Groovy, Scala, or Java?Who's More Functional: Kotlin, Groovy, Scala, or Java?
Who's More Functional: Kotlin, Groovy, Scala, or Java?Andrey Breslav
 
JavaOne2012: Kotlin: Practical Aspects of JVM Language Implementation
JavaOne2012: Kotlin: Practical Aspects of JVM Language ImplementationJavaOne2012: Kotlin: Practical Aspects of JVM Language Implementation
JavaOne2012: Kotlin: Practical Aspects of JVM Language ImplementationAndrey Breslav
 
[JVMLS 12] Kotlin / Java Interop
[JVMLS 12] Kotlin / Java Interop[JVMLS 12] Kotlin / Java Interop
[JVMLS 12] Kotlin / Java InteropAndrey Breslav
 
Kotlin @ CSClub & Yandex
Kotlin @ CSClub & YandexKotlin @ CSClub & Yandex
Kotlin @ CSClub & YandexAndrey Breslav
 
Kotlin @ StrangeLoop 2011
Kotlin @ StrangeLoop 2011Kotlin @ StrangeLoop 2011
Kotlin @ StrangeLoop 2011Andrey Breslav
 

Más de Andrey Breslav (17)

Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?
 
JVMLS 2016. Coroutines in Kotlin
JVMLS 2016. Coroutines in KotlinJVMLS 2016. Coroutines in Kotlin
JVMLS 2016. Coroutines in Kotlin
 
Flexible Types in Kotlin - JVMLS 2015
Flexible Types in Kotlin - JVMLS 2015Flexible Types in Kotlin - JVMLS 2015
Flexible Types in Kotlin - JVMLS 2015
 
Eval4j @ JVMLS 2014
Eval4j @ JVMLS 2014Eval4j @ JVMLS 2014
Eval4j @ JVMLS 2014
 
Introduction to Kotlin: Brief and clear
Introduction to Kotlin: Brief and clearIntroduction to Kotlin: Brief and clear
Introduction to Kotlin: Brief and clear
 
Kotlin for Android: Brief and Clear
Kotlin for Android: Brief and ClearKotlin for Android: Brief and Clear
Kotlin for Android: Brief and Clear
 
Kotlin (Introduction for students)
Kotlin (Introduction for students)Kotlin (Introduction for students)
Kotlin (Introduction for students)
 
Kotlin: Challenges in JVM language design
Kotlin: Challenges in JVM language designKotlin: Challenges in JVM language design
Kotlin: Challenges in JVM language design
 
Kotlin gets Reflection
Kotlin gets ReflectionKotlin gets Reflection
Kotlin gets Reflection
 
Language Design Trade-offs
Language Design Trade-offsLanguage Design Trade-offs
Language Design Trade-offs
 
Functions and data
Functions and dataFunctions and data
Functions and data
 
Kotlin: Incompetence * Motivation = Innovation?
Kotlin: Incompetence * Motivation = Innovation?Kotlin: Incompetence * Motivation = Innovation?
Kotlin: Incompetence * Motivation = Innovation?
 
Who's More Functional: Kotlin, Groovy, Scala, or Java?
Who's More Functional: Kotlin, Groovy, Scala, or Java?Who's More Functional: Kotlin, Groovy, Scala, or Java?
Who's More Functional: Kotlin, Groovy, Scala, or Java?
 
JavaOne2012: Kotlin: Practical Aspects of JVM Language Implementation
JavaOne2012: Kotlin: Practical Aspects of JVM Language ImplementationJavaOne2012: Kotlin: Practical Aspects of JVM Language Implementation
JavaOne2012: Kotlin: Practical Aspects of JVM Language Implementation
 
[JVMLS 12] Kotlin / Java Interop
[JVMLS 12] Kotlin / Java Interop[JVMLS 12] Kotlin / Java Interop
[JVMLS 12] Kotlin / Java Interop
 
Kotlin @ CSClub & Yandex
Kotlin @ CSClub & YandexKotlin @ CSClub & Yandex
Kotlin @ CSClub & Yandex
 
Kotlin @ StrangeLoop 2011
Kotlin @ StrangeLoop 2011Kotlin @ StrangeLoop 2011
Kotlin @ StrangeLoop 2011
 

Último

Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profileakrivarotava
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 

Último (20)

Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
SoftTeco - Software Development Company Profile
SoftTeco - Software Development Company ProfileSoftTeco - Software Development Company Profile
SoftTeco - Software Development Company Profile
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 

Shoulders of giants: Languages Kotlin learned from

  • 2. Sir Isaac Newton If I have seen further it is by standing on the shoulders of Giants Letter to Robert Hooke, 1675
  • 3. Bernard of Charters [Dicebat Bernardus Carnotensis nos esse quasi] nanos gigantium humeris incidentes. XII c.
  • 4.
  • 5. Why I’m giving this talk
  • 6.
  • 7. The right question Why don’t all language designers give such talks? Every language has learned from others
  • 8. Is it morally wrong? Or maybe even illegal? “In science and in art, there are, and can be, few, if any things, which in an abstract sense are strictly new and original throughout. Every book in literature, science, and art borrows, and must necessarily borrow, and use much which was well known and used before.” Supreme Court Justice David Souter Campbell v. Acuff-Rose Music, Inc., 510 U.S. 569 (1994)
  • 9. Does it make them worse? • Is originality what really matters to you as a developer? • Put in on the scale with productivity and maintainability  • But I want to • … stand out • … be proud of my language (and its authors) • ... win arguments with fans of other languages • … write awesome software, maybe? 
  • 10. What do language designers think? • The Kotlin team had productive discussions with • Brian Goetz • Martin Odersky • Erik Meijer • Chris Lattner • … looking forward to having more!
  • 11. My ideal world • Everyone builds on top of others’ ideas • Everyone openly admits it and says thank you • Difference from academia: it’s OK to not look at some prior work 
  • 12. So, what languages has Kotlin learned from?
  • 13. From Java: classes! • One superclass • Multiple superinterfaces • No state in interfaces • Constructors (no destructors) • Nested/inner classes • Annotations • Method overloading • One root class • toString/equals/hashCode • Autoboxing • Erased generics • Runtime safety guarantees
  • 14. Leaving things out: Java • Monitor in every object • finalize() • Covariant arrays • Everything implicitly nullable • Primitive types are not classes • Mutable collection interfaces • Static vs instance methods • Raw types • …
  • 15. From Java… class C : BaseClass, I1, I2 { class Nested { ... } inner class Inner { ... } }
  • 16. From Scala, C#... class C(p: Int, val pp: I1) : B(p, pp) { internal var foo: Int set(v) { field = check(v) } override fun toString() = "..." }
  • 17. Not Kotlin class Person { private var _name: String def name = _name def name_=(aName: String) { _name = aName } }
  • 18. Not Kotlin class Person { private string _Name; public string Name { get { return _Name; } set { _Name = value } } }
  • 19. Kotlin class Person { private var _name = "..." var name: String get() = _name set(v) { _name = v } }
  • 20. Leaving things out: Interfaces vs Scala Traits • No state allowed • no fields • no constructors • Order doesn’t matter • no linearization rules • Delegation through by
  • 21. Some (more) differences… class C(d: Intf) : Intf by d { init { println(d) } fun def(x: Int = 1) { ... } fun test() { def(x = 2) } }
  • 22. And a bit more… val person = Person("Jane", "Doe") val anonymous = object : Base() { override fun foo() { ... } }
  • 23. From Scala… object Singleton : Base(foo) { val bar = ... fun baz(): String { ... } } Singleton.baz()
  • 24. Companion objects class Data private (val x: Int) { companion object { fun create(x) = Data(x) } } val data = Data.create(10)
  • 25. Companion objects class Data private (val x: Int) { companion object { @JvmStatic fun create(x) = Data(x) } } val data = Data.create(10)
  • 26. BTW: Not so great ideas • Companion objects  • Inheritance by delegation 
  • 27. From C#... class Person( val firstName: String, val lastName: String ) fun Person.fullName() { return "$firstName $lastName" }
  • 28. Not Kotlin implicit class RichPerson(p: Person) { def fullName = s"${p.firstName} ${p.lastName}" } class PersonUtil { public static string FullName(this Person p) { return $"{p.firstName} {p.lastName}" } }
  • 29. It’s Groovy time! mylist .filter { it.foo } .map { it.bar }
  • 30. Not Kotlin mylist.filter(_.foo).map(_.bar) mylist.stream() .filter((it) -> it.getFoo()) .map((it) -> it.getBar()) .collect(Collectors.toList()) mylist.Where(it => it.foo).Select(it => it.bar)
  • 31. Not Kotlin (yet…) for (it <- mylist if it.foo) yield it.bar from it in mylist where it.foo select it.bar [it.bar for it in mylist if it.foo]
  • 32. It’s Groovy time! val foo = new Foo() foo.bar() foo.baz() foo.qux() with(foo) { bar() baz() qux() }
  • 33. DSLs: Type-Safe Builders a(href = "http://my.com") { img(src = "http://my.com/icon.png") }
  • 34. Not Kotlin  10 PRINT "Welcome to Baysick Lunar Lander v0.9" 20 LET ('dist := 100) 30 LET ('v := 1) 40 LET ('fuel := 1000) 50 LET ('mass := 1000) 60 PRINT "You are drifting towards the moon."
  • 35. Not Kotlin  object Lunar extends Baysick { def main(args:Array[String]) = { 10 PRINT "Welcome to Baysick Lunar Lander v0.9" 20 LET ('dist := 100) 30 LET ('v := 1) 40 LET ('fuel := 1000) 50 LET ('mass := 1000) 60 PRINT "You are drifting towards the moon." } }
  • 36. From Scala: Data Classes data class Person( val first: String, val last: String ) { override fun equals(other: Any?): Boolean override fun hashCode(): Int override fun toString(): String fun component1() = first fun component2() = last fun copy(first: String = this.first, last: String = this.last) } val (first, last) = myPerson
  • 37. Not Kotlin val greeting = x match { case Person(f, l) => s"Hi, $f $l!" case Pet(n) => s"Hi, $n!" _ => "Not so greetable O_o" }
  • 38. From Gosu: Smart casts val greeting = when (x) { is Person -> "Hi, ${x.first} ${x.last}!" is Pet -> "Hi, ${x.name}!" else -> "Not so greetable o_O" }
  • 39. From Groovy, C#: Elvis and friends val middle = p.middleName ?: "N/A" persons.firstOrNull()?.firstName ?: "N/A" nullable!!.foo (foo as Person).bar (foo as? Person)?.bar
  • 40. Java/Scala/C#: Generics abstract class Read<out T> { abstract fun read(): T } interface Write<in T> { fun write(t: T) }
  • 41. Java/Scala/C#: Generics class RW<T>(var t: T): Read<T>, Write<T> { override fun read(): T = t override fun write(t: T) { this.t = t } } fun foo(from: RW<out T>, to: RW<in T>) { to.write(from.read()) }
  • 42. Do other languages learn from Kotlin? • I can't be 100% sure, but looks like they do • xTend • Hack • Swift • Java? • C#? • But let them speak for themselves!
  • 43. My ideal world • Everyone builds on top of others’ ideas • Everyone openly admits it and says thank you • Difference from academia: it’s OK to not look at some prior work 
  • 44. P.S. My Personal Workaround In practice, languages are often selected by passion, not reason. Much as I’d like it to be the other way around, I see no way of changing that. So, I’m trying to make Kotlin a language that is loved for a reason 

Notas del editor

  1. https://upload.wikimedia.org/wikipedia/commons/4/4a/Library_of_Congress%2C_Rosenwald_4%2C_Bl._5r.jpg
  2. https://upload.wikimedia.org/wikipedia/commons/3/39/GodfreyKneller-IsaacNewton-1689.jpg
  3. https://upload.wikimedia.org/wikipedia/commons/3/39/GodfreyKneller-IsaacNewton-1689.jpg
  4. https://upload.wikimedia.org/wikipedia/commons/4/4a/Library_of_Congress%2C_Rosenwald_4%2C_Bl._5r.jpg
  5. https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/Warsaw_Pillow_Fight_2010_%284488607206%29.jpg/1280px-Warsaw_Pillow_Fight_2010_%284488607206%29.jpg
  6. https://en.wikipedia.org/wiki/David_Souter#/media/File:DavidSouter.jpg