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

    okkero

    04/05/2017, 7:26 AM
    So, Kotlin Native will still be affected by JVM restrictions...
    o
    1 reply · 2 participants
  • z

    zubzub

    04/05/2017, 8:56 AM
    sizeExtend & signExtend
    o
    s
    22 replies · 3 participants
  • m

    mg6maciej

    04/05/2017, 9:20 AM
    When using
    Random
    class in Kotlin, I need to
    import java.util.Random
    . Is there a plan do add
    kotlin.Random
    typealias, so it works with K/N?
  • s

    sreich

    04/05/2017, 9:33 AM
    I was under the impression the stdlib would (eventually) grow to replace at least some features from the JVM, as it did with string. Like Random.
    👍 6
    m
    1 reply · 2 participants
  • y

    ywangd

    04/05/2017, 1:32 PM
    I need to use cinterop (
    stdio
    ) even for just reading from a file? This is what the csvparser example use and I couldn't seem to find anything from
    <http://kotlin.io|kotlin.io>
    library. Sorry if I am missing something obvious.
    o
    1 reply · 2 participants
  • c

    codeslubber

    04/05/2017, 5:22 PM
    is there a good networking library for native?
    o
    2 replies · 2 participants
  • n

    nimtiazm

    04/05/2017, 6:41 PM
    Is command line support for lldb available/planned?
    o
    1 reply · 2 participants
  • n

    nish

    04/06/2017, 2:55 AM
    has anyone been able to link static libraries with Kotlin native?
    o
    1 reply · 2 participants
  • m

    mishugana

    04/06/2017, 3:09 AM
    I built a simple program (factorial), and the binary size was extremely small, and the binary had only a few symbols in it.. so no GC on native? How does that work?
    o
    1 reply · 2 participants
  • g

    gildor

    04/06/2017, 3:16 AM
    no GC on native (at least for now) Current approach: automatic reference counting + cycle collector
    o
    2 replies · 2 participants
  • g

    gildor

    04/06/2017, 4:45 AM
    @mishugana Yes, for example you cannot share objects between threads - https://github.com/JetBrains/kotlin-native/blob/master/RELEASE_NOTES.md#compatibility-and-features
    o
    1 reply · 2 participants
  • h

    hackerham

    04/06/2017, 10:13 AM
    How does cycle collector work?
    c
    o
    4 replies · 3 participants
  • t

    tunedal

    04/07/2017, 9:02 PM
    So... I'm not sure if this is a bug or something I just don't understand. I'm calling a function that returns a struct, which means a CValue<something>. It compiles fine, but at runtime I get: "Uncaught exception from Kotlin's main: Throwable: typeOf() is called with erased argument". What's going on?
    o
    6 replies · 2 participants
  • j

    jkbbwr

    04/08/2017, 12:34 AM
    Anyone know why im getting this on Arch linux
    o
    3 replies · 2 participants
  • j

    jkbbwr

    04/08/2017, 12:02 PM
    Any ideas?
    o
    1 reply · 2 participants
  • k

    kyonifer

    04/08/2017, 6:21 PM
    there were a couple excludes in the .def but i cant find it now
    o
    1 reply · 2 participants
  • t

    tunedal

    04/08/2017, 9:43 PM
    @sdeleuze I also tried GTK. There was 1) a bug in cinterop: https://youtrack.jetbrains.com/issue/KT-17321 2) more than 3 GB memory required (it worked for me with 10 GB), 3) some serialization limit (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException) when I tried to actually link a program with the resulting 330 MB gtk.kt.bc.
    o
    o
    9 replies · 3 participants
  • t

    tunedal

    04/08/2017, 9:55 PM
    So I thought I'd try XCB instead, but there seems to be some problem with structs, so that's not working either. 😫 @olonho Did you see the thing I pasted? Any hints?
    o
    s
    10 replies · 3 participants
  • z

    zubzub

    04/10/2017, 12:04 PM
    something similar/same for kotlin native would be an absolute killer feature
    e
    m
    6 replies · 3 participants
  • k

    kevinherron

    04/10/2017, 9:25 PM
    will Kotlin/Native be able to compile to a shared library usable by a C/C++ codebase in the future?
    o
    t
    5 replies · 3 participants
  • o

    orangy

    04/11/2017, 9:19 PM
    http://libcello.org/
    😱 4
    j
    s
    2 replies · 3 participants
  • a

    adev_one

    04/12/2017, 6:56 PM
    There is a way to call kotlin from objective c/swift in iOS?
    s
    o
    3 replies · 3 participants
  • s

    spierce7

    04/13/2017, 3:58 AM
    So we currently can't pass objects between threads at all? Is there any way for me to do any sort of threading and get a result in it safely?
    g
    s
    +1
    15 replies · 4 participants
  • s

    sksk

    04/13/2017, 3:03 PM
    what's the plan for structs ? do you plan to add the word
    struct
    ?
    o
    b
    +1
    7 replies · 4 participants
  • s

    sksk

    04/13/2017, 8:12 PM
    anyone tried kotlin native with the new Windows Linux thing ?
    s
    b
    3 replies · 3 participants
  • b

    benleggiero

    04/15/2017, 2:32 AM
    Is there a specific IDE for K/N? Or should I use IDEA or CLion or something?
    o
    5 replies · 2 participants
  • m

    mg6maciej

    04/16/2017, 1:19 PM
    Is kapt part of compilation to K/N?
    o
    r
    +3
    8 replies · 6 participants
  • c

    cypher121

    04/19/2017, 4:17 AM
    is there a native version of REPL?
    ➕ 1
    s
    o
    3 replies · 3 participants
  • s

    sksk

    04/21/2017, 5:54 AM
    Windows 😮 https://github.com/JetBrains/kotlin-native/tree/win_port
    🍻 1
    🎅 1
    o
    g
    6 replies · 3 participants
  • k

    krotki

    04/23/2017, 1:09 PM
    I was trying to declare a class like
    class someType(override val rawPtr: NativePtr) : CStructVar() {
    
        companion object : Type(8, 4)
    
        var regA: Int
            get() = memberAt<IntVar>(0).value
            set(value) { memberAt<IntVar>(0).value = value }
    
        var regB: Int
            get() = memberAt<IntVar>(4).value
            set(value) { memberAt<IntVar>(4).value = value }
    }
    o
    5 replies · 2 participants
