r/Kotlin • • 20h ago

Value classes in Kotlin 2.5.0 and beyond

Thumbnail blog.jetbrains.com
72 Upvotes

r/Kotlin • • 14m ago

Yet another kotlin lsp written in Rust

1 Upvotes

TL;DR: A new, full-featured and lightweight Kotlin language server, written in Rust.

Site: https://bash-spbu.github.io/kotlin-analyzer/
GitHub: https://github.com/bash-spbu/kotlin-analyzer

Pros:

  • Feature-rich: nearly all of LSP 3.18 that applies to Kotlin (hierarchies, inlay hints, semantic tokens, code lenses, organize imports…), plus its own debugger, decompiler, ktfmt-compatible formatter and an MCP server for AI agents.
  • Fast and light: one native binary, no JVM of its own. Hover and go-to-definition answer in ~0.1 ms (p50), edits get fresh diagnostics in ~2 ms; ktor's 2,300 files load in 2.6 s and take ~200 MB. Library indexes are kept on disk.
  • Built the rust-analyzer way: incremental, query-based (Salsa), with a typed syntax tree and per-module name resolution.
  • Runs where you work: macOS, Linux and Windows; VS Code, Neovim, Helix, Zed and Claude Code extensions, plus any LSP client; Gradle and Maven; Kotlin/JVM, Android and Multiplatform.
  • Open and AI-extensible: Apache-2.0, with a spec of every feature and agent docs, so your agent can add what your project needs.

Cons:

  • Diagnostics report only what the analysis is sure of. You won't get every compiler error, as with JetBrains' kotlin-lsp.
  • Daily use has mostly been Zed on macOS with large Gradle Spring Boot projects. Android and KMP are benchmarked on nowinandroid, ktor and kotlinconf-app. Windows and Maven support is new in 1.3.0 and not yet battle-tested; Kotlin/JS, Wasm and Native libraries aren't read yet.

If you try it and hit a bug or a missing feature, please open an issue with a public project and a file/line that shows it. We'd really appreciate it!

A note on AI: most of the code was written by an AI coding agent (Claude Code), directed and reviewed by us. Every feature is specified first in docs/spec/, every change comes with fixture tests that fail without it, and diagnostics are checked at zero false errors on eight large closed-source Spring Boot projects. That same setup is what makes it easy for your own agent to extend.


r/Kotlin • • 21h ago

Nucleus 3.0 is out !

Thumbnail nucleusframework.dev
28 Upvotes

Hello everyone,
I’m pleased to announce the release of Nucleus 3.0.
A lot of ground has been covered since 2.5: more than 1,100 commits and 225 merged pull requests went into this release.
Stability was a major focus of this cycle. Hundreds of fixes went in, across rendering, windows, input, packaging and updates on all three platforms. Nucleus 3.0 is by far the most solid version we have shipped.
This release also brings many new capabilities: video and audio playback, widgets, biometric authentication with Face ID, Touch ID and Windows Hello, and direct publishing to the Microsoft Store, the Mac App Store and Flathub, all from Kotlin.
It’s also great to see Nucleus being adopted by more and more projects, such as Spotube, Tasks.org, AB Download Manager, Keyguard and SimpMusic.
The documentation is available at https://nucleusframework.dev/en/docs/
Your feedback is very welcome, whether it’s about what you build with it or any issues you run into.


r/Kotlin • • 13h ago

Compose Multiplatform App Wizard

Thumbnail gallery
6 Upvotes

https://terrakok.github.io/Compose-Multiplatform-Wizard/
Updated CMP Wizard!

  • Compose Multiplatform 1.13.0 — AppCDS/AOT for faster desktop app startup
  • Kotlin 2.5.0 — Kotlin/Wasm is now Stable; Swift Export is in Beta with a new DSL
  • Material3 1.13.0 — now stable
  • Navigation3 1.2.0 — Result API for passing results between screens; multiplatform Deep Link API
  • Metro 1.6.1 — much faster compilation of DI graph extensions
  • Gradle 9.9.3 — incremental compilation of Kotlin DSL scripts

