MEP-50 research bundle: Mochi to Kotlin transpiler
Author: research pass for MEP-50 (Mochi to Kotlin transpiler). Date: 2026-05-23 (GMT+7).
This bundle contains the twelve research notes that informed MEP-50, the Mochi-to-Kotlin transpiler. The notes are informative; the normative spec is in the MEP body.
| # | Title | Topic |
|---|---|---|
| 01 | Language surface | The Mochi language surface and its Kotlin 2.1 lowering obligations |
| 02 | Design philosophy | Why Kotlin, why the 2.1 floor with K2, why Channel + CoroutineScope over the deprecated actor { } builder, why all KMP targets |
| 03 | Prior art | Survey of source-to-Kotlin transpilers: J2K (IntelliJ Java-to-Kotlin), ts2kt, KotlinPoet, the Compose UI compiler, J2CL |
| 04 | Runtime | The MochiRuntime KMP Gradle module: kotlinx.coroutines, kotlinx.serialization, kotlinx.collections.immutable, kotlinx.datetime, Datalog, agent supervisor, JSONValue |
| 05 | Codegen design | IR-to-Kotlin lowering via KotlinPoet, ktfmt integration, aotir IR reuse |
| 06 | Type lowering | Per-type details for every Mochi type (Long, Double, String, List, LinkedHashMap, data class, sealed interface, custom actor class, Flow) |
| 07 | Target portability | KMP target matrix: JVM 17+, Android minSdk 24 / targetSdk 35, Kotlin/Native (iOS, macOS, Linux, Windows), Kotlin/JS (browser, Node.js), Kotlin/Wasm (Wasm GC) |
| 08 | Dataset pipeline | Query DSL lowering via Kotlin Sequence + Flow + kotlinx.collections.immutable; Datalog engine |
| 09 | Agents and streams | Mochi agents as a custom actor class wrapping Channel<Message> + CoroutineScope(SupervisorJob() + Dispatchers.Default); Flow<T> streams; structured concurrency |
| 10 | Build system | Gradle Kotlin DSL, Kotlin Gradle Plugin, Android Gradle Plugin 8.7+, Maven Central publish, gradle/libs.versions.toml catalog, Gradle wrapper 8.11+ |
| 11 | Testing gates | Per-phase Go test gates, Kotlin 2.1.0 / 2.1.20 version matrix, Play Console pre-launch validation, Kotlin/Native single-binary gate |
| 12 | Risks and alternatives | Risk register, Java-source emission rejected, Scala interop rejected, Groovy DSL rejected, v2 deferrals (Compose Multiplatform, embedded Kotlin, distributed agents) |