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

    rjhdby

    07/02/2018, 11:10 AM
    Hi. I trying to make shared/static library and use it in C project (php extencion).
    kotlinc -opt ./hellokt.kt -o hellokt -produce dynamic
    kotlinc -opt ./hellokt.kt -o hellokt -produce static
    With shared library all working, but with static library I receive segfault. Why it can be? Mabe I need to provide some specific keys to c compiler?
    o
    • 2
    • 8
  • k

    kartikpatodi

    07/02/2018, 3:25 PM
    I thought C++ and C# introp was available with KN
    a
    g
    +2
    • 5
    • 4
  • s

    spierce7

    07/02/2018, 7:51 PM
    If I am using a Kotlin library in a Swift application, and I create one of the Kotlin objects in Swift code, does the object have the same threading restrictions as in Kotlin, or can I pass the object between threads safely (basically as if it was a Swift or obj c)?
    👍 2
    t
    k
    o
    • 4
    • 5
  • r

    rjhdby

    07/03/2018, 12:10 PM
    Hi. Can anybody give link to simple example of using C struct in Kotlin Native code? For example, I have
    someHeader.h
    struct my_strucs{
        uint32_t id;
       char * name;
    }
    What can I do for using it in Kotlin code?
    o
    • 2
    • 7
  • s

    sksk

    07/03/2018, 7:23 PM
    Is this intellij debugging kotlin native code i'm seeing here ? 😮 https://github.com/JetBrains/kotlin-native/issues/1748

    https://user-images.githubusercontent.com/570848/42139787-338b9446-7d95-11e8-81b2-2e72b7a3166a.png▾

    d
    • 2
    • 1
  • r

    rjhdby

    07/04/2018, 12:51 PM
    Some misunderstanding of type infer
    private fun getFile(name: String) {
            val file = fopen(name, "wt")
            if (file == null) throw Error("Cannot write file '$name'")
            return file
    
    private fun writeM4() {
            val file = getFile("config.m4")
            fputs(m4Content, file)
    ...
        }
    Compiler is fail with errors
    dsl.kt:77:30: error: type mismatch: inferred type is Unit but CValuesRef<FILE /* = _IO_FILE */>? was expected
                fputs(m4Content, file)
                                 ^
    dsl.kt:86:16: error: type mismatch: inferred type is CPointer<FILE /* = _IO_FILE */>? but Unit was expected
            return file
    Why it does not infer automatically?
    r
    o
    • 3
    • 5
  • d

    Dominaezzz

    07/05/2018, 6:51 AM
    Does KN have regex support? And if so, is it platform dependant or is it built from scratch?
    g
    m
    o
    • 4
    • 7
  • d

    Dominaezzz

    07/05/2018, 8:14 AM
    When primitives are given as generic parameters, are they boxed like in Java backend?
    o
    s
    • 3
    • 5
  • d

    Denis Shurygin

    07/05/2018, 12:30 PM
    Does it possible to override Objective-C methods? I found way to call them in this document: https://github.com/JetBrains/kotlin-native/blob/master/OBJC_INTEROP.md, but it's not clear of how to override them.
    o
    a
    s
    • 4
    • 12
  • t

    tylerwilson

    07/05/2018, 4:16 PM
    Perhaps more of a gradle question, but thought others here would have seen the same thing: I am doing a Kotlin shared lib/framework across Android and iOS as laid out in the MULTIPLATFORM doc. All is good so far. One little thing that bugs is that in Android Studio I see the whole ios section. How can I adjust my settings.gradle to not include the ios when gradle is run from within AS?
    a
    • 2
    • 5
  • t

    tylerwilson

    07/05/2018, 4:28 PM
    K/N iOS question: is there a way I can control how a Kotlin Int gets translated to the ObjC code? Right now it is making it an int32_t which requires casting and such. I would like to make it an NSInteger, which require less of this. Thank you!
    o
    d
    s
    • 4
    • 9
  • k

    kpgalligan

    07/05/2018, 6:35 PM
    I'm looking at the source for kotlinx.serialization and http-client-common. They both use 'gradle-bintray-plugin:1.8.2-SNAPSHOT' for pushing binaries to bintray. I've been using that as well, but am running into an odd issue, so was hoping to look at source. I got the source jar, but those sources appear to look like 1.7.x's file layout. Its kind of weird, but 1.8.x being used with K/N appears significantly different from the 1.8.x versions from https://github.com/bintray/gradle-bintray-plugin. Does anybody know if there's a public repo for the bintray plugin being used for the K/N samples? I've been stuck for a solid day trying to debug a publishing issue. Thanks in advance!
    o
    m
    • 3
    • 3
  • t

    thevery

    07/05/2018, 8:25 PM
    With recent changes in
    internal
    handling, should it work like on JVM now? It is ok in JVM test, but doesn't work in KN - probably problem in indirect usage?
    s
    • 2
    • 3
  • n

    Nikky

    07/06/2018, 4:44 AM
    is there a lwjgl like library thats kotlin-native ?
    k
    n
    +2
    • 5
    • 14
  • k

    Konstantin Petrukhnov

    07/06/2018, 7:10 AM
    What is good way to get better errors in xcode log? Now i errors that are hard to map to root cause: Instances of kotlin.Error, kotlin.RuntimeException and subclasses aren't propagated from Kotlin to Objective-C/Swift. Other exceptions can be propagated as NSError if method has or inherits @Throws annotation. Uncaught Kotlin exception: kotlin.UninitializedPropertyAccessException
    t
    s
    • 3
    • 8
  • r

    rjhdby

    07/06/2018, 9:36 AM
    Hi. I'm recently updated CLion to 2018.1.5 and can't install Kotlin/Native plugin. In Settings/plugins it is absent. Installation from disk says "is not compatible with this installation"
    d
    d
    • 3
    • 2
  • d

    Dominaezzz

    07/06/2018, 11:26 AM
    The cinterop tool doesn't seem to support anonymous struct composition in C11. Are there any published limitations of the tool?
    o
    • 2
    • 2
  • t

    thevery

    07/06/2018, 1:26 PM
    https://dl.bintray.com/jetbrains/kotlin-native-dependencies/org/jetbrains/kotlin/kotlin-native-gradle-plugin/0.8/ not yet
    o
    • 2
    • 1
  • n

    nwh

    07/06/2018, 9:17 PM
    One of the methods I'm trying to call receives a parameter of type
    DWORD
    - how can I construct this?
    o
    m
    • 3
    • 3
  • a

    Aregev2

    07/07/2018, 8:28 PM
    Noobie question, how can I pass program args to my newly created program.kexe file?
    d
    • 2
    • 2
  • s

    sksk

    07/08/2018, 3:50 PM
    what are the reasons why Value Types didn't make into Kotlin Native ? wouldn't that have made interop with C way easier/transparent ? like in Swift for example
    o
    • 2
    • 1
  • s

    sksk

    07/08/2018, 6:44 PM
    i am evaluating different languages for my game engine, and currently KN doesn't fit, boxing issue + no value type makes it unusable, if only Swift was supported on windows i'd pick it.. there is C# and D left but i wish i could use KN instead
    o
    • 2
    • 4
  • l

    louiscad

    07/08/2018, 6:53 PM
    @sksk It's safe to say that Kotlin has been a JVM-first language (although it's shifting its focus to #multiplatform). JVM currently don't support value types, but it's under design phase as part of project Valhalla. Since Kotlin tries to properly integrate into the JVM ecosystem while maintaining high-interop, the Kotlin team is waiting for the design of value types in the JVM to complete before committing to any design. Once this is done, it's likely support for other backends that can support it, like Kotlin/Native will arrive. In the meantime, Kotlin/Native has C interop, so you can probably declare structs in C and use them from Kotlin. Note that lack of value types support has not prevented a lot of great programs to be done in the JVM, the ART (Android Runtime) & Dalvik VM.
    s
    • 2
    • 3
  • k

    Krizzu

    07/08/2018, 8:04 PM
    Hey everyone!
  • b

    badlogic

    07/09/2018, 11:37 AM
    does anyone know of documentation/a sanctioned way to setup a multi-platform project for kotlin/kotlin JS/kotlin native?
    g
    k
    • 3
    • 4
  • r

    rjhdby

    07/09/2018, 1:13 PM
    How to right way to process C null pointer in Kotlin function?
    o
    • 2
    • 6
  • a

    AnaR

    07/09/2018, 4:27 PM
    I have a Singleton object for which all the data modifications happen on the main UI Thread (ensured by posting to UI queue). I am a little confused with the idea of freeze on creation. My code seems to work fine (after update to 0.8) , not throwing any InvalidMutabilityException. Is that as expected? Just looking for an understanding of how freeze for Singletons works.
    o
    • 2
    • 7
  • t

    thevery

    07/09/2018, 5:03 PM
    • Common stdlib with Kotlin/JVM and Kotlin/JS
    What does it mean for multiplatofrm projects? kotlin-stdlib-jdk7 is still required but all
    kotlin.*
    classes are available in
    kotlin-stdlib-common
    now?
    ➕ 2
    o
    • 2
    • 1
  • n

    napperley

    07/09/2018, 9:38 PM
    Does the new Gradle plugin support Gradle Kotlin DSL?
    g
    o
    • 3
    • 5
  • s

    spierce7

    07/09/2018, 10:24 PM
    What is the gradle plugin for? Is this for the IDEs? Haven't we always had a gradle plugin for kotlin/native?
    g
    • 2
    • 1
Powered by Linen
Title
s

spierce7

07/09/2018, 10:24 PM
What is the gradle plugin for? Is this for the IDEs? Haven't we always had a gradle plugin for kotlin/native?
g

gildor

07/09/2018, 11:07 PM
This is plugin for Gradle. To use Gradle as build system for K/N projects https://github.com/JetBrains/kotlin-native/blob/master/GRADLE_PLUGIN.md
View count: 3