7 ms·
Kotlin/Native v0.4 released: Objective-C interop, WebAssembly and more
- jernfrost 9y agoIs kotlin native reference counted like swift or do they use some form of garbage collection? How do they deal with named arguments in Objective—C?
- speps 9y agoThat article mentions "Object pinning", something usually only useful when you have a GC.
- yoda_sl 9y agoSee the answer for the 2nd comment: Memory management is cooperating with Objectve-C runtime memory mgmt, see https://github.com/JetBrains/kotlin-native/blob/master/runtime/src/main/cpp/Memory.cpp#L398 https://github.com/JetBrains/kotlin-native/blob/master/runti... (function runDeallocationHooks())
- naasking 9y ago> Is kotlin native reference counted like swift or do they use some form of garbage collection? Reference counting is garbage collection.
- nudpiedo 9y agoI guess that now all libraries should be built with the cross platform mindset, including platform abstraction, multitarget testing and avoid leaking interfaces... the compiler and the standard library are just the beginning.
- jorgemf 9y agoI hope so, but I think it is very unlikely to happen. Bear in mind that the libraries for Android, iOS, Windows, Linux are completely different, so it is not easy to make a wrapper around them. And if you want something to run in different platforms you still have the jre.
- _alastair 9y agoThis is a really interesting development. I've been poking around with making a cross-platform library lately, and had settled on Go because it does such a great job of building for iOS and Android simply (though the go bind tool), but the implementation feels a little messy because the nature of Go (e.g., no classes, property accessors, etc) doesn't translate easily to Objective-C or Java. So Kotlin might be a really interesting alternative here.
- afsina 9y agoHow about Flutter with Dart? It uses AOT so plays well with IOs. But granted, their approaches are very different as Flutter renders most things by itself.
- _alastair 9y agoThe project I'm working on doesn't use any UI (that's still native), so I'd disregarded Flutter - but perhaps that's not fair. Looking at it, it seems to have straightforward ways to use native functionality, but I'm not 100% sure how I might go about exposing Dart classes/methods/etc to existing native code. Worth looking into, though - thanks!
- AhtiK 9y agoIs my understanding correct that IntelliJ IDEA will not have Kotlin/Native support, it will be only part of CLion? https://blog.jetbrains.com/kotlin/2017/11/kotlinnative-ide-support-preview/ https://blog.jetbrains.com/kotlin/2017/11/kotlinnative-ide-s... Is this because C and C++ is CLion-only? I'd love to see C&C++ support become part of IntelliJ IDEA bundle ;) Not sure why it hasn't been this way.
- teilo 9y agoJetBrains IDEs are tooled for particular language workflows, but can, to a certain extent accommodate other languages through its plugins, though not as thoroughly as the corresponding IDE. (For example, you can still use the Python plugin in IntelliJ, but PyCharm has far more extensive support.) CLion is the product targeting the CLang family of languages, and therefore that is where, quite reasonably, JetBrains has targeted its Kotlin/Native support.
- AhtiK 9y agoMy trouble with multiple IDEs approach is that most of the projects involve multiple languages and for me it doesn't make sense to start up PyCharm for Python and IDEA for Java. Would feel awkward to keep two IDEs configured to work in sync (both settings, shared code folders) and handle unnecessary RAM and CPU use. Regarding general workflow, I would also have to make some a mental decision if .txt, .md, .sql, .js belong to my IDEA or PyCharm IDE. So, unfortunately, for my case, everything goes through IDEA, regardless of having a separate IDEs with more extensive support for Python, Ruby etc :(
- dagaci 9y agoI have a mac but can anyone comment in using these tools on windows if this is possible.
- teilo 9y agoAll JetBrains IDEs are cross platform (Linux, Mac, Windows). Kotlin Native has support packages for all three for developing to those targets. https://bintray.com/jetbrains/kotlin-native-dependencies https://bintray.com/jetbrains/kotlin-native-dependencies
- teilo 9y agoKotlin/Native sounds like everything that GCJ was not.
- ptx 9y agoWell, it's definitely true that it's not like GCJ, because it doesn't compile Java code and doesn't support Java libraries. So you can't just take a Kotlin/JVM program and compile it for Kotlin/Native, since the JVM-based libraries it uses won't be available. But both GCJ and Kotlin/Native compile a high-level, garbage-collected language to native executables, so I suppose they're similar in that sense.