Design Notes: Local Lifetimes for Kotlin
The article discusses ongoing research on local lifetimes in Kotlin, a feature aimed at enhancing safety in programming. It introduces the 'local' keyword to restrict function parameters to local usage, preventing them from escaping their context. The document invites community feedback before formalizing the proposal.
- ▪Local lifetimes are designed to allow safe usage of objects and operations for a limited time.
- ▪The 'local' keyword restricts function parameters to ensure they do not escape their call context.
- ▪This proposal builds on the existing callsInPlace experimental feature, integrating locality directly into the type system.
Opening excerpt (first ~120 words) tap to expand
Design Notes: Local Lifetimes for Kotlin Type: Design Notes Author: Ross Tate Contributors: Komi Golova, Mikhail Zarechenskiy, Alejandro Serrano Mena, Marat Akhin Discussion: #485 Abstract This document summarizes ongoing research on local lifetimes, a feature that enables programmers to safely take advantage of objects and operations that are only safe to use for a limited time. Disclaimer This work is still research in progress. We are sharing it early because we want to collect feedback (hopes, concerns, suggestions, and so on) from the community before determining whether to develop it into a formal proposal.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at GitHub.