Kotlin

1 program Added 2025-10-22T08:37:02Z Evidence Report issue View issues
Aliases: Kotlin/Native, Kotlin/JS
Provenance: commit d2e6a42144 · authored 2025-10-22T10:37:02+02:00

Sources mentioning this language

8 sources · pl_id: pl/kotlin
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q3816639

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsmulti-paradigm: object-oriented · functional · imperative · block structured · generic · reflective · concurrent
Typinginferred, static, strong
Designed byJetBrains
First appeared2011
Influenced byC# · Eiffel · Gosu · Groovy · Java · JavaScript · ML · Scala
LicenseApache 2.0
Homepagehttps://kotlinlang.org/

Extensions claimed by this language

9 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.ktlinguistprimary60.7M files
.ktpygmentsprimary60.7M files
.ktwikidataprimary60.7M files
.ktswikidataprimary1.6M files
.ktmlinguistsecondary275 files
.ktslinguistsecondary1.6M files
.ktspygmentssecondary1.6M files
.kexewikipediaproposed541 files
.klibwikipediaproposed8.8K files

Related languages

Kotlin Native (0.62)Kotlinx (0.23)Kotlin Script (0.18)Koto (0.12)Nelua (0.12)

LLM-contributed programs

Kotlin Hello World

Provenance: commit d2e6a42144 · authored 2025-10-22T10:37:02+02:00
code.kt · license: Apache License 2.0 · added: 2025-10-22T08:37:02Z
fun main() {
    println("Hello, World!")
}

Real programs from Software Heritage

2 samples mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
LauncherIconHelp.kt · 2286 B · ext .kt · seen 2039× in SWH
via unique-primary
swh:1:cnt:3a226e07149a8cecd8b517556c6bad3fbf06f672;origin=https://github.com/gedoor/legado;anchor=swh:1:rev:51c16a1efcb036cc18e9cdb6d592e691b3da5816;path=/app/src/main/java/io/legado/app/help/LauncherIconHelp.kt
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
package io.legado.app.help

import android.content.ComponentName
import android.content.pm.PackageManager
import android.os.Build
import io.legado.app.R
import io.legado.app.ui.welcome.*
import io.legado.app.utils.toastOnUi
import splitties.init.appCtx

/**
 * Created by GKF on 2018/2/27.
 * 更换图标
 */
object LauncherIconHelp {
    private val packageManager: PackageManager = appCtx.packageManager
    private val componentNames = arrayListOf(
        ComponentName(appCtx, Launcher1::class.java.name),
        ComponentName(appCtx, Launcher2::class.java.name),
        ComponentName(appCtx, Launcher3::class.java.name),
        ComponentName(appCtx, Launcher4::class.java.name),
        ComponentName(appCtx, Launcher5::class.java.name),
        ComponentName(appCtx, Launcher6::class.java.name)
    )

    fun changeIcon(icon: String?) {
        if (icon.isNullOrEmpty()) return
        if (Build.VERSION.SDK_INT < 26) {
            appCtx.toastOnUi(R.string.change_icon_error)
            return
        }
        var hasEnabled = false
        componentNames.forEach {
            if (icon.equals(it.className.substringAfterLast("."), true)) {
                hasEnabled = true
                //启用
                packageManager.setComponentEnabledSetting(
                    it,
                    PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
                    PackageManager.DONT_KILL_APP
                )
            } else {
                //禁用
                packageManager.setComponentEnabledSetting(
                    it,
                    PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
                    PackageManager.DONT_KILL_APP
                )
            }
        }
        if (hasEnabled) {
            packageManager.setComponentEnabledSetting(
                ComponentName(appCtx, WelcomeActivity::class.java.name),
                PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
                PackageManager.DONT_KILL_APP
            )
        } else {
            packageManager.setComponentEnabledSetting(
                ComponentName(appCtx, WelcomeActivity::class.java.name),
                PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
                PackageManager.DONT_KILL_APP
            )
        }
    }
}
IntentData.kt · 681 B · ext .kt · seen 1605× in SWH
via unique-primary
swh:1:cnt:474a88bc8e648790ae29aa15ee6aa73baa3d53d5;origin=https://github.com/gedoor/legado;anchor=swh:1:rev:c702df43c1459f0011f39458a3353b89bbc8e9ac;path=/app/src/main/java/io/legado/app/help/IntentData.kt
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
package io.legado.app.help

object IntentData {

    private val bigData: MutableMap<String, Any> = mutableMapOf()

    @Synchronized
    fun put(key: String, data: Any?): String {
        data?.let {
            bigData[key] = data
        }
        return key
    }

    @Synchronized
    fun put(data: Any?): String {
        val key = System.currentTimeMillis().toString()
        data?.let {
            bigData[key] = data
        }
        return key
    }

    @Suppress("UNCHECKED_CAST")
    @Synchronized
    fun <T> get(key: String?): T? {
        if (key == null) return null
        val data = bigData[key]
        bigData.remove(key)
        return data as? T
    }
}

Contribute — propose a file extension

Tell us where to find evidence about Kotlin (mapped to pl/kotlin). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Kotlin/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← kOS Kotlin Native →