The Daily Kotlin
1.55K subscribers
55 photos
1 video
1 file
570 links
Kotlin Chats in Telegram:
RU https://kug.community/
EN https://kug.community/en

Kotlin news and tips
Download Telegram
I've been using @DslMarker for quite a while just to highlight my DSLs โ€“ see the screenshots for before/after. Obviously a dirty hack, but it worked surprisingly well (until it didn't: KT-81567).

If you'd like proper, configurable DSL highlighting in IntelliJ, upvote this ticket: KTIJ-34906 โ€” Uniform and configurable color for DSLs
๐Ÿ‘1๐Ÿ‘1
Stacks for Kotlin: Design Notes and Local Lifetimes for Kotlin: Design Notes

local parameters let the compiler prove a value won't escape a call. That single primitive unlocks: non-local return without inline, stack-allocated vararg, view types that can't outlive their source, builders that statically prevent receiver leaks.

Then Stacks build on it to make suspend just one of many possible suspension mechanisms. Each coroutine-like API (`Sequence`, Flow, deeply-recursive) gets its own typed continuation instead of fighting over the single global one. @RestrictsSuspension becomes obsolete. KT-3480 fixes itself. DeepRecursiveFunction shrinks 9ร—.
๐Ÿ”ฅ4๐Ÿคฎ1
๐Ÿคฏ2๐Ÿคฎ2โค1
Mellum2

Now open source on Hugging Face, Mellum2 is a 12B-parameter LLM built for:

โ€ข Routing and orchestration
โ€ข RAG pipelines
โ€ข Sub-agents
โ€ข Natural language and coding tasks

Powered by a new mixture-of-experts (MoE) architecture and optimized for ultra-low-latency inference.
๐Ÿ”ฅ6
Kotlin Toolchain 0.11: The Next Step for Amper

Released with a lot of new features and fixes
๐Ÿ”ฅ2
Kotlin 2.4.20-Beta1

https://github.com/JetBrains/kotlin/releases/tag/v2.4.20-Beta1

Major changes:

1. Context parameters going Stable. Explicit context arguments move to Stable โ€” the headline of the release. KT-86089

2. Companion blocks & extensions. A new language capability landing across the whole toolchain: resolution, reflection (call/callBy), light classes, REPL/scripts, metadata. Enable it with the new (off-by-default) flag -Xcompanion-blocks-and-extensions. KT-84289 KT-85187

3. Native: incremental compilation on by default. K/N builds are finally faster out of the box. KT-86657

4. when via invokedynamic on JVM 21+ by default. More compact bytecode, fewer synthetic classes. KT-78079

5. PowerAssert heading to initial release. Runtime ABI stabilized, runtime dependency added automatically. KT-86170 KT-85250

6. Lombok-style logging on Kotlin classes: @Slf4j, @Log4j2, @JBossLog, @Flogger, @CommonsLog, @XSlf4j, plus @Log and @ToString. KT-81622 KT-85762

7. Collection literals moving forward. Under -Xcollection-literals: type inference in delegate expressions, support in annotations, of operator via companion block. KT-84295

8. Name-based destructuring. Stabilization of the only-syntax variant (targeting 2.5). KT-86201

9. Kotlin/JS catches up. ES2015 syntax in the js() function, KDoc export to .d.ts, @JsExport for annotation classes. KT-21626 KT-56493

10. Stdlib. Common atomic types and a new StackTraceRecoverable interface. KT-62423 KT-86595

Bonus: official deprecation of the K1 compiler has begun (KT-75372), and experimental language version 2.6 was added (KT-85667).
๐Ÿ”ฅ7
Kotlin 2.4.10-RC

https://github.com/JetBrains/kotlin/releases/tag/v2.4.10-RC

As usual, a bug-fix release โ€“ but there's one interesting change I noticed:

Since the Kotlin Toolchain uses kotlin as its command name, the current kotlin command (which is the compiler) is being renamed to kotlinr. 2.4.10 is the first release that ships both: kotlin and kotlinr.
The package itself (e.g. brew install kotlin, sdk install kotlin) will be renamed to kotlinc. So the future end state for the ecosystem:


sdk install kotlin # install kotlin toolchain, command: kotlin
sdk install kotlinc # install kotlin compiler, command: kotlinr


A kotlinc package but a kotlinr executable โ€“ confusing, right?
๐Ÿค”9๐Ÿ”ฅ1
Some updates to new features timelines:

KEEP-0449: Companion extensions and blocks - experimental 2.5.0, stable 2.6.0 (preliminary)
KEEP-0462: Rich Errors, aka Error Union Types - experimental 2.5.0
KEEP-0450: Typed Delegate Access - experimental 2.5.20
๐Ÿ”ฅ5๐Ÿค”1