salomonbrys
11/03/2026, 8:58 AMNetworkModule.httpClient(), not just any HttpClient. The meaning of a dependency comes from the member's name.
⢠_Composable modules_: modules are interfaces, so interface AppModule : NetworkModule, DatabaseModule just works.
⢠_Light presence_: your business classes do not know about the modules. @DIFactory builds them from a module for you (no more uggly KodeinAware).
⢠Bindings are values, with native support for suspend bindings, extension and overwrite, and per-module scoping.
Inara is also opinionated, which is the biggest change in philosophy: no mutable modules, no global modules. With Kodein, I wanted a "universal" tool, and I made concessions along the way (especially by adding new behavior every time I was asked to). A good tool is defined as much by what it does not do as by what it does. In short, I want to write code that is, in order of importance, correct, isolated, idempotent, and only then easy to write.
That is why we see more future in Inara: Kodein was my first library, and Inara is the one I would write today.
Links
⢠Announcement article: Inara: Inject your dependencies at compile time
⢠Inara on GitHub
⢠Inara documentation
Moving to Koin
If you like how Kodein worked and how it architected your modules and applications, we warmly encourage you to migrate to Koin. It supports everything Kodein does, and much more, with better optimizations and integrations. Here is a guide to get started: Introducing the Koin migration skills.
Thank you
A heartfelt thank you to every developer who trusted us with Kodein DI over the years: for using it, for reporting issues, for your contributions and for your patience. Kodein exists because of you, and we are very grateful.
I would love to hear what you think of Inara. Questions and feedback are very welcome in this channel!ian.shaun.thomas
11/04/2026, 12:24 AMrocketraman
11/08/2026, 6:42 PMsalomonbrys
11/08/2026, 8:02 PMrocketraman
11/09/2026, 7:55 PMSet<AppService>, and library modules (JDBC pool, Flyway, Exposed) each add a service to it.
⦠Kodein: the library opens the set, each module adds its own service, and the app just imports the modules.
⦠Inara: the app has to list every service itself, the librariesā ones too. Forgetting one still compiles, and that service never starts.
⢠Libraries canāt ship default bindings.
⦠Kodein: a library module binds its singletons itself.
⦠Inara: the library can only offer bindings from its companion, because a getter default runs on every access and canāt hold a singleton. So the app passes every binding by hand.
⦠Suggestion: let a parent interface declare a default Binding that the generated builder uses as the parameterās default. That would shrink app modules a lot.
⢠One flat namespace, and no qualifiers or optional bindings.
⦠Kodein: bindings are keyed by type, and optional ones are a simple `instanceOrNull`.
⦠Inara: all parentsā members merge into the appās module, so library members need prefixed names (startOrderTiebreaker), and āoptionalā means a getter default.
⦠Kodein also reads the tiebreaker from config automatically when a ConfigBinder is bound. With Inara the app has to opt in explicitly.
⢠What worked well:
⦠A @DIModule collects members from parent interfaces that arenāt annotated, so libraries need no KSP.
⦠The contravariant Binding<M, ā¦> lets a library binding typed on its own interface plug straight in.
⦠Diamond inheritance works, and a missing binding is a compile error.
⢠Minor: the runtime is built with Kotlin 2.4 metadata, so consumers need at least a Kotlin 2.3 compiler.salomonbrys
11/10/2026, 11:32 AMnull value. I agree that this is not on par with Kodein, but that is by design.
Multibindings: This is tricky, because it touches on precisely what we decided Inara was not: a runtime service locator.
What you can do with Inara right now, with composable modules, is create a set and have module creation functions that fill the set. Here's an example on how to do that.
The whole point of Inara is to have everything resolved at compilation only via generated code. So what we could add is a compile-time locator pattern. This would require you to create a custom annotation for located services. Here is a sample proposal. What do you think?
Kotlin 2.4 metadata: the first release version may be compatible with Kotlinās new companion blocks (Iām still considering it), so it may be released with Kotlin 2.5 metadata.rocketraman
11/11/2026, 5:31 AM@DIModule(composed = true) works, including a composed module used as the parent of another. But Iāve run into the diamond inheritance restriction documented at https://kosi-libs.org/inara/0.2/core/composition.html#_restrictions. The current workaround Iāve implemented is that each module takes it as a builder parameter instead.
⢠Optional bindings: these are now builder parameters with defaults. That works fine.
⢠Multibindings: For now, Iāve implemented your suggested approach with some minor tweaks ā see below for my comments on the compile-time locator proposal.
On diamonds: I see theyāre rejected currently and I get why. But the module declarations become quite a bit less elegant because of the need to manually pass in the dependent modules rather than Inara handling the dependency. What if the user could declare āpartialā modules that can only be composed? KSP would then require the composed module to supply that ancestor exactly once, e.g. through another parent. That stays fully compile-time, since thereās never a second instance. Example:
Example from Bootable ā here the Flyway and Exposed modules both declare the JdbcDataSourceModule parent they need without building it.
A partial module canāt be built on its own, only composed. When KSP generates AppModule, it requires exactly one parent to supply each unbound parent of a partial parent. If none or more than one do, thatās a compile error. Thereās never a second JdbcDataSourceModule, so dataSource is never ambiguous. This would simplify my AppModule declaration a lot, getting it close to the Kodein DSL in simplicity and clarity.
> So what we could add is a compile-time locator pattern. This would require you to create a custom annotation for located services. Here is a sample proposal.
The compile-time locator proposal makes sense, with two considerations:
1. In Bootable, the @AppServices members are in published library jars, and only the app runs KSP, so the processor has to read the annotation from the classes on the classpath.
2. Only the composed module can call locateAppServices(), but in our case its the framework parent BootableModule that needs the set, and child modules contribute to it. Could the locator implement a declared member instead? For example, BootableModule declares @AppServices val appServices: Set<AppService>, and the composed moduleās generated code fills it in from its parentsā @AppServices members. Thatās essentially Metroās `@IntoSet`: a set whose members are all known at compile time.
If you have time, Iād appreciate a review of the draft PR, especially whether the library modules use Inara the way you intended. Some key files are:
⢠boot-config-common/src/inara/.../ConfigModule.kt
⢠boot/src/inara/.../BootableModule.kt and Acceptors.kt
⢠boot-db-jdbc/src/inara/.../JdbcDataSourceModule.kt
⢠boot-db-flyway/src/inara/.../FlywayMigrationModule.kt and boot-db-exposed/src/inara/.../ExposedDatabaseModule.kt
⢠examples/server-ktor-db/inara/src/main/kotlin/App.kt
You can find all the Kodein and Metro equivalents by replacing inara in the paths with kodein and metro. There is also the vanilla no-DI version of the example to directly see the relationships.
⢠Kodein App.kt
⢠Vanilla App.ktarnaud.giuliani
11/12/2026, 5:41 PMrocketraman
11/12/2026, 7:28 PM