https://kotlinlang.org logo
Docs
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
  • t

    tomschrot

    11/19/2017, 11:08 AM
    Cannot compile to wasm32 on win10/64 -compiler crashes: Exception occurred executing command line. Cannot run program "C:\Develop\kotlin-native-windows-0.4\bin\konanc" (in directory "C:\Develop\kotlin-native-windows-0.4\bin"): CreateProcess error=193, %1 ist keine zulässige Win32-Anwendung
    o
    1 reply · 2 participants
  • a

    Attila Nyers

    11/19/2017, 6:48 PM
    Is it possible to build shared object for iOS and Android platform?
    ☝️ 1
    o
    1 reply · 2 participants
  • s

    Simone Civetta

    11/20/2017, 11:50 AM
    Hi, I’ve successfully worked on supporting the iOS simulator for Kotlin Native. Should I submit a PR or maybe it’s not a priority?
    👍 6
    o
    6 replies · 2 participants
  • s

    Sergey Rubanov

    11/20/2017, 6:11 PM
    How big is kotlin-native wasm runtime? IIUC reference count should be in runtime, right?
    o
    2 replies · 2 participants
  • d

    dsgryazin

    11/21/2017, 3:39 PM
    I'm digging into ios samples (upd: i read all the samples, kotlinconf app too), want to understand how they work we have
    AppDelegate.h
    +
    AppDelegate.m
    files with stub implementation in
    @implementation AppDelegate
    we also have AppDelegate.kt:
    class AppDelegate : UIResponder(), UIApplicationDelegateProtocol
    override fun init() = initBy(AppDelegate())
    Please, correct my understandings in thread >
    s
    s
    6 replies · 3 participants
  • a

    Andrew

    11/21/2017, 5:19 PM
    Hi! Can I compile kotlin/native code from linux to windows?
    s
    2 replies · 2 participants
  • a

    Andrew

    11/21/2017, 5:54 PM
    @Gronek Thanks for link
    g
    1 reply · 2 participants
  • k

    ktw

    11/22/2017, 8:25 AM
    How can I create an NSDictionary with Kotlin Native? I want to write this code in KN NSDictionary *options = @{(id)kAXTrustedCheckOptionPrompt: @YES};
    s
    1 reply · 2 participants
  • e

    elizarov

    11/22/2017, 3:13 PM
    @dsgryazin It will be available eventually everywhere, but the short-term goal is to provide it on JS. Moreover, the plan is to have a common subset of
    kotlinx-coroutines-core
    APIs that is available for all the platforms and can be used from the common code (the code that is shared between platforms)
    👌 6
    d
    1 reply · 2 participants
  • g

    Gronek

    11/22/2017, 4:43 PM
    I need to run tests with cli (I'm using CI system), how can I do that?
    o
    2 replies · 2 participants
  • g

    Gronek

    11/22/2017, 5:54 PM
    one more thing, how can I connect to local database (postgresql/sqlite/mysql/mariadb) with kotlin native? I know, that I can do it with requery, but then i need to use JVM version. Do I have to use C-lang libraries?
    o
    2 replies · 2 participants
  • u

    uliluckas

    11/23/2017, 8:00 PM
    Hi all, i recently played around with workers. I created a fixed set of wokers, scheduled some work and wanted these work loads to schedule new work to a worker out of this fixed set.
    o
    1 reply · 2 participants
  • u

    uliluckas

    11/23/2017, 8:02 PM
    As a guess, I also tried passing the worker id, creating a new worker with this id which did not work either.
    o
    1 reply · 2 participants
  • s

    snowe

    11/24/2017, 12:51 AM
    I'm new to native, ios, mac development etc. so I'm not sure what I've got to do here.
    o
    8 replies · 2 participants
  • g

    goncalossilva

    11/26/2017, 12:30 AM
    I’m a bit lost with my K/N setup. My goal: to create a tiny project that targets JVM, JS, iOS, macOS and Windows, but shares the vast majority of the code (ie. a cross-platform library). I’m particularly stuck on iOS / macOS / Windows as none of the samples I have found actually reuse code from a
    common
    module. I’m also assuming that the whole
    expect
    /
    actual
    workflow wouldn’t work here, and that
    stdlib
    wouldn’t be available. Is this possible?
    o
    3 replies · 2 participants
  • s

    sdeleuze

    11/26/2017, 11:03 AM
    Hey, I wanted to start playing with the WASM support I have been hoping since last year, but I was not able to go very far:
    Target WASM32 is not available on the LINUX host
    . Any chance to support Linux in next release ?
    o
    n
    +2
    11 replies · 5 participants
  • s

    sdeleuze

    11/26/2017, 11:28 AM
    I also would be interested to understand what part of Kotlin/Native, Konan etc. will be open source and what part will require closed source or commercial feature. Behind this question I would like to understand if Kotlin/Native will be a viable platform to develop Open Source native frontend/backend libraries and applications.
    o
    n
    3 replies · 3 participants
  • k

    kenkyee

    11/26/2017, 12:05 PM
    I don't think K/N includes cross compilation. It's probably translating kotlin too C or C++ and compiling that.
    🇳🇴 1
    c
    o
    5 replies · 3 participants
  • g

    Gronek

    11/26/2017, 6:51 PM
    how can I compile program for windows on linux host?
    o
    t
    3 replies · 3 participants
  • s

    Simone Civetta

    11/27/2017, 10:33 AM
    In case somebody is interested on running a K/N native app in the iOS simulator, here is a tutorial I wrote => http://viteinfinite.com/2017/11/running-a-kotlinnative-ios-app-in-the-simulator/
    👍🏻 5
    👍 3
    1 reply · 1 participant
  • k

    kevin.cianfarini

    11/27/2017, 5:25 PM
    can I get a quick explanation of how this works?
    o
    1 reply · 2 participants
  • k

    kevin.cianfarini

    11/27/2017, 7:45 PM
    or if anyone knows where I can read about this let me know
    o
    1 reply · 2 participants
  • j

    jb

    11/27/2017, 7:53 PM
    all, I'm looping through a loop and reading a variable value which doesn't change in the loop. Getting "*** Error in `./HelloWorld.kexe': free(): invalid next size (fast): 0x0000000002521930 ***"
    o
    6 replies · 2 participants
  • g

    GauthierPLM

    11/28/2017, 6:26 AM
    Hi ! Little question, what is the best way to do IO that works on Linux & Windows using Kotlin native ?
    o
    l
    7 replies · 3 participants
  • j

    jb

    11/28/2017, 3:14 PM
    All, I can reliably core dump kotlin-native with this code: https://gist.github.com/anonymous/273e1a4e01daece84e48523da9dc82a8
    o
    u
    4 replies · 3 participants
  • g

    GauthierPLM

    11/28/2017, 3:21 PM
    Is there a good way to know which are the sections of my code which take a lot of time ? I do some I/O reading, and guess is what take most of the time, but I would like to confirm it. (I do a lot of fgets(), around 1000 times, then split, filter and add this to a graph)
    1 reply · 1 participant
  • l

    louiscad

    11/28/2017, 7:28 PM
    Hi, I dowloaded Kotlin/Native to my computer using GitHub Desktop, and I'm trying to open the samples directory in CLion EAP (which has the Kotlin/Native plugin), but when I press "open" and select the "samples" directory, nothing happens. When I try "import from sources", it asks me to select files for a CMake project, and I don't know what to do since the samples seem to be built by gradle, and I don't know anything in CMake (I'm a true beginner in the native ecosystem). Could anyone help me in getting the samples open properly in CLion please?
    s
    55 replies · 2 participants
  • g

    GauthierPLM

    11/29/2017, 4:19 AM
    Rewrote my Ruby program in Kotlin native, ended up with a 100 time slower program ... 😕 The parts which make is slower : - spliting a file of 1000 lines, and then spliting each line in 1000 elements - for each on each splited line - trim each string (won 10s by removing that) - getting a value in a collection seems slow too
    o
    12 replies · 2 participants
  • a

    apatrida

    11/29/2017, 4:05 PM
    Is there an existing conversation somewhere on the plans for code sharing between native and JVM/Javascript as the other two can do? I'm not sure how that'll reconcile across memory management models but not all logic will care as much about what the container is doing. Any links?
    o
    6 replies · 2 participants
  • r

    r4zzz4k

    11/29/2017, 4:11 PM
    Here's small question. I'm trying to consume libclang from K/N code. There is a function called
    clang_visitChildren
    which expects callback having C structs passed by values as parameters. When trying to use it as is, I'm getting the following error:
    type CValue<CXCursor> is not supported in callback signature
    . Do I understand correctly that the following workaround is the only way to go for now?
    s
    2 replies · 2 participants