Powered by Linen
Title
k

krotki

04/23/2017, 1:09 PM
I was trying to declare a class like
class someType(override val rawPtr: NativePtr) : CStructVar() {

    companion object : Type(8, 4)

    var regA: Int
        get() = memberAt<IntVar>(0).value
        set(value) { memberAt<IntVar>(0).value = value }

    var regB: Int
        get() = memberAt<IntVar>(4).value
        set(value) { memberAt<IntVar>(4).value = value }
}
o

olonho

04/23/2017, 3:22 PM
Not sure if I understand what you're trying to reach. Kotlin/Native is an object oriented language, so primitives you work with are objects. If you need to access raw bits at some address, for example device MMIO interface, approach would be to write few C functions, interop with those and optionally write object oriented wrapper for use in your app
k

krotki

04/23/2017, 5:07 PM
I'm just wondering if it is plausible to access registers directly from Kotlin without C on microcontrollers and how such DSL would look like.
I think I found a way to make a structure point to given address
val someType: someType = (0x22_00_00_00L).toCPointer<someType>()!!.pointed
not sure thow if it will work anyway 😛
o

olonho

04/24/2017, 5:16 AM
I think you can make rather simple API the way I sketched above, but note that most GP registers are changed during program lifetime quickly, so unless you're in fault handler or interrupt, and they are saved somewhere by hardware - they don't make much sense
View count: 6