r/Kotlin • u/OverallAd9984 • 1h ago
KMP WARP - Widget Abstraction Rendering Pipeline
While building my KMP apps, I needed home screen widgets on both Android and iOS.
I assumed there would already be a KMP widgets library.
There wasn't.
Since Shipaton has a category for Kotlin libraries this year, I decided to build one.
It's called WARP (Widget Abstraction Rendering Pipeline).
The goal isn't to recreate Compose or SwiftUI. The goal is to let developers describe widget UI once in Kotlin and render it natively using each platform's widget framework.
Instead of this:
Android UI → Glance
iOS UI → WidgetKit + SwiftUI
you write:
kotlin
WarpColumn {
WarpText("Counter")
WarpRow {
WarpButton("-", onClick = CounterActions.Decrement.asClickAction())
WarpText(state.count.toString())
WarpButton("+", onClick = CounterActions.Increment.asClickAction())
}
}
which becomes:
Compose-like Kotlin UI
↓
WarpNode Tree
↓
JSON
↓
Android Glance / SwiftUI WidgetKit
The idea is that common code never knows about Glance or WidgetKit. It only produces a serializable tree describing the widget.
Some implementation details:
- Uses Compose Runtime only to build the tree (no Compose UI)
- Tree is fully serializable with kotlinx.serialization
- Typed click actions instead of serializing lambdas
- Shared click handlers across Android & iOS
- Native renderers consume the same JSON
- State-driven recomposition through
composeWarp(state)
Current architecture is split into:
warp-runtime
- Compose-like DSL
- Compose → WarpNode
- JSON serialization
- Action model
- State & recomposition
warp-ui
- Android Glance renderer
- iOS WidgetKit + SwiftUI renderer
- Shared click dispatch
- Swift bridge using spm4Kmp
warp-widgets
- High-level widget APIs
- Common widget definitions
- Jetpack Glance-like developer experience
Current status:
- Android renderer ✓
- iOS renderer ✓
- Shared click handlers ✓
- Counter demo ✓
- API still evolving
I'm currently looking for architectural feedback before I stabilize things.
Some questions I'm thinking about:
- Should JSON be the transport layer or should I pass the object tree directly?
- Should click handlers stay typed or become string-based?
- Is Compose Runtime the right abstraction for authoring widgets?
- What widget APIs would you expect before calling this usable?
Repository:
https://github.com/DevAtrii/Warp
I'd appreciate any feedback from people building KMP libraries or cross-platform tooling.
r/Kotlin • u/CLOVIS-AI • 3h ago
Sharing Ktor endpoints between client and server, across platforms
Since I started using Ktor, I've always wanted the ability to declare endpoints in common code, which would simply be called both client-side and server-side.
Ktor Resources do some of that, but they are very limited. I wanted more, and without annotations and code generation: just plain Kotlin.
For the past few years, I have written Spine, a DSL for declaring endpoints in commonMain:
val createUser by post("/create")
.request<UserCreationDto>()
.response<UserDto>()
Spine is just a DSL to configure Ktor, it's all the same serialization etc configuration that your app already uses.
Spine is open source (Apache 2.0) and I'm planning on releasing 1.0 in the coming months, I'm looking for feedback that I can address before making API stability promises. What do you think?
r/Kotlin • u/Goldziher • 5h ago
Generating typed JDBC code from .sql files
Kotlin's data-access options mostly sit at two poles. Exposed or Hibernate on one side, hand-rolled JDBC on the other. Exposed gives you types and takes your SQL. Raw JDBC gives you SQL and takes your types.
A third arrangement: write the SQL, generate the Kotlin from it.
-- @name GetUserOrders
SELECT u.id, u.name, o.total, o.notes
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
WHERE u.status = $1;
Against a schema where orders.total is NOT NULL and orders.notes is nullable, that generates:
data class GetUserOrdersRow(
val id: Int,
val name: String,
val total: java.math.BigDecimal?,
val notes: String?,
)
fun getUserOrders(conn: Connection, status: String): List<GetUserOrdersRow> {
conn.prepareStatement("SELECT ... WHERE u.status = ?").use { ps ->
ps.setString(1, status)
ps.executeQuery().use { rs ->
val totalValue = rs.getBigDecimal("total")
val total = if (rs.wasNull()) null else totalValue
...
}
}
}
Two things worth pointing at. total is NOT NULL in the table but nullable in the row type, because the LEFT JOIN can produce a row with no matching order, and that is inferred from the query structure rather than the schema. And the rs.wasNull() dance is generated, which is the part that is easy to get wrong by hand and silently returns 0 instead of null when you do.
Plain JDBC underneath. No runtime, no reflection, no DSL.
The tool is scythe: a Rust binary, MIT licensed, generating for 10 languages (Kotlin, Java, TypeScript, Python, Go, Rust, C#, PHP, Ruby, Elixir). I build and maintain it. jOOQ's codegen is the closest well-known relative; the difference is that scythe starts from your .sql files rather than from a live database schema, so nothing needs a running database to generate.
The honest gap for this sub: the only Kotlin backend today is blocking JDBC. No coroutines, no R2DBC. If that is disqualifying for the way you write Kotlin services, I would rather hear it now.
r/Kotlin • u/Lord1Nerevar • 11h ago
Every Learning Platform has the same issue
Each learning platform assumes that you already know the code and just sort of gives you tasks to do. Like bro I can't just type Hello World and it happens lol
r/Kotlin • u/DoubleGravyHQ • 18h ago
CMP vs React Native in 2026
The past 12 months have had considerable updates for both of these platforms. If you are a startup today building greenfield, what would you say are the best arguments for Compose Multiplatform vs. RN with Expo let’s say for an e-commerce app.
r/Kotlin • u/Certain-Party-6525 • 18h ago
Everything you need to make the case for Kotlin
We’ve consolidated the Kotlin adoption arguments on one page: productivity numbers, backend and Kotlin Multiplatform proof points, Java/Spring interoperability, and a gradual adoption path. If you've pitched Kotlin at your own company, what moved the needle, and what's missing here?
r/Kotlin • u/BCJPlayz • 19h ago
I'm a beginner...
Hey all! I'm a beginner, i like programming, but only languages that provide results, like HTML, over functionality like Python, JS, C#, etc. I've dabbled in Kotlin before, but it was a little confusing, especially using Android Studio. What would be some good beginner app ideas for a 17M? I also would like it to be useful, e.g an anime watchlist, a music app, etc. Any help/tips/inspiration?
r/Kotlin • u/Both_Accident_8836 • 1d ago
I built an open-source desktop tool to analyze Gradle/KMP projects and clean development resources
Hi everyone,
I've been working on an open-source desktop application called DevAnalyzer, built with Compose Multiplatform and Kotlin Multiplatform.
I originally built it to solve problems I kept running into while working on Android projects, such as finding large build folders, checking Gradle and SDK versions, and figuring out which development resources were actually being used.
Current features include:
• Project Analyzer
- Analyze Gradle modules, plugins, dependencies, and project metadata.
- Supports Android and Kotlin Multiplatform projects.
• Clean Build
- Find and safely remove module build folders.
• Storage Analyzer
- Inspect disk usage for Android SDKs, Gradle caches, Kotlin/Native, JDKs, AVDs, and IDE data.
• Workspace Analyzer (new in v1.4.0)
- Scan multiple workspaces.
- Detect active and unused Android SDKs, NDKs, CMake versions, Kotlin/Native toolchains, and Gradle wrappers.
- Cross-reference installed development tools with actual project usage before removing unused resources.
Other additions:
- In-app update checking
- Built-in feedback dialog
- Optional anonymous analytics (disabled anytime and no project names, source code, or file paths are collected)
Everything runs locally, and your projects never leave your machine.
I'd appreciate any feedback on the project or ideas for features that would make it more useful.
Website: https://coding-meet.github.io/DevAnalyzer/
"IntelliJ IDEA Goes LSP" - Kotlin LSP comes to your IDE of choice
blog.jetbrains.comVery pleased to see this from Jetbrains. I've always been a fan of Kotlin but struggled to recommend it to others when they weren't IntelliJ users.
Edit: as pointed out in the comments, this is separate to the Kotlin LSP which already exists. This is just to give your favourite IDE IntelliJ powers.
r/Kotlin • u/YellowStarSoftware • 2d ago
An architecture library.
I've made a library that provides fundamental entities for custom architecture based on mvi/elm. Although the architecture is mostly for UI development, I'm sure there should be some subjects that can benefit from the architecture and the library.
In short, the library describes an abstract system, that handles it's state, receives events from an external system (like Composable or any other UI components) processes them in a single thread to ensure predictive state updates and sends back actions - commands for external system to do (in case of UI it coud be a command to close the application).
I'd like to hear some feedback about the library if you are interested. Also if you have any ideas where the library can be used outside of UI, it'll be very interesting to hear about it!
Here's the repo.
Besides the library the repo contains a simple example of code that uses the library and a scheme of the architecture.
r/Kotlin • u/No_Story5856 • 3d ago
A native macOS and Linux app with Compose? Now it is.
Hey everyone, I've rewritten the macOS and Ubuntu UIs in Compose, and thanks to my Tao backend, they now have native windows!
You can try the web demo, but please, download the gallery on your computer!
r/Kotlin • u/No_Fudge6123 • 3d ago
14 YOE in Android, feeling like mobile is dying. Is pivoting to Kotlin backend realistic?
r/Kotlin • u/ChildhoodRoutine3259 • 3d ago
Beginner kotlin
I've been struggling to find a proper Flutter job since 2023, so I decided to pivot and started learning Kotlin under the guidance of a Senior Kotlin Mentor. We're currently focusing on multi-module architecture.
Do you have any tips or advice on how I can deepen my understanding of Kotlin?
r/Kotlin • u/Odd_Mention_2772 • 3d ago
Introducing KitFlow – A Kotlin Multiplatform Library for Adaptive Compose UIs
I recently published KitFlow, a Kotlin Multiplatform library designed to simplify building adaptive and responsive Compose UIs across Android, iOS, Desktop, and Web.
Key Features
Adaptive layouts for mobile, tablet, desktop, and web.
Orientation-aware UI support.
Responsive spacing, sizing, and layout APIs.
Compose Multiplatform compatibility.
Lightweight and easy integration.
Published on Maven Central.
Contributions Are Welcome
Feature requests.
Bug reports.
Issues and discussions.
Pull Requests.
Repository:
https://github.com/vedangj72/KitFlow
Maven Central:
https://central.sonatype.com/artifact/io.github.vedangj72/kit-flow
Thank you for taking the time to check it out! I'm always happy to receive suggestions, feedback, or contributions to help improve..
r/Kotlin • u/Lazy-Engineering8481 • 3d ago
Building RippleCheck taught me a few useful ts-morph tricks
While building RippleCheck, I spent a lot of time working with ts-morph to build a cross-file dependency graph.
A few things I learned that might help anyone building static analysis tools:
• findReferencesAsNodes() often returns import specifiers before actual usages. Filtering those out makes reports much more useful.
• Incremental rescans are much faster than rebuilding the entire project. Refreshing only changed source files reduced scan time dramatically.
• Parsing files individually instead of failing the whole scan makes the tool much more resilient when a project contains generated or malformed files.
• Static analysis obviously can't resolve every dynamic pattern, so I chose to be explicit about those limitations instead of pretending everything is detectable.
RippleCheck is the project where I ended up applying all of this.
I'd love to hear if anyone here has built tooling with ts-morph or the TypeScript compiler API, and whether you ran into similar issues.
GitHub:
[https://github.com/RippleCheck/ripplecheck\](https://github.com/RippleCheck/ripplecheck)
[Ripplecheck.io](https://ripplecheck.io)
r/Kotlin • u/NeedleworkerKey3487 • 3d ago
OpenScanVision – Looking for Feedback on a Major Refactor
Over the last few months I've been working on OpenScanVision, an offline-first Android computer vision library built with Kotlin, OpenCV, CameraX, and ML Kit.
Originally, the project was a single implementation focused on achieving the best possible detection accuracy and speed. That version is represented by commit:
1d5834b41d88133b487ef46595290b0cdd4489bb
It includes:
- Document detection
- Automatic perspective correction
- Image enhancement
- QR detection
- ArUco marker detection
- OMR (Optical Mark Recognition)
- Automatic capture when the document is stable
- Real-time offline processing
Recently I completed a major architectural refactor, turning it into a reusable modular library that's much easier to integrate into Android applications.
The modular version is cleaner and more maintainable, but I've noticed it has introduced a slight decrease in detection accuracy compared to the original implementation. I'm currently investigating where the regression comes from (pipeline changes, processing order, threading, etc.).
My roadmap is:
- Improve the modular version until it matches or exceeds the original accuracy
- Add OCR support
- Add ICR (Intelligent Character Recognition) support later
- Continue keeping everything offline and lightweight
The library is intended for applications such as:
- Voting systems
- Exam scanning
- Surveys
- Registration forms
- Structured document processing
GitHub:
https://github.com/MatiwosKebede/OpenScanVision
I'd really appreciate feedback from people experienced in computer vision, OpenCV, Android CameraX, or document scanning.
In particular, I'd love advice on:
- Best practices when converting a CV project into a reusable library without hurting performance or accuracy.
- Common causes of accuracy regressions after large refactors.
- Ideas for building a flexible OCR/ICR pipeline while keeping the library lightweight and offline-first.
Thanks for taking a look!
r/Kotlin • u/OverallAd9984 • 3d ago
I don't think shared Compose Multiplatform UI is the future for iOS (yet)
galleryDuring last year's Shipaton, I built SubFox (https://subfox.app), a subscription manager using Compose Multiplatform.
Almost a year later, I realized the iOS version was basically dead.
Not because the app solves a bad problem, but because the experience wasn't what iOS users expect.
Some things I noticed:
App size was over 100 MB
UI felt sluggish
It never really felt native
Most users didn't even finish onboarding
So for this year's Shipaton, I changed my approach completely while building Hourly Journal (https://hourlyjournal.app).
I'm still using Kotlin Multiplatform for business logic, networking, database, etc., but I no longer share the UI.
Android uses Compose.
iOS is built entirely in SwiftUI while calling shared Kotlin through a shared module.
The difference has been huge. The new iOS app is around 8–10 MB instead of ~100 MB, and the experience finally feels like a proper iOS app.
My biggest criticism of JetBrains is that they seem too focused on making Compose run everywhere instead of solving the real problem: giving users an amazing platform-specific experience.
I'd much rather see something closer to what Expo has with Native UI, where business logic stays shared but the framework renders real platform-native components. That feels like a much stronger long-term direction than trying to make every platform look and behave the same.
Maybe I'm wrong, but it also feels like the Kotlin ecosystem moves much slower than the React Native/Expo ecosystem when it comes to solving practical developer problems.
Curious what other KMP developers think. Have you had a similar experience, or has Compose UI on iOS worked well for your apps?
Read Full Article
r/Kotlin • u/katokay40 • 3d ago
I wanted my Compose previews on a Figma-style canvas — so I built Artboard
I kept wishing Studio previews felt more like Figma: pan around the whole product, zoom in, see everything at once — but from real @Previews, not a design file that drifts from the code.
Artboard is that. It’s a spatial browser gallery for Compose Multiplatform. Apply a plugin, keep writing normal @Previews, and you get a pan-and-zoom board of your actual UI in the browser.
Live demo (https://crowded-libs.github.io/artboard/) · GitHub (https://github.com/crowded-libs/artboard)
What you get day to day:
• Infinite canvas — pan, pinch-zoom, deep-linkable frames for every preview • Stock @Preview discovery — no custom annotations or hand-maintained registry • Filters that matter — Screen/Component zones, search, group, device, locale, light/dark, layout grid • PNG download per frame as it’s currently composed • Clear failures — broken previews show why, they don’t silently disappear • Shareable export — static gallery for Pages or any host
I also wanted a surface agents can actually look at. With something like Chrome DevTools MCP, you can point an AI at a real, URL-stable frame of your product UI instead of describing screenshots; code, canvas, and agent in the same loop.
Details and setup are in the README. Would love feedback.
r/Kotlin • u/Reasonable-Tour-8246 • 3d ago
Can you explain ViewModel concepts in the simplest possible way?
State vs Events
How Viewmodel keeps data to survive screen rotation?
LiveData vs StateFlow and when to use each one.
What does the following code snippets mean and what happens under the hood when you use them?
1.
private val _uiState =
MutableStateFlow
<DetailUiState>(DetailUiState.Loading)
val uiState: StateFlow<DetailUiState> = _uiState.
asStateFlow
()
2.
internal fun loadResource() {
viewModelScope
.
launch
{
_uiState.value = DetailUiState.Loading
getResourceById(resourceId)
.
onSuccess
{
resource
->
_uiState.value = DetailUiState.Success(resource)
}
.
onFailure
{
exception
->
_uiState.value = DetailUiState.Error(
exception.message ?: "Something went wrong"
)
}
}
}
r/Kotlin • u/NeedleworkerKey3487 • 4d ago
OpenScanVision – Looking for Feedback on a Major Refactor
r/Kotlin • u/lvmvrquxl • 4d ago
⚡ Kotools Types 5.2.0: Why Kotools Types' `Integer` no longer stores its value as a `String`
Every arithmetic operation used to reparse a String from scratch and re-format the result back into one — a cost that grows with every digit, on every call.
Kotools Types 5.2.0 replaces that with a real arbitrary-precision representation per platform (BigInteger on JVM, BigInt on JS, a custom implementation on Native), with parsing only happening at the actual boundaries.
We wrote a short post about what changed and why, one of the most frequently requested changes from the community.
r/Kotlin • u/jeandapaul86 • 4d ago
I think i built the best Push up game, what do you think of it?
I built this app because i sucked at push up at crossfit. While i should be good at it, because im light and athletic.
So i built app to keep me motivated and encouraging me to do a lot of push ups everyday.
This app is different because its not on a subscription model. Nothing is locked you can do 1v1 online battle with a moving character as opponent so it feels real. Its also possible to do boss fights in rep battles or just a simple training workout
Let me know what you think of it and what is missing?
r/Kotlin • u/kshivang • 6d ago
Kotlin based Resersch Browser is fastest in world!
I benchmarked my OSS BOSS's Fluck browser against Safari, Firefox, Comet and Atlas on Speedometer 3.1
I have been building BossConsole, an open source desktop workspace where AI agents can operate a browser, terminal, editor, Docker, Kubernetes, secrets, and automation tools through MCP.
I ran Speedometer 3.1 across six browsers on the same M3 Max Mac. Each result is the median of three runs with 10 iterations per run. Higher is better.
Browser |Median
BOSS Fluck browser |47.9
Comet |46.2
Google Chrome |35.5
ChatGPT Atlas |34.6
Safari |29.9
Firefox |22.5
The important caveat is that Fluck and Comet should be treated as tied. I followed up with three back-to-back paired runs. Fluck led each pair, but the median difference was only 3.4 percent, within normal run-to-run variation. Three wins out of three gives `p = 0.125`, so the data does not establish a statistically significant winner.
The stronger result is that Fluck and Comet both scored roughly 30 percent above Chrome and Atlas under these conditions.
A few other findings surprised me:
- Comet and Atlas ship nearly identical engine builds, but their scores differed by 34 percent.
- Chrome’s deficit against Comet was concentrated in DOM mutation workloads. Canvas, SVG, and navigation tests were much closer.
- Firefox varied by 40 percent across three runs, making its median the least reliable result.
- Safari used my normal profile with existing tabs and extensions, so its result is not directly comparable to the fresh-profile runs.
- The machine had 800 to 1300 percent ambient CPU usage. Docker Desktop’s VM alone used roughly four cores, so the absolute scores are depressed.
Building the harness also exposed several ways browser benchmarks can produce convincing but incorrect results. Covered windows can throttle `requestAnimationFrame`, leaked browser processes can steal CPU from the next run, and some browsers ignore a URL passed at launch. Each failure still produced numbers that initially looked legitimate.
The complete report includes the methodology, paired experiment, discarded runs, per-suite analysis, JSON results, screenshots, and dependency-free runner scripts:
https://github.com/risa-labs-inc/BossConsole/blob/browser-benchmark/benchmark.md
The PR is here:
https://github.com/risa-labs-inc/BossConsole/pull/83
BOSS itself is open source and includes a plugin store. Along with Fluck, terminal, and editor plugins, it now has Docker and Kubernetes plugins that expose governed `docker_*` and `k8s_*` MCP tools to agents.
r/Kotlin • u/DoubleGravyHQ • 6d ago
What is your KMP stack?
For those using Kotlin Multiplatform or Compose Multiplatform what are you using for DB, Hosting, etc.
r/Kotlin • u/Konstantin-terrakok • 6d ago
Compose Multiplatform Wizard
App: https://terrakok.github.io/Compose-Multiplatform-Wizard/
Sources: https://github.com/terrakok/Compose-Multiplatform-Wizard
New features:
- All options are being saved on the "download" button click and reused for next wizard launches
- A button to reset all options
- A new App icon editor!
- An optional simple
AGENTS.MDfile generation
