Professional Documents
Culture Documents
The Future of Kotlin: How Agile Can Language Development Be?
The Future of Kotlin: How Agile Can Language Development Be?
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/Native
• Technical Preview (Apr 2017)
• No VM
• Our own memory management
• Direct C interop
• Standalone executables
• Direct compilation to Linux/Mac/iOS/Raspberry Pi
• Uses LLVM
Plans & Vision
Strategic directions for Kotlin
The Two “Dimensions”
Paradigms
Metaprogramming
F
Coroutines
v 1.1
Scripting
Functional
OOP
Platforms
Web Client
Android Client
(JS/WASM)
Server
(JVM or Native)
Desktop Client
iOS Client
(JVM or Native)
• Server-side/Microservices
Paradigms
OOP -> FP -> Scripting -> Coroutines -> Metaprogramming
Coroutines
• Almost-free threads
• Straightforward asynchrony
• On all platforms
• JVM & JS: already supported
• Native: WIP
Example: 100’000 Coroutines
val jobs = List(100_000) {
async(CommonPool) {
delay(1000L)
1 Can’t be done
} with threads:
}
OutOfMemoryError
println(
jobs.sumBy { it.await() }
)
Going Meta
Future metaprogramming features of Kotlin
Traditional Approaches to Metaprogramming
• Reflection
• Bytecode processing/instrumentation
Jedi Metaprogramming
• Macros
• Compiler runs some of your code
• Multi-stage languages
How do I make
• You don’t want to
an know
IDE now?
The Kotlin Way: No Macros
• Plugins for Compiler/IDE
• Uniform API, must support IDE features
• Reflection, of course
• May have limitations on some platforms
To Infinity and Beyond
Other Language Enhancements
Some more plans
• Value Types & Inline Classes
• Compact storage, newtype, return several things from a function…
• Type Classes / Concepts
• Structural types, Non-intrusive interfaces, Extension-friendly
• Immutable data
• For error-proof sharing, Optimizations, ...
• Scripting
• Performance, REPL, ...
Immediate Future: Kotlin 1.2
• Focus on maintenance
• Performance is a priority
• Bugfixes, infrastructure, some tooling improvements
Legacy
Can we just drop it?
Users won’t like it…
Compatibility Constraints
• Both ways: for 1.X.X updates
• Fixes
• Optimizations
• Tooling features
• Delete in 2.0
WARNING: Use with care! Dropping features is painful for the users.
How agile can
language
development
be?
Compatibility vs Innovation
Waterfall or Agile?
☹Waterfall
• Design -> Implement -> Test -> Release
• Ivory Tower
☺Agile
• Design -> Prototype -> Get Feedback -> Redesign
• What about compatibility?
community
How agile can we be?
• Open design process
• KEEP = Kotlin Enhancement & Evolution Process
• Experimental features
• Completely usable, but the design may change
• Requires an explicit opt-in
• We’ll try to minimize the migration pain
Summary
• Agility in design & development
• Open design process: KEEP
• Experimental features
• Deprecation cycles
• Migration tools
community
• Kotlin ♥ You