https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
kotlin-native
  • r

    rjhdby

    08/25/2018, 2:31 PM
    Hi! Can anyone give me example of accessing library K/N `object`'s method from C code?
    object ExampleClass {
        fun helloWorld() = println("Hello World!!!")
    }
    Library's header
    example_api.h
    typedef struct {
      example_KNativePtr pinned;
    } example_kref_ExampleClass;
    ...
    struct {
            example_KType* (*_type)(void);
            void (*helloWorld)(example_kref_ExampleClass thiz);
          } ExampleClass;
    Where I can get
    example_kref_ExampleClass thiz
    ?
    o
    • 2
    • 2
  • d

    Dominaezzz

    08/25/2018, 3:27 PM
    For using C interop, should I be using DEF files or define everything in build.gradle file? Or is it just up to preference?
    o
    • 2
    • 1
  • d

    Dominaezzz

    08/25/2018, 4:24 PM
    So I'm trying to use GLFW with Kotlin/Native on Windows, when I try and build, the interop file is generated then I get a non descriptive error. The project is here https://github.com/Dominaezzz/HelloWorld.
    o
    • 2
    • 2
  • a

    amorenew

    08/26/2018, 10:11 AM
    I wonder if there is a complete hello world tutorial for Kotlin Native and iOS? I already made Hello world in CLion but I don't know what the next step? I did my homework and I searched in Youtube but I didn't found anything
    t
    • 2
    • 6
  • j

    jkbbwr

    08/26/2018, 9:44 PM
    What is nostdlib used for?
    t
    o
    • 3
    • 4
  • j

    jkbbwr

    08/26/2018, 11:06 PM
    By the way Nikolay, I did some digging and I couldn't really see what you were getting at with the answers to my no operating system compilation. Most of the codebase seems to need some sort of libc, so if I were to build a microkernel that exposed some libc calls I could bootstrap k/n from that?
    m
    o
    • 3
    • 4
  • r

    rjhdby

    08/27/2018, 8:15 AM
    Hi! How to print to
    stderr
    ? 🙂
    g
    • 2
    • 1
  • a

    adev_one

    08/27/2018, 11:26 AM
    My
    build.gradle
    buildscript {
        ext.kotlin_version = '1.2.51'
        ext {
            coroutines_version = "0.25.0"
        }
    }
    
    apply plugin: 'kotlin-platform-native'
    
    sourceSets {
        main {
            component {
                baseName.set("NF")
                outputKinds = [FRAMEWORK]
                target 'ios_arm64', 'ios_x64'//, 'ios_arm32'
            }
        }
    }
    
    dependencies {
        compile "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$coroutines_version"
        <...>
    }
    IosDisplayContext.swift
    import NF
    
    @objc
    class IosDisplayContext: NSObject, NFCoroutineDispatcher {
    
    }
    I’m getting error
    Use of undeclared type 'NFCoroutineDispatcher'
    . How can I use public API of maven dependency from my Swift code?
    o
    • 2
    • 2
  • y

    yusuf3000

    08/27/2018, 2:14 PM
    Is it possible for documentation written in kotlin classes to be read from Xcode? (e.g. option-clicking the class brings up class documentation in xcode) I’m creating a kotlin native framework for some iOS developers and they want more detail on the functions they are calling. The documentation exists in the kotlin classes but they can’t see this from xcode. They currently have to open up the source files and read the docs, which isn’t ideal.
    o
    • 2
    • 4
  • t

    tunedal

    08/27/2018, 8:31 PM
    I'm having some trouble with StableRef. This program prints "Hello world!" as expected, but that's followed by:
    C:\BuildAgent\work\4d622a065c544371\runtime\src\main\cpp\Memory.cpp:1103: runtime assert: Memory leaks found
    StableRefTest_kt.kt
    o
    • 2
    • 2
  • m

    Mohit Gurumukhani

    08/27/2018, 9:50 PM
    How do I enable debug in the module settings while publishing a cinterop library. I am trying to use an objective c library in Native. As this is not available in the new plugin, I have an another native project which uses konan plugin to publish the library as a module to local repo. However, while importing as a dependency, I get configuration has gradle.native.debuggable false while true is required.
    i
    • 2
    • 1
  • c

    chickenfresh

    08/27/2018, 11:26 PM
    why everybody’s trying native with obj-c instead of swift? With swift the only problem I faced was incompatibility with khttp (so I couldn’t work with REST), but everything else was fine
    l
    k
    • 3
    • 11
  • t

    tunedal

    08/28/2018, 12:31 PM
    Now that all singleton objects are frozen/read-only since Kotlin/Native 0.8, how can I put a shared MutableHashMap in a companion object? Do I have to use an AtomicReference<HashMap> and copy the whole thing for every update? (There is only one thread in my app.)
    t
    • 2
    • 2
  • a

    Aregev2

    08/28/2018, 1:55 PM
    Is there a way to combine two targets to the same klib library? (i.e linux and windows build together)
    o
    • 2
    • 2
  • d

    Dmitry Kandalov

    08/28/2018, 6:55 PM
    Kotlin/Native
    README.md
    mentions composite build with
    kotlinProjectPath
    property. Does anyone know how to find out which kotlin versions it’s compatible with? (Is it
    kotlinVersion
    value from
    gradle.properties
    ?)
    o
    s
    • 3
    • 5
  • a

    Aregev2

    08/28/2018, 7:47 PM
    Are there any plans for Kapt to work in K/N (or annotation processing in general)?
    g
    • 2
    • 2
  • m

    Mohit Gurumukhani

    08/28/2018, 11:03 PM
    I am having trouble using string with format in Kotlin/Native for iOS. The interop objective c function with nsstring allows for only one paramater, the formatter string itself and does not allow extra parameters. Is there an alternative native/iOS way?
    s
    • 2
    • 2
  • s

    sksk

    08/29/2018, 5:26 AM
    how do i translate this :
    artifact project(':kdx'), 'kdx'
    to the new kotlin dls plugin ?
    g
    i
    • 3
    • 30
  • d

    Dominaezzz

    08/29/2018, 9:13 AM
    How do I call a C function pointer from Kotlin? Like the
    CPointer<CFunction<...>>
    type.
    o
    • 2
    • 1
  • d

    Dominaezzz

    08/29/2018, 9:30 AM
    Can someone recommend an OpenGL extension loader? GLEW doesn't play nicely with cinterop. Given the whole
    #define
    function thing. (On Windows btw).
    m
    • 2
    • 2
  • h

    hmole

    08/29/2018, 10:18 PM
    Is there a way to cross compile kotlin native? Say I'm on Windows and I want to compile for iphone targets.
    🇳🇴 2
    o
    m
    +3
    • 6
    • 5
  • d

    David

    08/30/2018, 1:43 PM
    Has anyone tried to profile an iOS app that uses a Kotlin/Native built library? I get “missing required architecture i386” even though I try to run on a 64-bit simulator. The app runs fine when I don’t try to profile. I suspect that Instruments require a 32-bit binary (i386), but i386 seems not to be supported by Kotlin/Native…
    o
    • 2
    • 2
  • c

    codeprogression

    08/30/2018, 5:25 PM
    Looking into doing Playstation and Nintendo Switch development and would love to use Kotlin Native. What would be required to support these platforms?
    o
    s
    • 3
    • 5
  • a

    aljosa

    08/30/2018, 8:40 PM
    i can figure out what this
    FunFunction
    is and can find any reference. is this a typo?
    j
    • 2
    • 2
  • j

    jmhmccr

    08/31/2018, 12:49 AM
    Looks like 1.3-M2 supposedly supports kotlin-native as part of multiplatform (I don't see any native examples in the example repo though).
    f
    • 2
    • 9
  • t

    tulio

    08/31/2018, 8:57 AM
    Hello guys, I’m trying to share some code between Android and iOS apps and my final goal is to have a completely detached kotlin project in a different repository that could generate a
    jar
    for android and a
    framework
    for iOS. Is there a way to do that currently with kotlin multiplatform/native? (the sample projects are all very coupled)
    t
    t
    • 3
    • 7
  • r

    rudolf.hladik

    08/31/2018, 2:23 PM
    K/N doesn’t have .let .also .apply .run functions?
    j
    • 2
    • 5
  • t

    tapchicoma

    09/02/2018, 7:29 PM
    I have following config in
    build.gradle
    that applies
    konan
    plugin:
    program("foo") {
            entryPoint("org.jlleitschuh.gradle.ktlint.sample.native.main")
        }
    what will be equivalent in new experimental
    "org.jetbrains.kotlin.native"
    plugin? Can figure this out from documentation.
    t
    o
    • 3
    • 6
  • d

    Dominaezzz

    09/03/2018, 4:35 PM
    What does the
    refTo
    function do? Because it seems the target array is unpinned before the function returns.
    j
    o
    • 3
    • 7
  • o

    olonho

    09/05/2018, 5:05 PM
    @channel Kotlin/Native team is pleased to announce release v0.9 of our toolchain. This is a major release, including the following features: * Support Kotlin 1.3-M2 * Major standard library (native parts) rework and rename * New Gradle plugin with multiplatform integration and reworked DSL * Support unsigned types in Kotlin and interop * Support non-experimental coroutines API (kotlin.coroutines) * Top level object var/val can only be accessed from the main thread * Support lazy properties in singleton objects * Update LLVM to 6.0.1 Binaries can be downloaded from the following links: https://download.jetbrains.com/kotlin/native/builds/releases/0.9/macos/kotlin-native-macos-0.9.tar.gz https://download.jetbrains.com/kotlin/native/builds/releases/0.9/linux/kotlin-native-linux-0.9.tar.gz https://download.jetbrains.com/kotlin/native/builds/releases/0.9/windows/kotlin-native-windows-0.9.zip GitHub release page is https://github.com/JetBrains/kotlin-native/releases/tag/v0.9.
    👌 2
    🎉 3
    👏 4
    r
    • 2
    • 2
Powered by Linen
Title
o

olonho

09/05/2018, 5:05 PM
@channel Kotlin/Native team is pleased to announce release v0.9 of our toolchain. This is a major release, including the following features: * Support Kotlin 1.3-M2 * Major standard library (native parts) rework and rename * New Gradle plugin with multiplatform integration and reworked DSL * Support unsigned types in Kotlin and interop * Support non-experimental coroutines API (kotlin.coroutines) * Top level object var/val can only be accessed from the main thread * Support lazy properties in singleton objects * Update LLVM to 6.0.1 Binaries can be downloaded from the following links: https://download.jetbrains.com/kotlin/native/builds/releases/0.9/macos/kotlin-native-macos-0.9.tar.gz https://download.jetbrains.com/kotlin/native/builds/releases/0.9/linux/kotlin-native-linux-0.9.tar.gz https://download.jetbrains.com/kotlin/native/builds/releases/0.9/windows/kotlin-native-windows-0.9.zip GitHub release page is https://github.com/JetBrains/kotlin-native/releases/tag/v0.9.
👌 2
🎉 3
👏 4
r

russhwolf

09/05/2018, 5:11 PM
Just to be clear, the gradle plugin refers to the new
kotlin-multiplatform
one? Or to
kotlin-platform-native
? It’s starting to get confusing what “new plugin” means with everything changing so fast.
o

olonho

09/05/2018, 5:13 PM
yeah, we’re
talking kotlin-platform-native
here
View count: 2