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

    madhead

    12/16/2017, 1:05 AM
    BTW, are there any support for unsigned bytes in K/N? I had to "upcast" bytes to ints to be able to work with them properly...
    g
    o
    • 3
    • 4
  • j

    jkbbwr

    12/16/2017, 10:58 PM
    @olonho
    jakob@devtank~/tmp> cat czmq.def 
    headers = czmq.h
    jakob@devtank~/tmp> cinterop -def czmq.def -o zmq -copt -I/usr/include
    Exception in thread "main" java.lang.IllegalArgumentException: 'va_listVar' is going to be declared twice
    	at org.jetbrains.kotlin.native.interop.gen.KotlinFile.<init>(KotlinCodeModel.kt:231)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.StubGenerator$kotlinFile$1.<init>(StubGenerator.kt:167)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.StubGenerator.<init>(StubGenerator.kt:167)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processLib(main.kt:370)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:33)
    	at org.jetbrains.kotlin.cli.utilities.MainKt.invokeCinterop(main.kt:94)
    	at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:117)
    Using CZMQ latest from github.
    o
    • 2
    • 2
  • c

    clifton

    12/16/2017, 11:30 PM
    This is similar to where I got stuck yesterday
    o
    i
    • 3
    • 6
  • j

    jkbbwr

    12/17/2017, 12:31 PM
    @olonho New problem is the stubs seem to be generated empty.
    o
    • 2
    • 1
  • j

    jkbbwr

    12/17/2017, 4:40 PM
    @olonho With this def file
    headerFilter = czmq.h czmq_prelude.h czmq_library.h zactor.h zarmour.h zcert.h zcertstore.h zchunk.h zclock.h zconfig.h zdigest.h zdir.h zdir_patch.h zfile.h zframe.h zhash.h zhashx.h ziflist.h zlist.h zlistx.h zloop.h zmsg.h zpoller.h zsock.h zstr.h zuuid.h zauth.h zbeacon.h zgossip.h zmonitor.h zproxy.h zrex.h zsys.h
    It generates empty bindings
    o
    • 2
    • 4
  • j

    jkbbwr

    12/18/2017, 11:37 PM
    Okay got it working now. But one other issue
    Warning: cannot generate stubs for function zactor_new
    Warning: cannot generate stubs for function zconfig_execute
    Warning: cannot generate stubs for function zhash_freefn
    Warning: cannot generate stubs for function zhashx_freefn
    Warning: cannot generate stubs for function zhashx_set_destructor
    Warning: cannot generate stubs for function zhashx_set_duplicator
    Warning: cannot generate stubs for function zhashx_set_key_destructor
    Warning: cannot generate stubs for function zhashx_set_key_duplicator
    Warning: cannot generate stubs for function zhashx_set_key_comparator
    Warning: cannot generate stubs for function zhashx_set_key_hasher
    Warning: cannot generate stubs for function zlist_sort
    Warning: cannot generate stubs for function zlist_comparefn
    Warning: cannot generate stubs for function zlist_freefn
    Warning: cannot generate stubs for function zlistx_set_destructor
    Warning: cannot generate stubs for function zlistx_set_duplicator
    Warning: cannot generate stubs for function zlistx_set_comparator
    Warning: cannot generate stubs for function zloop_reader
    Warning: cannot generate stubs for function zloop_poller
    Warning: cannot generate stubs for function zloop_timer
    Warning: cannot generate stubs for function zloop_ticket
    Warning: cannot generate typedef _IO_lock_t
    o
    • 2
    • 1
  • r

    roamingthings

    12/19/2017, 2:21 PM
    I discovered a difference between Kotlin/JVM and Kotlin/Native (on Raspberry Pi) behaviour and I’m not sure if I’m misusing
    also()
    to swap two values here or if this is bug. Given the following code:
    fun main(args: Array<String>) {
        var x0 = 25
        var y0 = 26
    
        var x1 = 27
        var y1 = 28
        
        x0 = y0.also { y0 = x0 }
        x1 = y1.also { y1 = x1 }
    
        println("x0=$x0, y0=$y0, x1=$x1, y1=$y1")
    }
    Kotlin/JVM will produce the following output (x0 <-> y0 and x1 <-> y1):
    x0=26, y0=25, x1=28, y1=27
    Whereas Kotlin/Native does the following:
    x0=25, y0=25, x1=27, y1=27
    Any thoughts?
    ➕ 1
    l
    o
    t
    • 4
    • 7
  • j

    jkbbwr

    12/19/2017, 3:10 PM
    How does one link shared objects when compiling c interop?
    o
    • 2
    • 1
  • d

    david.bilik

    12/19/2017, 8:52 PM
    hello, I know that right now kotlin native is not supported in multiplatform development, but is there any other non-officially supported way to share the same code in native and jvm for example?
    o
    • 2
    • 1
  • c

    codygoldberg

    12/19/2017, 9:28 PM
    I’m unable to compile a framework using 0.5, through the konan gradle plugin -
    error: you have not specified any compilation arguments. No output has been produced.
    The provided calculator sample compiles fine - so I suppose this a configuration issue on my end. Any ideas? I’m using a very similar build script setup as the sample is.
    • 1
    • 1
  • m

    madhead

    12/19/2017, 10:38 PM
    Anyone seen an error like this when building K/N application with Gradle?
    * What went wrong:
    Cannot download Kotlin/Native compiler
    > Server returned HTTP response code: 403 for URL: https://download.jetbrains.com/kotlin/native/builds/releases/0.5/linux/kotlin-native-linux-0.5.tar.gz
    o
    • 2
    • 3
  • j

    jkbbwr

    12/19/2017, 11:16 PM
    Is there a way to override the toolchain that clion uses for kotlin/native
    • 1
    • 1
  • k

    kyonifer

    12/19/2017, 11:30 PM
    although perhaps it deserves its own ticket
    m
    • 2
    • 1
  • l

    linux_china

    12/20/2017, 2:46 AM
    Any update from Kotlin/Native plugin in Clion?
    o
    • 2
    • 1
  • j

    jo

    12/20/2017, 7:04 AM
    One last question: does Kotlin Native support extension methods? I've got this bit of hackery:
    fun Byte.xor(v: Byte): Byte = ((this.toInt() and 0xFF) xor (v.toInt() and 0xFF)).toByte()
    and I'm seeing
    api8610509288099049914.cpp:39:25: error: expected member name or ';' after declaration specifiers
          cpu_x1_KByte (*xor)(cpu_x1_KByte thiz, cpu_x1_KByte v);
    g
    o
    • 3
    • 8
  • f

    freddiewang

    12/20/2017, 9:41 AM
    Hi all, I wanna try to build the calculator example for ios, but i got the error
    Showing Recent Errors Only
    Execution failed for task ':calculator:compileKonanKotlinArithmeticParserIphone_sim'.
    > Classpath of the tool is empty: konanc
      Probably the 'konan.home' project property contains an incorrect path.
      Please change it to the compiler root directory and rerun the build.
    How could I import the path in XCode?
    g
    • 2
    • 5
  • a

    amorenew

    12/20/2017, 9:55 AM
    Hi, I wonder if there is a link to a kotlin native road map?
    o
    • 2
    • 1
  • r

    rwachol

    12/20/2017, 4:45 PM
    Hi! Are there some standard libraries for http calls for kotlin native ? what about Rx ?
    o
    • 2
    • 1
  • p

    patjackson52

    12/20/2017, 5:50 PM
    Follow up to ^^^ is the kotlin std lib available for native? Docs here do not mention native, maybe because it is preview. https://kotlinlang.org/api/latest/jvm/stdlib/index.html General question is what is the lowest common standard library for sharing code btw platforms? Is there/will there be a std lib with collections, file I/O, etc?
    o
    • 2
    • 1
  • a

    andreasmattsson

    12/21/2017, 9:46 PM
    the feature "multi platform projects"
    is experimental and should be enabled explicitly
    Can it be enabled, and if so how?
    n
    o
    • 3
    • 3
  • a

    ariff

    12/22/2017, 10:48 PM
    @here can we manipulate the dom like setting innerHtml for wasm32 target ? I saw the canvas example, I am trying to manipulate the dom, any pointers/help would be greatly appreciated.
    n
    o
    • 3
    • 6
  • i

    ian

    12/24/2017, 12:35 AM
    I have a gradle kotlin-native project; is there an easy way to open it in CLion?
    i
    • 2
    • 1
  • r

    redrield

    12/24/2017, 12:48 AM
    Can I have a Kotlin/Native module for a multiplatform project?
    g
    o
    • 3
    • 2
  • b

    bombe

    12/24/2017, 11:59 AM
    is trying to call an
    ioctl
    from kotlin-native, specifically
    ioctl(STDOUT_FILENO, TIOCGWINSZ, &winsize)
    but how does one create a winsize object?
    o
    m
    • 3
    • 2
  • b

    bombe

    12/24/2017, 12:34 PM
    Also, where did you get what looks like javap output from?
    o
    • 2
    • 1
  • k

    kyle

    12/26/2017, 1:59 AM
    Is it possible to output a framework and an android SO from the same kotlin/native module? Im trying to add a library artifact (to be used for android) and a framework for ios, but it always seems to try and generate a framework for my android target. Sample build.gradle here
    m
    o
    i
    • 4
    • 7
  • c

    camdenorrb

    12/26/2017, 4:10 AM
    Can Kotlin/Native be used for JVM bindings?
    o
    m
    • 3
    • 5
  • m

    madhead

    12/26/2017, 10:51 PM
    How do one print to the
    stderr
    in K/N?
    o
    f
    +2
    • 5
    • 9
  • i

    itnoles

    12/27/2017, 6:51 PM
    is this is a proper way for NSData to String? val strData = NSString().initWithData(data, NSUTF8StringEncoding)
    👍 1
    i
    • 2
    • 1
  • s

    spierce7

    12/28/2017, 1:35 AM
    How stable is kotlin-native to use it to share model objects between swift and kotlin??
    o
    • 2
    • 1
Powered by Linen
Title
s

spierce7

12/28/2017, 1:35 AM
How stable is kotlin-native to use it to share model objects between swift and kotlin??
o

olonho

12/28/2017, 6:10 AM
It works well in most cases we are aware of, so you could try and see how good is it for you.
View count: 14