Professional Documents
Culture Documents
Kotlin
How agile can language development be?
Andrey Breslav
Disclaimer: Talking About the Future
• We are planning things
• JS Interop
• Dynamic types
• ts2kt + DefinitelyTyped
• React, webpack, npm, …
• Full-stack projects
• Common libraries
• Shared code
Kotlin/NaJve
• Technical Preview (Apr 2017)
• No VM
• Our own memory management
• Direct C interop
• Standalone executables
• Direct compilaRon to Linux/Mac/iOS/Raspberry Pi
• Uses LLVM
Plans & Vision
Strategic direcRons for Kotlin
The Two “Dimensions”
Paradigms
Metaprogramming
F
CorouRnes
v 1.1
ScripRng
FuncRonal
OOP
Pla$orms
Web Client
Android Client
(JS/WASM)
Server
(JVM or NaRve)
Desktop Client
iOS Client
(JVM or NaRve)
Everything testable can be shared!
Possible Products
• Cross-plaWorm mobile: iOS/Android
• All testable code can be shared (MVVM could help along)
• Server-side/Microservices
Paradigms
OOP -> FP -> ScripRng -> CorouRnes -> Metaprogramming
CorouJnes
• Almost-free threads
• StraighWorward asynchrony
• On all plaWorms
• JVM & JS: already supported
• NaRve: WIP
Going Meta
Future metaprogramming features of Kotlin
TradiJonal Approaches to Metaprogramming
• ReflecRon
• AnnotaRon processing (Java)
• Expression trees (C#)
• Bytecode processing/instrumentaRon
Jedi Metaprogramming
• Macros
• Compiler runs some of your code
• MulR-stage languages
How do I make
an IDE now?
• You don’t want to know J
The Kotlin Way: No Macros
• Plugins for Compiler/IDE
• Uniform API, must support IDE features
• ReflecRon, of course
• May have limitaRons on some plaWorms
To Infinity and Beyond
Other Language Enhancements
Some more plans
• Value Types & Inline Classes
• Compact storage, newtype, return several things from a funcRon…
• Type Classes / Concepts
• Structural types, Non-intrusive interfaces, Extension-friendly
• Immutable data
• For error-proof sharing, OpRmizaRons, ...
• ScripRng
• Performance, REPL, ...
Immediate Future: Kotlin 1.2
• Focus on maintenance
• Performance is a priority
• Bugfixes, infrastructure, some tooling improvements
• Easier to Reify
More Safety
• Immutable Data
• The Holy Grail
• Good for mulRthreading & OpRmizaRons
• Pervasive in a type system
• Already used
• Gradle: Type-safe build scripts
• Spring: Templates
☺ Agile
• Design -> Prototype -> Get Feedback -> Redesign
• What about compaRbility?
community
How agile can we be?
• Open design process
• KEEP = Kotlin Enhancement & EvoluRon Process
• Experimental features
• Completely usable, but the design may change
• Requires an explicit opt-in
• We’ll try to minimize the migraRon pain
Possible Changes
• Add a language feature/API
• 1.X only
• Keep binary and source backward compaRble
• Remove a feature/API
• Definitely introduces an incompaRbility
• DeprecaRon-Migrate-Remove cycle
What about legacy? Can we drop features?
• Deprecate in 1.7
• Provide automated migraRon
• Elevate to error in 1.8
• Provide a flag to demote back to warning
• Keep automated migraRon
• Delete in 2.0
WARNING: Use with care! Dropping features is painful for the users.
Experimental features
• Design -> Implement -> Test -> Release With no Guarantees
• Example: CorouRnes
• Completely usable, but the design may change
• Requires an explicit opt-in
• We’ll try to minimize the migraRon pain
community
• Kotlin ♥ You J