r/Kotlin • • 5h ago

Fana Cumik: Open-source manga and webtoon reader sharing one Compose Multiplatform UI across Android, Desktop JVM, and WasmJs

Thumbnail gallery
1 Upvotes

I wanted to see how much of a media-heavy reader could run out of shared/ before platform differences forced separate UI layers. In Fana Cumik (v1.0.1), every screen from catalog search to reading history runs from one Compose Multiplatform codebase across Android, Desktop JVM, and WebAssembly (wasmJs), leaving only network engines, storage, window insets, and region tile decoders behind expect/actual contracts.

Two engineering problems shaped the codebase:

  • Blurry 16,000 px webtoon strips: Standard decoders cap vertical texture heights, which shrinks a 900 px wide strip proportionally and stretches it back up into muddy dialogue. Fana Cumik fetches encoded bytes into a bounded disk cache, then slices tall strips into 2048 px vertical ImageBitmap tiles using BitmapRegionDecoder on Android and off-screen Skia Surface drawing (SamplingMode.MITCHELL) on Desktop and Web. Removing per-item aspect-ratio wrappers keeps the tiles flush with zero hairline gaps.
  • Duplicate image requests during fast scrolling: ReaderImageController owns all page requests keyed by (url, targetWidth, targetHeight) and caps concurrency at 2 running jobs (at most 1 speculative preload). Scrolling a preloaded page into view promotes the in-flight job instead of firing a second HTTP GET.

Other technical details in v1.0.1:

  • Fractional webtoon scroll offsets and paged indices save to a single serialized SQLite connection (Dispatchers.IO.limitedParallelism(1)) on Android and Desktop, or localStorage on Web, every 2s and after 750ms of settle.
  • Global history compacts rows in SQL via ROW_NUMBER() OVER (PARTITION BY source_id, manga_id ...) so binge-reading does not flood the recent list while manga details keep per-chapter resume states.
  • Web deployment pairs wasmJs assets on Cloudflare Pages with two Functions to handle API proxying and upstream CDN CORS headers.
  • R8 shrinking keeps the signed Android release APK at 7.5 MB (AAB at 8.4 MB), alongside a 49.3 MB Desktop JAR and an 80.2 MB Linux x64 jpackage bundle.

Links:

If anyone here is shipping wasmJs or heavy image lists in Compose Multiplatform, I would appreciate feedback on the architecture and browser performance.


r/Kotlin • • 1d ago

I built and published a Jetpack Compose library for rendering streaming Markdown from Kotlin Flows

Thumbnail gallery
0 Upvotes

r/Kotlin • • 1d ago

Advent of Code Project Template

5 Upvotes

Last year I tried solving (most of) the advent of code challenges in Kotlin Notebook https://www.reddit.com/r/Kotlin/comments/1pe252t/solving_advent_of_code_in_notebooks/ but since they sadly have been sunset, this year I created (read "collaborated with AI") a template repo for you to get started. It has some cool functions I missed from %use adventOfCode in notebooks like submitting answers, waiting for the next day to release, etc.

Let me know if you have any improvements (or make a PR :p)

https://github.com/Jolanrensen/advent-of-code