Powered by Linen
Title
r

r4zzz4k

11/29/2017, 4:11 PM
Here's small question. I'm trying to consume libclang from K/N code. There is a function called
clang_visitChildren
which expects callback having C structs passed by values as parameters. When trying to use it as is, I'm getting the following error:
type CValue<CXCursor> is not supported in callback signature
. Do I understand correctly that the following workaround is the only way to go for now?
s

svyatoslav.scherbina

11/30/2017, 7:18 AM
Unfortunately, yes, in this case you need to add callback wrapper. You can add C code at the end of
.def
file after `---`: https://github.com/JetBrains/kotlin-native/blob/master/INTEROP.md#adding-custom-declarations Also you can make
CallbackWithPtrs
receive some user data using the following:
...
// [C++] My wrapper
typedef void (*CallbackWithPtrs) (Input*, void* userData);

struct WrapperCallbackUserData {
    CallbackWithPtrs callback;
    void* userData;
}

void WrapperCallback(Input input, void* userData) {
    WrapperCallbackUserData* data = (WrapperCallbackUserData*) userData;
    CallbackWithPtrs actualCallback = data->callback;
    actualCallback(&input, data->userData);
}

void wrapperVisitor(CallbackWithPtrs callback, void* userData) {
    struct WrapperCallbackUserData data;
    data.callback = callback;
    data.userData = userData;
    visitor(WrapperCallback, (void*) &data);
}         

// [Kotlin/Native] Wrapper usage
wrapperVisitor(staticCFunction({ input: CPointer<Input>, userData: COpaquePointer ->
    // use input.pointed
}))
r

r4zzz4k

11/30/2017, 12:08 PM
Oh, I forgot about the feature with C code in
.def
file. Yeah, I've decided to skip
userData
from example for simplicity. I'm going to use it with
StableObjPtr
in my own code, of course. Thank you very much!
View count: 6