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
  • a

    Aman Alam

    09/24/2018, 8:54 AM
    I have experience with React.js, so ReactNative ideally shouldn’t be a mountainous effort. I know a bit of Dart too, so Fluttr should also eventually become easier. But, I like the way Kotlin works, and was wondering if learning Kotlin will be a valuable time investment
    j
    • 2
    • 14
  • o

    otakusenpai

    09/24/2018, 9:40 AM
    Hello guys, Are there any tooling platforms(like IDEA) that are free to use for KotlinN as of now? Was previously trying out kotlin JVM side, and now some of the basic stuff about the language. What I do want to know is is it possible to do native code with kotlinN in IDEA community edition,maybe via a plugin or a few simple steps outlined somewhere?
    t
    c
    s
    • 4
    • 7
  • o

    otakusenpai

    09/24/2018, 12:32 PM
    Can anyone tell me a good demo for multi module gradle project where one module targets native ? Cant seem to find any good ones
    k
    h
    • 3
    • 4
  • d

    David

    09/24/2018, 2:56 PM
    I am trying to do some threading with K/N. Basically, I want to thread off some work and call a listener when ready. This code crashes with
    IllegalStateException
    . Any suggestions on how to improve?
    import kotlin.native.concurrent.*
    
    class KotlinNativeFramework {
    
        var listener: KotlinNativeFrameworkListener? = null
    
        fun startWorking() {
            val myInput = DoubleArray(10) { it.toDouble() }.toList()
    
            val future = Worker.start().execute(TransferMode.SAFE, {
                myInput }) { input ->
                val doSomeWork = DoSomeWork()
                doSomeWork.run(input)
            }
    
            future.consume {
                result -> listener?.resultsReady(result)
            }
        }
    }
    
    interface KotlinNativeFrameworkListener {
        fun resultsReady(result: WorkResult)
    }
    o
    • 2
    • 18
  • t

    thevery

    09/24/2018, 8:08 PM
    Hm, is there any significant changes in 0.9.2 vs 0.9.1? I'm getting
    /opt/teamcity-agent/work/4d622a065c544371/runtime/src/main/cpp/Memory.cpp:356: runtime assert: Unable to execute Kotlin code on uninitialized thread
    after update. On 0.9.1 downgrade I see
    ld: targeted OS version does not support use of thread local variables in ___unnamed_41 for architecture x86_64
    (xcode 10)
    • 1
    • 2
  • s

    spierce7

    09/24/2018, 10:28 PM
    And if so, are there any examples?
    a
    r
    • 3
    • 5
  • s

    sksk

    09/25/2018, 7:48 AM
    Is there a way to force an object to be allocated on the stack ?
    d
    • 2
    • 3
  • r

    rudolf.hladik

    09/25/2018, 10:54 AM
    there are some working examples, but I cant see any tutorial how to create mpp project, especialy ios app to be able to use common framework.
    o
    • 2
    • 1
  • d

    Dominaezzz

    09/25/2018, 2:27 PM
    So I have a very small array of `List<Particle>`s. These particles have mutable state so I can't freeze them. I'd like to process each list in a different thread/worker. How would I be able to do this? How could I detach/transfer them? All the examples I've seen have the worker create the data themselves. As supposed to working on existing data.
    o
    • 2
    • 3
  • a

    amorenew

    09/26/2018, 7:02 AM
    Is there any article about the difference between Kotlin Native and MultiPlatform?
    o
    r
    • 3
    • 2
  • m

    mutexkid

    09/26/2018, 6:54 PM
    can anyone point me to what i should allocate for this argument?
    type mismatch: inferred type is CPointerVarOf<COpaquePointer /* = CPointer<out CPointed> */> but CValuesRef<COpaquePointerVar /* = CPointerVarOf<COpaquePointer /* = CPointer<out CPointed> */> */>
    was expected.. i think it requires whatver would be the correct usage for a **void type
    o
    • 2
    • 2
  • m

    marcinmoskala

    09/26/2018, 8:23 PM
    Can Konan depend on kotlin-platform-native library?
    o
    • 2
    • 1
  • s

    sdeleuze

    09/26/2018, 10:05 PM
    Something like https://rustwasm.github.io/2018/09/26/announcing-web-sys.html with a shared multiplatform API shared between JS and Native/WASM would be awesome for next year ;-)
    o
    • 2
    • 1
  • a

    alex009

    09/27/2018, 2:45 AM
    hello! i try update my multiplatform (android & ios) module from 0.8 kotlin/native to 0.9.2 with kotlin 1.3 RC and now compilation failed with:
    Undefined symbols for architecture x86_64:
      "_kfun:platform.darwin.objcKniBridge77$darwin(kotlin.native.internal.NativePtr;kotlin.native.internal.NativePtr)platform.darwin.NSObject?", referenced from:
          _kfun:io.ktor.client.engine.ios.IosClientEngine.$execute$3.invokeSuspend(kotlin.Result<kotlin.Any?>)kotlin.Any? in combined.o
      "_private_functions_<ktor-http-ios>_kfun:io.ktor.http.HttpStatusCode.equals(kotlin.Any?)ValueType_57", referenced from:
          _kfun:com.mirbega.russiarunning.network.LiveEventsApi.$processResponse$3.invokeSuspend(kotlin.Result<kotlin.Any?>)kotlin.Any? in combined.o
    ld: symbol(s) not found for architecture x86_64
    used versions is:
    kotlin_version = '1.3.0-rc-57'
        kotlin_native_version = '0.9.2'
        coroutines_version = '0.26.1-eap13'
        serialization_version = '0.8.1-rc13'
        ktor_version = '0.9.5-rc13'
    anybody get same problem? or know how to fix?
    o
    s
    e
    • 4
    • 8
  • s

    spierce7

    09/27/2018, 4:50 AM
    @olonho Were destructors ever added to Kotlin/native? If I have a frozen object with a reference to a C Pointer where I'm storing a mutable Kotlin object, I want to ensure that the C pointer gets cleaned up with the frozen object is free'd. Is there a way for me to do such a thing without destructors?
    o
    • 2
    • 3
  • d

    Dmitry Kandalov

    09/27/2018, 8:33 AM
    Is there a way to minimise size of Kotlin/Native program binaries?
    t
    d
    • 3
    • 7
  • j

    Jaroslav

    09/27/2018, 9:37 AM
    I have KN library that can be compiled to ios framework. Is there any documentation or tutorial on how I could make this into a cocoapod, so it would be possible to include this lib via cocoapods? I’ve seen in KN documentation one mention that it is possible
    o
    • 2
    • 1
  • j

    Jaroslav

    09/27/2018, 11:49 AM
    when trying to run
    ./gradlew :ios:compileKonan
    from terminal I get
    error: you have not specified any compilation arguments. No output has been produced.
    Any ideas why?
    o
    s
    • 3
    • 4
  • g

    gildor

    09/28/2018, 8:26 AM
    what versions of koltin and coroutines lib one should use
    how this related on IDE?
    l
    • 2
    • 2
  • d

    David

    09/28/2018, 9:17 AM
    I want to thread off some work and when finished notify a listener without blocking the thread. I have tried to do this with two workers, but I fail to find a solution where I don’t have to freeze the listener. Can someone point me in the right direction? I will post the code in the thread.
    o
    • 2
    • 7
  • l

    ldavin

    09/28/2018, 11:56 AM
    Hi there. do you know of any K/N sample project with unit tests ? What would be your recommendations for unit testing the “common” KN code for a guy used to writing “classic” android-jvm kotlin code ? It is even possible to test the common code directly ?
    t
    r
    d
    • 4
    • 5
  • h

    Hamza

    09/28/2018, 1:06 PM
    is there any documentation on making ios applications with k/n? I have been trying for a long time looking for something, and all i find are giant projects from tech wizards, which i don’t understand. how can a beginner get into this? I really am not sure
    m
    • 2
    • 4
  • h

    Hamza

    09/28/2018, 1:11 PM
    that’s why im looking for help. i want at least something i can use to get started, and i hope to document my process so more people use it.
    a
    n
    • 3
    • 3
  • m

    mikehearn

    09/28/2018, 7:05 PM
    another question. does alloc<>() zero out the allocated memory or not?
    r
    o
    • 3
    • 2
  • m

    mikehearn

    09/28/2018, 7:12 PM
    i mean it "knows" in the sense that it doesn't report any errors, but the IDE has no intelligence about the types
    o
    t
    • 3
    • 4
  • h

    hmole

    09/28/2018, 8:27 PM
    How do I go about implementing a cache that is accessed from multiple threads? My understanding is that I need to freeze it, but then I won't be able to modify from different threads.
    o
    s
    • 3
    • 5
  • s

    spierce7

    09/29/2018, 3:14 PM
    I'm having some trouble getting tests to run for iOS with the new multiplatform plugin. Can anyone point me in the right direction?
    t
    r
    l
    • 4
    • 22
  • m

    mikehearn

    09/29/2018, 7:42 PM
    shall i just wait until 1.3 is out for real or is this not really a supported configuration? i don't think i'm doing anything special beyond combining the kotlin/jvm and kotlin/native gradle plugins in the same build
    o
    • 2
    • 1
  • b

    BorzdeG

    09/29/2018, 10:17 PM
    How on Mac through Gradle to make build for Linux?
    gradle build
    only do macos_x64
    apply plugin: 'konan'
    
    konan.targets = [ 'macbook', 'linux' ]
    
    konanArtifacts {
      program("app") {
        enableOptimizations(true)
      }
    }
    t
    s
    o
    • 4
    • 11
  • c

    camdenorrb

    09/30/2018, 7:09 AM
    Is there any way to inline assembly in kotlin native?
    o
    • 2
    • 1
Powered by Linen
Title
c

camdenorrb

09/30/2018, 7:09 AM
Is there any way to inline assembly in kotlin native?
o

olonho

09/30/2018, 7:18 AM
yes, just use inline asm in the .def file, after
---
separator, like in https://github.com/JetBrains/kotlin-native/blob/bf3cdde30aa664b9275bafbce154492ef3b406d6/samples/videoplayer/src/main/c_interop/ffmpeg.def#L9
View count: 10