(P.S. Seb is also doing livestreams again this year! :D https://www.youtube.com/watch?v=Z2kajEnLf3k&list=PLaREJ9wqJKLI )


r/Kotlin • • 2d ago

How JPA Defaults Broke Our Kotlin Microservice

Thumbnail shiftmag.dev
8 Upvotes

r/Kotlin • • 1d ago

Stream-Source: Virtual-Thread Friendly Data Streaming

Thumbnail reddit.com
1 Upvotes

r/Kotlin • • 2d ago

I built an OpenAPI generator that produces idiomatic Kotlin (KMP, Ktor client, Spring WebFlux)

13 Upvotes

I've been working on a Gradle plugin that generates Kotlin code from OpenAPI specs.

Why? Existing generators gave me Kotlin that felt like translated Java. I wanted proper data classes, sealed interfaces for oneOf, kotlinx.serialization, and KMP support.

Feedback, critique and feature requests welcome!

Features:

• OpenAPI 3.0 and 3.1, with oneOf → sealed interfaces

• KMP support and a shared model module for server and client

• Ktor client and Spring WebFlux server generators

• Built-in spec validator that can fail the build

• Custom type and schema mappings

Needs JDK 21+ and Kotlin 2.0+. MIT licensed.

GitHub: https://github.com/goquati/ogen


r/Kotlin • • 3d ago

Incrementally migrate from React Native to Kotlin Multiplatform

Thumbnail github.com
7 Upvotes

I've been working on an open-source project that enables gradual migration from React Native to Kotlin Multiplatform. It lets you call Kotlin functions and render Compose Multiplatform components directly from React Native on both Android and iOS, with automatically generated bindings.

The goal is to migrate one piece at a time until React Native can be removed entirely.

Would love to hear your thoughts!


r/Kotlin • • 3d ago

kSTEP v0.6.0: a type-safe Kotlin DSL for STEP (ISO 10303), now installable without building it from source

Thumbnail gallery
6 Upvotes

kSTEP is a type-safe Kotlin DSL for the STEP standard (ISO 10303), open source under Apache 2.0. You write product structure and geometry as a Kotlin script and get a STEP file. Until now you had to build it from source. v0.6.0 changes that. It is a pre-release, like every 0.x, and the API is unstable.

Install

  • Homebrew, macOS on Apple Silicon: brew install kstep-lang/kstep/kstep
  • APT repository for Ubuntu 26.04 x86-64 at https://apt.kstep.dev, signed with its own key; the same .deb is in the release
  • Containers: ghcr.io/kstep-lang/kstep-cli:0.6.0 (JVM only, amd64 and arm64) and :0.6.0-occt (with OpenCascade geometry, linux/amd64 only)
  • Scoop bucket for Windows: command line only, no geometry
  • Twelve library modules on Maven Central, group dev.kstep, without native libraries

The picture

A two-stage spur gear train: pinions with 10 teeth, gears with 20, module 2.5, involute teeth (each flank is one arc through points of the involute, not the exact curve). Pinion and gear are one part each, used twice, and the colour is set per use:

styleInstance(uA, StepColour.hex("#F39C12"))
styleInstance(uC, StepColour.hex("#F1C40F"))

Seven parts, fifteen uses in the assembly. It was built with the DSL and looked at in the viewer of kSTEP Desktop. It is a demo, not an engineered gearbox.

Checked

  • Homebrew on an Apple Silicon Mac: install, test, linkage, audit
  • The .deb and the APT repository in a clean Ubuntu 26.04 container (amd64, emulated): geometry available, STEP export with geometry, read back without findings
  • The -occt image, the same way; an anonymous pull of both image tags

Not checked, and the limits

  • Linuxbrew, and Scoop on Windows (never run there)
  • Native ZIP archives for linux-x86-64 and macos-aarch64 (unsigned, not notarized); a manual download and unzip was not tried
  • Sketches (PlaneGCS) from a package
  • No Intel Macs, no geometry on Windows, APT only for Ubuntu 26.04 amd64
  • The -occt image ships OpenCascade (LGPL-2.1 with exception); its source offer has not been reviewed by a lawyer
  • kSTEP Desktop has a built-in MCP server: an agent can read the open script, errors and parts; editing and file actions are separate opt-in switches. Unit tested, not yet tried with a real agent. No desktop download; it runs from source (./gradlew :kstep-desktop:run)

Details: https://kstep.dev/install · Source: https://github.com/kstep-lang/kSTEP

Criticism is welcome.


r/Kotlin • • 4d ago

GitHub - jbax/parent: A shared gradle build setup for java projects of any size, whether you're working on a single library, 100+ separate git repositories, or a few multi-module projects sitting side by side.

Thumbnail github.com
0 Upvotes

r/Kotlin • • 4d ago

How should static analysis reason about Jetpack Compose modifier chains?

4 Upvotes

I've been exploring static analysis for Jetpack Compose, particularly around identifying layout patterns that can cause problems on tablets, foldables, and resizable windows.

One interesting challenge is deciding when a fixed dimension is actually a problem.

For example:

Box(
    modifier = Modifier
        .fillMaxWidth()
        .height(600.dp)
)

This might be perfectly intentional for a particular UI component. But in another context, it could result in clipping or poor space utilization on larger screens.

Similarly:

Modifier.requiredSize(400.dp)

can override the normal constraints imposed by the parent.

The difficulty is that simply detecting calls such as height(), width(), or requiredSize() isn't enough to determine whether the code is problematic.

The surrounding modifier chain, parent constraints, and available adaptive mechanisms all matter.

I've been working on a small static analysis project using Kotlin and Gradle to explore these cases, and it has raised a few interesting questions:

  1. How much context should a static analysis rule consider before reporting a Compose layout issue?
  2. Is analyzing modifier chains sufficient, or should inspections also understand the surrounding composable structure?
  3. How would you approach reducing false positives when fixed dimensions are intentional?
  4. Would it make sense to model adaptive layout expectations as configurable rules rather than universal restrictions?

I'm particularly interested in how people approach these problems when building Kotlin-based static analysis tools.

Curious to hear your thoughts, especially from people who have worked with compiler plugins, PSI, UAST, or Compose tooling.


r/Kotlin • • 5d ago

bikesched 0.2: suspend lambdas and job batches spread across nodes, backed only by PostgreSQL

2 Upvotes

bikesched is an Apache-2.0 job scheduler for Kotlin and Java with durable steps, backed only by PostgreSQL. 0.2.0 brings two things for Kotlin users:

  • Suspend lambdas: handlers, steps, polls and compensations are suspend lambdas, so a Ktor client or a coroutine repository is called directly. Timeouts cancel the coroutine.
  • Job batches: a handler starts many child jobs as one durable step and waits for all of them. The items run as regular jobs, so they spread across all your nodes, not just the one that started the batch.
bikesched.handleJobs<Mail>("send-mail") { mail ->
    mailClient.send(mail)                            // a suspending call
}
 
bikesched.handleJobs<String>("newsletter") { subject ->
    val readers = step<List<String>>("readers") { subscribers.emails() }
 
    // one child job per reader, picked up by any node, at most 10 at a time
    val batch = startJobBatch<Mail, Unit>("mails", "send-mail", parallelism = 10) {
        for (reader in readers) item(Mail(reader, subject), key = reader)
    }
 
    // waits without holding a thread; throws if a mail failed for good
    batch.await().orElseThrow()
}

If the newsletter job is retried, it gets the stored reader list and batch back instead of starting the mails again.

Feedback wanted: still 0.x, so the Kotlin API can change easily. If something feels un-Kotlin-like, tell me.


r/Kotlin • • 5d ago

Why let your AI agent build UIs that don't match your taste?

Thumbnail youtube.com
0 Upvotes

Honestly, I got tired of arguing with my coding agent over padding, colors, and broken layouts in Jetpack Compose. Agents are great at writing logic, APIs, and state management, but asking them to guess how a screen should look usually takes 10 prompts and still looks generic.

So I flipped the workflow. Instead of prompting the UI, I built a small visual builder on my phone where I drag and drop the exact screens, bars, and colors I want, then scan a QR code to sync the whole project (screens, theme tokens, navigation, plus Room and DataStore) straight into Android Studio.

The plugin diffs everything locally so I can approve or reject each file before it touches my project. Once the UI and local DB are in place, I let my AI agent handle the actual business logic without hallucinating UI layouts.

Here is a quick unedited 2-minute demo of the flow from phone to running app:

https://youtube.com/shorts/W_3NWFafqkc?si=AtC-aVAIFtHHhRY_

I'm pushing this update out in the next few days. Curious how others here handle UI with coding agents—do you let the agent write it from scratch or build the layout yourself first?


r/Kotlin • • 5d ago

[OC] Compiler plugins are amazing

Post image
0 Upvotes

r/Kotlin • • 7d ago

🔍 How do you avoid duplicating data classes and mappers?

0 Upvotes

I'm building Kotools Facet, a KSP-based Kotlin SDK that removes data class duplication and mapper boilerplate. Declare a class once, and the SDK generates projections at compile-time.

It's still early, and I'd like to hear what Kotlin developers actually need before shaping v1.0.0. Here's the README.

What would stop you from replacing one of your mappers with this? Join the discussion.


r/Kotlin • • 8d ago

KotlinConf Black Friday: 35% off conference passes + 10% off workshop add-ons

Post image
6 Upvotes

Hey folks! Our Black Friday offer is live: 35% off conference passes and 10% off workshop add-ons. Get tickets by Sunday, November 29, 23:59 CET.

Join us in Kraków on April 21–23, 2027 for our annual full-stack conference. Meet professional developers from around the world and the team behind Kotlin, exchange ideas, and celebrate together!

The CfP closes November 27; volunteer applications are open until December 21.

Any questions? Happy to answer here.


r/Kotlin • • 8d ago

Gradle Compatibility Timeline

Thumbnail helpermethod.github.io
5 Upvotes

Slapped/slopped this together in an afternoon to see at a glance which Gradle version is compatible with which Java/Kotlin version. Thought it might be helpful to others.


r/Kotlin • • 8d ago

Kotlin Benchmark 2.0: How AI Coding Agents Handle Harder Tasks and Closed-Source Code

Thumbnail blog.jetbrains.com
25 Upvotes

r/Kotlin • • 8d ago

Built an offline-first RSS reader with Clean Architecture, Room, and Supabase looking for honest technical feedback

Thumbnail reddit.com
0 Upvotes

r/Kotlin • • 9d ago

Can the Kotlin types I use (List, data class) affect how often Compose recomposes?

4 Upvotes

I'm new to Compose and trying to understand recomposition. I've noticed that my screen state is a data class with a List inside it and I'm wondering if the type of collection matters for how Compose decides to redraw. Does it matter whether I use List a data class or something else? Or is that over-thinking it at my level?


r/Kotlin • • 9d ago

Dropping Material: a small custom design system in Jetpack Compose, using only CompositionLocals

1 Upvotes

I wanted my app to stop looking like every other Material 3 app, so I removed material3 entirely. The app depends only on runtime, ui, foundation and animation. The whole theme is about 420 lines of Kotlin. Here's how it fits together.

1. Tokens are plain u/Immutable data classes

The tokens are named by role rather than by Material slots like primary and surface:

data class SignalColors(
    val isDark: Boolean,
    val paper: Color,     // background
    val ink: Color,       // primary text
    val download: Color,
    val upload: Color,
    val warning: Color,   // only used for an over-budget forecast
    // …
)

The same pattern covers type, spacing, shapes and motion. Light and dark themes are just two instances.

2. One static CompositionLocal per token group

val LocalSignalColors = staticCompositionLocalOf { LightSignalColors }

object Signal {
    val colors: SignalColors
         u/ReadOnlyComposable get() = LocalSignalColors.current
}

Call sites read Signal.colors.ink or Signal.type.body, which looks like MaterialTheme with none of its baggage. I used staticCompositionLocalOf because these values almost never change, so a change recomposing the whole tree is acceptable.

3. A replacement for the ripple

Removing Material also removes the ripple, so I wrote an IndicationNodeFactory that draws a 10% ink wash over the pressed element. It's a Modifier.Node that collects PressInteractions and animates its alpha. It's provided once as LocalIndication, so every clickable uses it automatically.

4. One variable font, roles fixed in code

Mona Sans is a single variable font. FontFamily only resolves fonts by weight, so each type role is built as its own family, with width and optical size set in that family's FontVariation.Settings. Numbers use the wide width, body text the normal width, and the status-bar icon the condensed width.

5. Motion that follows accessibility settings

Motion tokens are tween specs. Compose already scales animation durations by the system animator scale. For animation it can't scale (a chart that scrolls continuously), a ContentObserver watches ANIMATOR_DURATION_SCALE and sets a reduced flag.

6. Plain JVM tests for the palette

A tiny WCAG contrast helper runs in ordinary JUnit tests, so a colour change that fails contrast also fails the build. No emulator is needed.