---
source: src/feeds/rss.rs
expression: result
---
[
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=6605",
        link: "https://blog.jetbrains.com/kotlin/2018/10/kotlin-1-3/",
        title: "Kotlin 1.3 Released with Coroutines, Kotlin/Native Beta, and more",
        date: 2018-10-29T15:18:36Z,
        summary: Some(
            "You can read this blog post in other languages: Today we are releasing Kotlin 1.3 together with a set of accompanying libraries, build tools, and learning materials! We develop Kotlin to be a good tool for all application developers, at … Continue reading →",
        ),
        content: Some(
            "<p></p><center><p></p>\n<div>You can read this blog post in other languages:<br>\n<a title=\"Chinese\" href=\"https://www.kotliner.cn/2018/10/kotlin-1-3/\" rel=\"noopener noreferrer\"><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2017/03/china.png\" width=\"25\"></a><a title=\"French\" href=\"https://blog.jetbrains.com/fr/2018/10/kotlin-1-3-maintenant-disponible-avec-coroutines-kotlinnative-beta-et-bien-plus-encore/\" rel=\"noopener noreferrer\"><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2017/03/france.png\" width=\"25\"></a><a title=\"Japanese\" href=\"https://blog.jetbrains.com/jp/2018/10/30/1511\" rel=\"noopener noreferrer\"><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2017/03/japan.png\" width=\"25\"></a><a title=\"Russian\" href=\"https://habr.com/company/JetBrains/blog/428291/\" rel=\"noopener noreferrer\"><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2017/03/russia.png\" width=\"25\"></a><a title=\"Spanish\" href=\"https://kotlin.es/2018/10/kotlin-1-3/\" rel=\"noopener noreferrer\"><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2017/03/spain.png\" width=\"25\"></a></div>\n<p></p></center><p></p>\n<p></p>\n<p>Today we are releasing Kotlin 1.3 together with a set of accompanying libraries, build tools, and learning materials!</p>\n<p>We develop Kotlin to be a good tool for all application developers, at all scales and on all platforms. In Kotlin 1.3 coroutines graduated to stable, making non-blocking code easy to read and write. Scalability has never been as approachable before! This release also brings Kotlin/Native Beta that compiles Kotlin code directly to native binaries. The multiplatform capabilities of Kotlin now cover all supported platforms so one can share business logic between such components as Android and iOS apps. Servers can share logic with web and mobile clients too, and multiplatform libraries make everyday tasks easily portable.</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2018/10/1_3_banner_dark.png\" alt=\"1_3_banner_dark\" width=\"1000\" height=\"500\"></p>\n<p>We’ll organize a series of webinars covering major features of 1.3. Subscribe here:</p>\n\n<div></div>\n<p><span></span></p>\n<h1>Community and Ecosystem</h1>\n<p>Kotlin has seen an unprecedented growth in adoption this year. Since January 2018, about 1.5 million users wrote Kotlin code, and this number has more than doubled since last year. The trends on StackOverflow and in our public Slack are also very encouraging. We are grateful to the Kotlin community for being supportive and welcoming!</p>\n<p>We are happy to see the ecosystem around Kotlin grow and mature. Kotlin is friends with <a href=\"https://cloud.google.com/kotlin\" rel=\"noopener noreferrer\">Google Cloud Platform</a>, the <a href=\"https://spring.io/guides/tutorials/spring-boot-kotlin/\" rel=\"noopener noreferrer\">Spring Framework</a> and <a href=\"https://gradle.org/kotlin\" rel=\"noopener noreferrer\">Gradle</a>, not to mention the <a href=\"https://developer.android.com/kotlin/\" rel=\"noopener noreferrer\">first-class support on Android</a>. The open source community is creating excellent libraries such as <a href=\"https://github.com/ReactiveX/RxKotlin\" rel=\"noopener noreferrer\">RxKotlin</a>, <a href=\"https://github.com/nhaarman/mockito-kotlin\" rel=\"noopener noreferrer\">mockito-kotlin</a>, <a href=\"https://tornadofx.io/\" rel=\"noopener noreferrer\">TornadoFX</a>, <a href=\"http://kodein.org/Kodein-DI/\" rel=\"noopener noreferrer\">Kodein</a>,  and <a href=\"https://github.com/arrow-kt/arrow\" rel=\"noopener noreferrer\">ΛRROW</a>. And projects like <a href=\"https://github.com/square/okio\" rel=\"noopener noreferrer\">Square’s Okio</a> and <a href=\"https://blog.documentfoundation.org/blog/2018/09/22/libreoffice-at-droidcon-vienna/\" rel=\"noopener noreferrer\">LibreOffice</a> are migrating to Kotlin or planning to do so. Everyone is welcome to join the Kotlin ecosystem with their great ideas and projects!</p>\n<p>Many people outside JetBrains contributed to Kotlin 1.3 with pull requests, bug reports and all kinds of feedback. We appreciate your help a lot and are really happy to move Kotlin forward together!</p>\n<h1>Coroutines are now stable</h1>\n<p>Coroutines are a modern way to write non-blocking asynchronous code that’s easy to understand and evolve. It’s a powerful tool for anything from offloading work onto background workers to implementing complicated network protocols. The <a href=\"https://github.com/Kotlin/kotlinx.coroutines\" rel=\"noopener noreferrer\">kotlinx.coroutines</a> library hits 1.0 release and provides a solid foundation for managing asynchronous jobs at any scale including composition, cancelation, exception handling and UI-specific use cases.</p>\n<p>Get started today at <a href=\"http://kotl.in/coroutines\" rel=\"noopener noreferrer\">kotl.in/coroutines</a>!<br>\nSubscribe to a Coroutines Webinar <a href=\"https://info.jetbrains.com/kotlin-webinars-general-subscription.html\" rel=\"noopener noreferrer\">here</a></p>\n<h1>Kotlin/Native Beta</h1>\n<p>Kotlin/Native uses <a href=\"https://llvm.org/\" rel=\"noopener noreferrer\">LLVM</a> to compile Kotlin sources to standalone binaries (no VM required!) for various operating systems and CPU architectures including iOS, Linux, Windows, Mac and even WebAssembly and embedded systems like STM32. It features fully automatic memory management, can interoperate with C, Objective-C (and Swift), and exposes platform APIs such as Core Foundation, POSIX, and any native library you fancy!</p>\n<p>The Kotlin/Native runtime promotes immutable data and prohibits any attempts of sharing unprotected mutable state between threads. In fact, threads don’t exist for Kotlin/Native, they are abstracted away as a low-level implementation detail and replaced by workers — a safe and manageable way of doing concurrency.</p>\n<p>Discover Kotlin/Native at <a href=\"http://kotl.in/native\" rel=\"noopener noreferrer\">kotl.in/native</a>.<br>\nSubscribe to a webinar <a href=\"https://info.jetbrains.com/kotlin-webinars-general-subscription.html\" rel=\"noopener noreferrer\">here</a></p>\n<h1>Multiplatform projects and tooling</h1>\n<p>Working on all platforms is an explicit goal for Kotlin, but we see it as a premise to a much more important goal: sharing code between platforms. With support for JVM, Android, JavaScript, and Native, Kotlin can handle any and all components of a modern application. And this brings the invaluable benefit of reuse for code and expertise, saving the effort for tasks more challenging than implementing everything twice or multiple times. While multiplatform capabilities in Kotlin are still experimental, 1.3 makes a big step forward.</p>\n<p>Kotlin 1.3 ships with a set of multiplatform libraries that cover everyday tasks such as <a href=\"http://ktor.io/clients/http-client/multiplatform.html\" rel=\"noopener noreferrer\">HTTP</a>, <a href=\"https://github.com/Kotlin/kotlinx.serialization\" rel=\"noopener noreferrer\">serialization</a> and <a href=\"https://github.com/Kotlin/kotlinx.coroutines\" rel=\"noopener noreferrer\">managing coroutines</a>. The easiest way to write multiplatform code is to rely on such libraries. You can also create your own multiplatform libraries wrapping platform-specific dependencies into a common API.</p>\n<p>Start sharing code across platforms now: <a href=\"http://kotl.in/multiplatform\" rel=\"noopener noreferrer\">kotl.in/multiplatform</a>.<br>\nSubscribe to a webinar <a href=\"https://info.jetbrains.com/kotlin-webinars-general-subscription.html\" rel=\"noopener noreferrer\">here</a></p>\n<h1>Tooling for Kotlin/Native and Multiplatform</h1>\n<p>Kotlin 1.3 features tooling support for Kotlin/Native and Multiplatform projects that’s available in IntelliJ IDEA Community Edition, IntelliJ IDEA Ultimate, and Android Studio. All code editing features such as error highlighting, code completion, navigation and refactoring are available in all the three IDEs. We’ll be working on more advanced features and integrations with commercial tooling.</p>\n<h1>Ktor 1.0 Beta</h1>\n<p>Ktor, our connected applications framework that implements the entire HTTP stack fully asynchronously using coroutines, has reached Beta and is available at <a href=\"https://ktor.io/\" rel=\"noopener noreferrer\">ktor.io</a>.</p>\n<h1>Other improvements</h1>\n<p>In addition to everything covered so far, this release comes with many other features and improvements, including:</p>\n<ul>\n<li>Experimental support for <a href=\"https://kotlinlang.org/docs/reference/whatsnew13.html#inline-classes\" rel=\"noopener noreferrer\">inline classes</a> for performance and type safety</li>\n<li>Experimental support for <a href=\"https://kotlinlang.org/docs/reference/whatsnew13.html#unsigned-integers\" rel=\"noopener noreferrer\">unsigned integers</a> to facilitate byte-manipulation and other low-level code</li>\n<li><a href=\"https://kotlinlang.org/docs/reference/whatsnew13.html#capturing-when-subject-in-a-variable\" rel=\"noopener noreferrer\">Subject in <code>when</code> expressions</a> to reduce boilerplate</li>\n<li><a href=\"https://kotlinlang.org/docs/reference/whatsnew13.html#contracts\" rel=\"noopener noreferrer\">Contracts</a> to improve static analysis for library calls</li>\n<li><a href=\"https://kotlinlang.org/docs/reference/whatsnew13.html#parameterless-main\" rel=\"noopener noreferrer\">No-arg entry point</a> for cleaner beginners’ experience</li>\n<li><a href=\"https://plugins.jetbrains.com/plugin/10301-kotlin-sequence-debugger\" rel=\"noopener noreferrer\">Sequence debugger</a> for visualizing lazy computations</li>\n<li>Scratch files, REPL and <a href=\"https://kotlinlang.org/docs/reference/whatsnew13.html#scripting-update\" rel=\"noopener noreferrer\">scripting improvements</a> for smoothly working with scripts and code snippets</li>\n<li><a href=\"https://kotlinlang.org/api/latest/jvm/stdlib/index.html\" rel=\"noopener noreferrer\">Standard Library</a> expanded to Kotlin/Native, improved support for Kotlin/JS, got Random on all platforms and has other improvements and bug fixes.</li>\n<li>Experimental incremental compilation for Kotlin/JS</li>\n</ul>\n<p>See full description in our <a href=\"https://kotl.in/1.3\" rel=\"noopener noreferrer\">What’s New page</a>. The changelog is available <a href=\"https://github.com/JetBrains/kotlin/blob/1.3.0/ChangeLog.md\" rel=\"noopener noreferrer\">here</a>. The compatibility guide is <a href=\"http://kotlinlang.org/docs/reference/compatibility-guide-13.html\" rel=\"noopener noreferrer\">here</a>.</p>\n<h1>KotlinConf</h1>\n<p>We’ve just published all the videos from KotlinConf 2018 covering the hottest topics of the 1.3 release. Check out the opening keynote and session recordings to deep dive on what’s new and noteworthy:</p>\n\n<div>\n<div>\n\n  </div>\n<div>\n<a href=\"https://youtu.be/-lVVfxsRjcY\" rel=\"noopener noreferrer\"><br>\n</a><a href=\"https://youtu.be/jT2gHPQ4Z1Q\" rel=\"noopener noreferrer\"><br>\n</a><a href=\"https://youtu.be/Sy6ZdgqrQp0\" rel=\"noopener noreferrer\">\n  </a></div><a href=\"https://youtu.be/Sy6ZdgqrQp0\" rel=\"noopener noreferrer\">\n<div></div>\n</a></div><a href=\"https://youtu.be/Sy6ZdgqrQp0\" rel=\"noopener noreferrer\">\n</a><p><a href=\"https://youtu.be/Sy6ZdgqrQp0\" rel=\"noopener noreferrer\"></a><a href=\"https://www.youtube.com/playlist?list=PLQ176FUIyIUbVvFMqDc2jhxS-t562uytr\" rel=\"noopener noreferrer\">Watch more KotlinConf 2018 videos on JetBrains TV</a></p>\n<h1>Learning Kotlin</h1>\n<p>We do our best to make learning Kotlin easy and fun. Out of the <a href=\"http://kotl.in/learn\" rel=\"noopener noreferrer\">numerous resources</a> available, we’d like to highlight these:</p>\n<ul>\n<li>A new course by Svetlana Isakova and Andrey Breslav is starting on <a href=\"https://www.coursera.org/learn/kotlin-for-java-developers\" rel=\"noopener noreferrer\">Coursera</a></li>\n<li>Atomic Kotlin, a book for beginners by Bruce Eckel and Svetlana Isakova is open for <a href=\"https://www.atomickotlin.com/earlyaccess/\" rel=\"noopener noreferrer\">early access</a></li>\n<li>The new <a href=\"http://play.kotl.in/\" rel=\"noopener noreferrer\">play.kotl.in</a> mini-web-IDE has Koans, Examples and embeddable code snippets</li>\n<li>The <a href=\"https://kotlinlang.org/docs/tutorials/edu-tools-learner.html\" rel=\"noopener noreferrer\">EduTools</a> plugin helps learn Kotlin right in the IDE</li>\n<li><a href=\"https://www.jetbrains.com/company/partners/kotlin/\" rel=\"noopener noreferrer\">Certified Kotlin Training</a> is available from multiple providers around the world</li>\n</ul>\n<p>The <a href=\"https://info.jetbrains.com/kotlin-webinars-general-subscription.html\" rel=\"noopener noreferrer\">Kotlin 1.3 webinars</a> will be a great starting point for everyone.</p>\n<h1>How to upgrade</h1>\n<p>As always, you can <strong>try Kotlin online</strong> at <a href=\"http://play.kotl.in/\" rel=\"noopener noreferrer\">play.kotl.in</a>.</p>\n<ul>\n<li><strong>In Maven, Gradle and npm</strong>: Use <code>1.3.0</code> as the version number for the compiler and the standard library. See the docs <a href=\"http://kotlinlang.org/docs/reference/using-gradle.html\" rel=\"noopener noreferrer\">here</a>.</li>\n<li><strong>In IntelliJ IDEA</strong>: 2018.3 has Kotlin 1.3 bundled, in earlier versions Install or update the Kotlin plugin to version 1.3.</li>\n<li><strong>In Android Studio</strong>: Install or update the plugin through <em>Plugin Manager</em>.</li>\n<li><strong>In Eclipse</strong>: install the plugin using <a href=\"https://marketplace.eclipse.org/content/kotlin-plugin-eclipse\" rel=\"noopener noreferrer\">Marketplace</a>.</li>\n<li><strong>The command-line compiler</strong> can be downloaded from the <a href=\"https://github.com/JetBrains/kotlin/releases/tag/v1.3.0\" rel=\"noopener noreferrer\">Github release page</a>.</li>\n</ul>\n<p><em>Let’s Kotlin!</em></p>\n<p>P.S. <em>You can discuss this post on <a href=\"https://www.reddit.com/r/programming/comments/9se28o/kotlin_13_is_here_coroutines_kotlinnative_beta/\" rel=\"noopener noreferrer\">Reddit</a> and <a href=\"https://news.ycombinator.com/item?id=18328202\" rel=\"noopener noreferrer\">Hacker News</a> or leave a comment below</em></p>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2017/03/china.png",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2018/10/kotlin-1-3/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=6762",
        link: "https://blog.jetbrains.com/kotlin/2018/11/ktor-1-0/",
        title: "Ktor 1.0 Released:  A Connected Applications Framework by JetBrains",
        date: 2018-11-19T18:59:22Z,
        summary: Some(
            "As we work on Kotlin, we implement many features that help build idiomatic and high-performing APIs. We’ve been dreaming of seeing a Web framework that utilizes these features to the max. Today, we can finally say we’ve built that kind … Continue reading →",
        ),
        content: Some(
            "<p>As we work on Kotlin, we implement many features that help build idiomatic and high-performing APIs. We’ve been dreaming of seeing a Web framework that utilizes these features to the max. Today, we can finally say we’ve built that kind of framework! Please welcome <a href=\"http://ktor.io/\" rel=\"noopener noreferrer\">Ktor</a>, which has just reached 1.0.</p>\n<p>Ktor is a Kotlin framework for building asynchronous servers and clients in connected systems. It is being created by the Kotlin team, and as such, it takes full advantage of the language in order to provide a great developer experience and excellent runtime performance.</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2018/11/Ktor.png\" alt=\"Ktor\" width=\"1600\" height=\"800\"></p>\n<p>Ktor is built from the ground up using <strong>coroutines</strong>, which make it possible to express complex asynchronous constructs as if they were simple sequential code. Coroutines are also quite efficient at runtime. In addition, the use of Kotlin features allows us to provide a <strong>domain-specific language (DSL)</strong> — a concise and developer-friendly API for configuring your application with no magic, just code.</p>\n<p><span></span></p>\n<p>Of course, Ktor is not the only option for building server-side applications in Kotlin. We’re pleased to see that other frameworks such as Spring and Vert.x are providing first-class support for Kotlin, and using these frameworks is a great way to preserve your existing investment and experience. At the same time, Ktor offers unique advantages thanks to its use of coroutines and DSLs, which makes it a great option when you’re starting a new backend project or a microservice.</p>\n<p>Ktor is already deployed in production in a number of projects running at scale. For example, <a href=\"http://hltv.org/\" rel=\"noopener noreferrer\">HLTV.org</a> serves about 200 million pageviews per month and about 3.1 billion pageviews in total on Ktor. The latest release of the <a href=\"https://www.thoughtworks.com/radar/languages-and-frameworks\" rel=\"noopener noreferrer\">ThoughtWorks Technology Radar</a> lists Ktor in their Assess category.</p>\n<h1>What’s Included</h1>\n<p>The two main parts of Ktor are the <strong>HTTP server framework</strong>, running on the JVM, and the <strong>multiplatform HTTP client</strong>. As a JetBrains project, Ktor naturally comes with helpful <a href=\"https://plugins.jetbrains.com/plugin/10823-ktor\" rel=\"noopener noreferrer\">tools</a> to get you started with new projects quickly.</p>\n<h2>Server</h2>\n<p>The <strong>HTTP server</strong> part is built upon proven technologies like Netty, Jetty, and also Java servlets. When using lightweight engines like Netty or Jetty, it starts ultrafast and is ready to receive connections in under a second. It is compatible with the <a href=\"https://12factor.net/\" rel=\"noopener noreferrer\">12 Factors</a> paradigm, is container-friendly, and can easily be embedded into desktop (or even Android) applications. You can also run it in an application server such as Tomcat.</p>\n<p>Ktor provides a rich and easy-to-use extensibility mechanism, on top of which most of the built-in functionality is implemented. Third-party features look no different from the built-in ones. Out of the box, Ktor includes all the essential features like sessions, authentication, JSON serialization, popular template engines, Web sockets, metrics, and many others. It also supports a productive development workflow, with a fast start, automatic reloading, and easy-to-use facilities for writing unit and integration tests.</p>\n<h2>Client</h2>\n<p>The <strong>client</strong> part is asynchronous as well, built using the same coroutines and IO primitives that drive the server. This makes it perfect for building asynchronous microservice architectures, connecting all the backend functionality into asynchronous pipelines.</p>\n<p>The client is implemented as a multiplatform library, which currently supports JVM, JS, Android, and iOS. This makes it possible to retrieve data on mobile devices and web pages in a uniform way, without blocking application execution or building complex chains of anonymous functions to handle successes or failures.</p>\n<h2>Tools</h2>\n<p>Last but not least, the <strong>tools</strong> let you select the features you need and get a fully working starter app with Ktor. This works both <a href=\"http://start.ktor.io/\" rel=\"noopener noreferrer\">on the Web</a> and via a <a href=\"https://plugins.jetbrains.com/plugin/10823-ktor\" rel=\"noopener noreferrer\">plugin</a> for IntelliJ IDEA.</p>\n<p>Like all other Kotlin libraries, Ktor is free and open-source, developed <a href=\"https://github.com/ktorio/ktor\" rel=\"noopener noreferrer\">on GitHub</a> and released under the Apache 2 license.</p>\n<h1>Getting Started</h1>\n<p>The Hello World of Ktor is small enough to fit in a tweet:</p>\n<pre>fun main() {\n    embeddedServer(Netty, port = 8080) {\n        routing {\n            get(\"/\") {\n                call.respondText(\"Hello World!\")\n            }\n        }\n    }.start(wait = true)\n}\n</pre>\n<p>To go beyond that, the website provides a <a href=\"https://ktor.io/quickstart/index.html\" rel=\"noopener noreferrer\">Quickstart guide</a>, extensive documentation for writing <a href=\"https://ktor.io/servers/index.html\" rel=\"noopener noreferrer\">servers</a> and <a href=\"https://ktor.io/clients/index.html\" rel=\"noopener noreferrer\">clients</a>, and many <a href=\"https://ktor.io/samples/index.html\" rel=\"noopener noreferrer\">sample projects</a>. If you prefer videos, Ryan Harter’s <a href=\"https://www.youtube.com/watch?list=PLQ176FUIyIUbVvFMqDc2jhxS-t562uytr&amp;v=V4PS3IjIzlw\" rel=\"noopener noreferrer\">KotlinConf 2018 talk</a> is a great introduction to using Ktor on the backend.</p>\n<p>Hop over to <a href=\"https://start.ktor.io/\" rel=\"noopener noreferrer\">https://start.ktor.io/</a> to get a project template, check out the docs, and your new backend will be up and running in no time! If you need help, the friendly folks on the #ktor channel on <a href=\"http://slack.kotlinlang.org/\" rel=\"noopener noreferrer\">Kotlin Slack</a> are there for you.</p>\n<p>Have a nice Ktor!</p>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2018/11/Ktor.png",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2018/11/ktor-1-0/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=6780",
        link: "https://blog.jetbrains.com/kotlin/2018/11/join-kotlin-1-3-webinars/",
        title: "Kotlin 1.3 Webinars. Update: the recordings and slides are available",
        date: 2018-11-22T13:19:28Z,
        summary: Some(
            "JetBrains is hosting two webinars on Kotlin 1.3 this December. Both events aim to explore the most common use cases and the challenges in adopting Coroutines, Kotlin/Native, and Multiplatform Projects. Andrey Breslav will answer the questions you have on Kotlin … Continue reading →",
        ),
        content: Some(
            "<p>JetBrains is hosting two webinars on Kotlin 1.3 this December. Both events aim to explore the most common use cases and the challenges in adopting Coroutines, Kotlin/Native, and Multiplatform Projects.</p>\n<p>Andrey Breslav will answer the questions you have on Kotlin 1.3 and our future plans during the Q&amp;A session. To ask your questions, use <strong>#kotlinask_13</strong> on Twitter or use YouTube chat during the webinar.</p>\n<p>The recordings of the webinars are available on JetBrains TV: <a href=\"https://www.youtube.com/watch?v=9HUFo4WyDPI\" rel=\"noopener noreferrer\">Kotlin Coroutines presentation</a> by Roman Elizarov, <a href=\"https://www.youtube.com/watch?v=ewhjnz5AHmw\" rel=\"noopener noreferrer\">Kotlin 1.3 Q&amp;A with Andrey Breslav</a>, and <a href=\"https://youtu.be/k4G6AAR0Fds\" rel=\"noopener noreferrer\">Kotlin Multiplatform projects (MPP), Kotlin/Native</a> by Nikolay Igotti. The slides are available as well: <a href=\"https://resources.jetbrains.com/storage/products/kotlin/webinars/roman-elizarov-andrey-breslav.pdf\" rel=\"noopener noreferrer\">Kotlin 1.3 overview</a>, <a href=\"https://resources.jetbrains.com/storage/products/kotlin/webinars/2018_webinar_coroutines.pdf\" rel=\"noopener noreferrer\">Coroutines</a>, <a href=\"https://resources.jetbrains.com/storage/products/kotlin/webinars/2018_webinar_mpp.pdf\" rel=\"noopener noreferrer\">MPP</a>, <a href=\"https://resources.jetbrains.com/storage/products/kotlin/webinars/2018_webinar_native.pdf\" rel=\"noopener noreferrer\">Kotlin/Native</a>.</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2018/11/Kotlin_Webinars_1920x1080_08-1.png\" alt=\"Kotlin_Webinars_1920x1080_08 (1)\" width=\"3840\" height=\"2160\"></p>\n<p>Both events are free to attend and will be broadcast on the JetBrains TV YouTube channel. To get the link, please register for the webinar and we will notify you by email.</p>\n\n<div></div>\n<p><span></span></p>\n<h2>Kotlin Coroutines and Kotlin 1.3 Q&amp;A</h2>\n<p>December 5th, 16.00 – 17.30 CET</p>\n<p><strong>16.00 – 16.10</strong> We will start with a short Kotlin 1.3 overview by Andrey Breslav<br>\n<strong>16.10 – 16.55</strong> Kotlin Coroutines presentation by Roman Elizarov</p>\n<p>Kotlin Coroutines is a foundational feature in Kotlin language that enables easy-to-write/easy-to-read asynchronous programming and more. For those of you who are familiar with other asynchronous programming abstractions like callbacks, futures/promises, and async/await, we’ll give an overview of the similarities and differences, and highlight the key features of Kotlin’s design.</p>\n<p><strong>16.55 – 17.30</strong> Kotlin 1.3 Q&amp;A with Andrey Breslav. You can ask your questions via Twitter or the YouTube chat during the event.</p>\n<h2>Kotlin Native and Multiplatform Projects</h2>\n<p>December 12th, 16.00 – 17.30 CET</p>\n<p><strong>16.00 – 16.30</strong> Kotlin/Native presentation by Nikolay Igotti</p>\n<p>Is Kotlin a JVM-only language? Can I explore and improve Apple or Linux ecosystem using Kotlin and JetBrains’ tools I know and love? How far I can go? We will discuss Kotlin/Native, its features and limitations, the technology behind it, innovative concurrency approach, our mid-term roadmap, and long-term plans.</p>\n<p><strong>16.30 – 16.40</strong> break</p>\n<p><strong>16.40 – 17.25</strong> Kotlin Multiplatform Projects by Nikolay Igotti</p>\n<p>Are fully functional mobile applications doomed to be written twice for iOS and Android? Will common porting layer (like in React Native, Flutter) cut off all the cool platform-specific features? Can JetBrains provide us with tools suitable for multiplatform development? We will discuss the philosophy behind Kotlin multiplatform (MPP) technology, supported target platforms and ecosystems, available tools, multiplatform libraries, and how to use Kotlin everywhere you need it.</p>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2018/11/Kotlin_Webinars_1920x1080_08-1.png",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2018/11/join-kotlin-1-3-webinars/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=6808",
        link: "https://blog.jetbrains.com/kotlin/2018/12/kotlinconf-2018-videos-slides-and-photos-are-out/",
        title: "KotlinConf 2018 Videos, Slides, and Photos are Out!",
        date: 2018-12-04T13:42:05Z,
        summary: Some(
            "The KotlinConf 2018 videos and their accompanying slides are all now available on the schedule on the website. In addition to this, there are two playlists on the JetBrains TV channel which cover day one and day two. The pictures … Continue reading →",
        ),
        content: Some(
            "<p>The KotlinConf 2018 videos and their accompanying slides are all now available on the <a href=\"https://kotlinconf.com/talks/\" rel=\"noopener noreferrer\">schedule on the website</a>. In addition to this, there are two playlists on the JetBrains TV channel which cover <a href=\"https://www.youtube.com/playlist?list=PLQ176FUIyIUbVvFMqDc2jhxS-t562uytr\" rel=\"noopener noreferrer\">day one</a> and <a href=\"https://www.youtube.com/watch?v=R5agKyMFVzo&amp;index=31&amp;list=PLQ176FUIyIUbVvFMqDc2jhxS-t562uytr\" rel=\"noopener noreferrer\">day two</a>. The pictures from the event have been uploaded too. Check out the <a href=\"https://kotlinconf.com/photos/\" rel=\"noopener noreferrer\">picture gallery</a>, and try and find yourself, your friends, and your colleagues, in some of the biggest highlights from the event!</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2018/12/20181004_hucopix_055-copy.jpg\" alt=\"20181004_hucopix_055 copy\" width=\"1024\" height=\"683\"></p>\n<p><span></span></p>\n<h2>About KotlinConf 2018</h2>\n<p>KotlinConf 2018 took place in Amsterdam on October 3-5. Over 1300 people from 52 countries joined the event – Brazil, Japan, and Australia were among them. We had talk proposals submitted from 282 speakers, which was twice as many as in 2017. Around 25,000 people tuned in to watch us online over the two conference days. About 150,000 people have already viewed the video recordings of the talks since the event.</p>\n<p>This is all a huge success for us! A big thank you to everyone who took part and to our 19 partners who helped us to make this all possible. We would like to also say a massive thank you to all the amazing speakers at the conference who worked so hard to share their knowledge with us and make the event a truly joyful occasion.</p>\n<p><a href=\"https://kotlinconf.com/#form\" rel=\"noopener noreferrer\">Subscribe to our newsletter</a> to stay up to date with KotlinConf 2019.</p>\n<h2>Kotlin 1.3 Talks</h2>\n<p>If you are looking for more learning materials on the recently released Kotlin 1.3 features, here they are. Check out four of the talks by the Kotlin team from KotlinConf 2018. By the way, don’t forget to <strong><a href=\"https://blog.jetbrains.com/kotlin/2018/11/join-kotlin-1-3-webinars/\" rel=\"noopener noreferrer\">join our Kotlin 1.3 webinars</a></strong>, and the online Q&amp;A session with Andrey Breslav.</p>\n<ol>\n<li><a href=\"https://www.youtube.com/watch?time_continue=685&amp;v=PsaFVLr8t4E\" rel=\"noopener noreferrer\">Kotlin Keynote</a> by Andrey Breslav</li>\n<li><a href=\"https://www.youtube.com/watch?v=nw6YTfEyfO0&amp;index=20&amp;list=PLQ176FUIyIUbVvFMqDc2jhxS-t562uytr\" rel=\"noopener noreferrer\">Kotlin/Native concurrency model</a> by Nikolay Igotti</li>\n<li><a href=\"https://www.youtube.com/watch?v=MyljSWm0Y_k&amp;feature=youtu.be&amp;list=PLQ176FUIyIUbVvFMqDc2jhxS-t562uytr\" rel=\"noopener noreferrer\">New Type Inference and Related Language Features</a> by Svetlana Isakova</li>\n<li><a href=\"https://www.youtube.com/watch?list=PLQ176FUIyIUbVvFMqDc2jhxS-t562uytr&amp;v=a3agLJQ6vt8\" rel=\"noopener noreferrer\">Kotlin Coroutines in Practice</a> by Roman Elizarov</li>\n</ol>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2018/12/20181004_hucopix_055-copy.jpg",
        ),
        comments_link: None,
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=6822",
        link: "https://blog.jetbrains.com/kotlin/2018/12/gradle-kotlin-dsl-1-0/",
        title: "Gradle Kotlin DSL 1.0",
        date: 2018-12-10T17:34:37Z,
        summary: Some(
            "This is a guest blog post from Paul Merlin software engineer for Gradle The recently released Gradle 5.0 includes the Gradle Kotlin DSL v1.0 which is now ready for widespread use. We want you to enjoy a build authoring experience … Continue reading →",
        ),
        content: Some(
            "<p></p><center><p></p>\n<div>\n<p><img title=\"Paul Merlin\" src=\"https://avatars3.githubusercontent.com/u/132773?s=400&amp;v=4\" alt=\"Paul Merlin\" width=\"70\" height=\"70\"><br>\nThis is a guest blog post from <a href=\"https://github.com/eskatos\" rel=\"noopener noreferrer\">Paul Merlin</a><br>\n<i>software engineer for Gradle</i>\n</p></div>\n<p></p></center><p></p>\n<p>The recently released <a href=\"https://docs.gradle.org/5.0/release-notes.html\" rel=\"noopener noreferrer\">Gradle 5.0</a> includes the <a href=\"https://github.com/gradle/kotlin-dsl/releases/tag/v1.0.2\" rel=\"noopener noreferrer\">Gradle Kotlin DSL v1.0</a> which is now ready for widespread use.</p>\n<p>We want you to enjoy a build authoring experience with the benefits provided by Kotlin’s static type system in Intellij IDEA and Android Studio: auto-completion, smart content assist, quick access to documentation, navigation to source and context-aware refactoring.</p>\n<p></p><center><p></p>\n<div><br>\n<a href=\"https://gradle.org/images/hello-kotlin-2.webm\" rel=\"noopener noreferrer\">https://gradle.org/images/hello-kotlin-2.webm</a></div>\n<p>To view the video in Safari you may need to install the <a href=\"http://get.videolan.org/vlc/3.0.4/macosx/VLC-webplugin-3.0.4.dmg\" rel=\"noopener noreferrer\">VLC Web Browser Plugin</a>.</p>\n<p></p></center><p></p>\n<p>In case you missed it, you can watch Paul Merlin demonstrate these benefits in the <a href=\"https://www.youtube.com/watch?v=mAtrEPeAJSc\" rel=\"noopener noreferrer\">Type-safe build logic with Gradle Kotlin DSL</a> video from KotlinConf 2018.</p>\n<p>If you prefer the flexibility and dynamic features of Groovy, that’s totally okay — the Groovy DSL will not be deprecated.</p>\n<h1>Using the Kotlin DSL today</h1>\n<p>You can get started quickly by following the <a href=\"https://guides.gradle.org/creating-new-gradle-builds/\" rel=\"noopener noreferrer\">Creating New Gradle Builds</a> guide. You can also follow one of the other guides like <a href=\"https://guides.gradle.org/building-kotlin-jvm-libraries/\" rel=\"noopener noreferrer\">Building Kotlin JVM Libraries</a> or <a href=\"https://guides.gradle.org/building-java-applications/\" rel=\"noopener noreferrer\">Building Java Applications</a>.</p>\n<p>The <a href=\"https://docs.gradle.org/current/userguide/kotlin_dsl.html\" rel=\"noopener noreferrer\">Gradle Kotlin DSL Primer</a> user manual chapter is the best place to start learning more: it will cover all the basics and answer most of your questions.</p>\n<p>If you are working with an existing build using the Gradle Groovy DSL you’ll be interested in the <a href=\"https://guides.gradle.org/migrating-build-logic-from-groovy-to-kotlin/\" rel=\"noopener noreferrer\">Migrating build logic from Groovy to Kotlin</a> guide.</p>\n<p>Several community plugins now have Gradle Kotlin DSL snippets in their documentation: <a href=\"https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/html/\" rel=\"noopener noreferrer\">Spring Boot</a>, <a href=\"https://bmuschko.github.io/gradle-docker-plugin/\" rel=\"noopener noreferrer\">Docker</a>, <a href=\"https://arturbosch.github.io/detekt/kotlindsl.html\" rel=\"noopener noreferrer\">Detekt</a>, <a href=\"https://github.com/jeremymailen/kotlinter-gradle\" rel=\"noopener noreferrer\">Kotlinter</a>, <a href=\"https://github.com/tbroyer/gradle-apt-plugin\" rel=\"noopener noreferrer\">APT</a>, <a href=\"https://github.com/mannodermaus/android-junit5/#readme\" rel=\"noopener noreferrer\">Android JUnit 5</a>, <a href=\"https://github.com/stoyicker/android-check-2\" rel=\"noopener noreferrer\">Android Check 2</a>, <a href=\"https://github.com/Triple-T/gradle-play-publisher\" rel=\"noopener noreferrer\">Android Play Publisher</a> and <a href=\"https://github.com/gradle/gradle/issues/6790\" rel=\"noopener noreferrer\">the list goes on</a>.</p>\n<p>Last but not least, the <a href=\"https://docs.gradle.org/\" rel=\"noopener noreferrer\">Gradle documentation</a> contains build script excerpts that demonstrate both the Groovy DSL and the Kotlin DSL. This is the best place to find how to all things with each DSL; and it covers all Gradle features.</p>\n<p>Again, a big thank you to all who helped make this a reality!</p>\n<h1>Feedback wanted</h1>\n<p>Community involvement has been instrumental to reach 1.0. It is also crucial going forward.</p>\n<p>We want to know what you think works well or poorly in the Kotlin DSL. Feedback on the IDE experience, logging, and everything in between is welcome. Please discuss through the <a href=\"https://github.com/gradle/kotlin-dsl/issues\" rel=\"noopener noreferrer\">Kotlin DSL issue tracker</a> or the <code>#kotlin-dsl</code> channel on <a href=\"https://gradle-community.slack.com/\" rel=\"noopener noreferrer\">Gradle Community Slack</a> (which you can join using <a href=\"https://join.slack.com/t/gradle-community/shared_invite/enQtNDE3MzAwNjkxMzY0LTYwMTk0MWUwN2FiMzIzOWM3MzBjYjMxNWYzMDE1NGIwOTJkMTQ2NDEzOGM2OWIzNmU1ZTk5MjVhYjFhMTI3MmE\" rel=\"noopener noreferrer\">this link</a>).</p>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "video/webm",
            },
        ),
        media_link: Some(
            "https://gradle.org/images/hello-kotlin-2.webm",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2018/12/gradle-kotlin-dsl-1-0/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=6857",
        link: "https://blog.jetbrains.com/kotlin/2018/12/kotlin-census-2018/",
        title: "Kotlin Census 2018",
        date: 2018-12-20T09:39:13Z,
        summary: Some(
            "Our Kotlin community is growing fast; the number of users has increased by almost 3 times this year. The feedback you give is very important to us both as newcomers who have just started using Kotlin in 2018 and as … Continue reading →",
        ),
        content: Some(
            "<p>Our Kotlin community is growing fast; the number of users has increased by almost 3 times this year. The feedback you give is very important to us both as newcomers who have just started using Kotlin in 2018 and as experienced Kotlin users.</p>\n<p>If you’re still hesitant about using Kotlin, we would like to know why. Your responses are very appreciated and important to us too.</p>\n<p>If you filled out the survey last year, thank you! To make sure we are keeping our information up to date it would be really helpful for us if you could, please, do it again this year. We’ve added a few new questions and modified the options available to respond with based on the last year’s results and the new technologies which have appeared in 2018.</p>\n<p>Please, could you kindly give us five minutes of your time and fill out the following survey.</p>\n<p>Thank you!</p>\n<p>By providing us with your details, this is not automatic consent for us to use your name, application, or company name. Your information is kept strictly confidential. We will always ask for written confirmation from you before we would ever try to use it.</p>\n<p><span></span></p>\n<p>By conducting regular brand awareness surveys with  &lt;a href=\"https://www.surveygizmo.com/survey-blog/market-research-types/\"&gt;SurveyGizmo,&lt;/a&gt; you can keep tabs on how effective your marketing campaigns really are. &lt;a href=\"http://www.surveygizmo.com/s3/4744337/eb368806a7a7??jsfallback=true\"&gt;Please take my survey now&lt;/a&gt;<br>\n\n</p>",
        ),
        media_type: None,
        media_link: None,
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2018/12/kotlin-census-2018/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=6878",
        link: "https://blog.jetbrains.com/kotlin/2019/01/kotlin-1-3-20-released/",
        title: "Kotlin 1.3.20 released",
        date: 2019-01-23T19:14:14Z,
        summary: Some(
            "We’re happy to announce the release of Kotlin 1.3.20, a new bug fix and tooling update for Kotlin 1.3. In addition to improvements to the compiler and IDE, this version: Allows running Gradle tasks in parallel within a single project … Continue reading →",
        ),
        content: Some(
            "<p>We’re happy to announce the release of Kotlin 1.3.20, a new bug fix and tooling update for Kotlin 1.3. In addition to improvements to the compiler and IDE, this version:</p>\n<ul>\n<li>Allows running Gradle tasks in parallel within a single project</li>\n<li>Allows building multiplatform projects via Gradle Kotlin DSL</li>\n<li>Brings improvements for inline classes</li>\n<li>Introduces a separate command line tool for Kapt</li>\n<li>Enables incremental compilation for Kotlin/JS by default</li>\n<li>Brings improvements to Kotlin/Native</li>\n</ul>\n<p>As always, we’d like to thank our numerous <a href=\"https://blog.jetbrains.com/kotlin/2019/01/kotlin-1-3-20-released/#external-contributions\" rel=\"noopener noreferrer\">external contributors</a>. The complete list of changes for this release can be found in the <a href=\"https://github.com/JetBrains/kotlin/blob/1.3.20/ChangeLog.md\" rel=\"noopener noreferrer\">change log</a>. Let’s dive in!</p>\n<p><span></span></p>\n<h2>Faster Gradle builds by parallelizing tasks</h2>\n<p>The Kotlin Gradle plugin can now run tasks in parallel within a project. Parallel execution is supported by using the Gradle Worker API. To make use of this feature, add the following setting to <code>gradle.properties</code> or <code>local.properties</code> file:</p>\n<pre>kotlin.parallel.tasks.in.project=true\n</pre>\n<p>This feature is beneficial for projects defining custom source sets, since the compilation of independent source sets can be parallelized. In the case of multiplatform projects, targets for different platforms can also be built in parallel. For Android, the debug and release build types can be compiled in parallel.</p>\n<p>We plan to enable the parallel task compilation by default at a later date, so we kindly ask for your feedback. Do let us know if you face any issues.</p>\n<h2>Multiplatform projects update</h2>\n<p>We continue working on multiplatform projects and improve different aspects based on your feedback.</p>\n<h3>Support for Kotlin Gradle DSL</h3>\n<p>You can now use Kotlin Gradle DSL to build multiplatform projects:</p>\n<pre>plugins {\n    kotlin(\"multiplatform\") version \"1.3.20\"\n}\n...\n\nkotlin {\n    ...\n    sourceSets {\n        val commonMain by getting {\n            dependencies {\n                implementation(kotlin(\"stdlib-common\"))\n            }\n        }\n}\n</pre>\n<p>You can check many examples in both Groovy and Kotlin in <a href=\"https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html\" rel=\"noopener noreferrer\">the documentation</a>.</p>\n<h3>DSL improvements</h3>\n<p>The DSL to set up a multiplatform project has been greatly improved and simplified. This blog post contains some highlights in comparison to the previous version. We recommend you read <a href=\"https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html\" rel=\"noopener noreferrer\">the updated guide</a> for more details and complete samples.</p>\n<p>You can now use shorthand for Kotlin dependencies. That is, instead of <code>\'org.jetbrains.kotlin:kotlin-stdlib\'</code> you write simply  <code>kotlin(\'stdlib\')</code>.</p>\n<p>In addition, supported targets can be specified directly instead of using the <code>fromPreset</code> function:</p>\n<pre>// prior\nkotlin {\n    targets {\n        fromPreset(presets.jvm, \'jvm\')\n        fromPreset(presets.js, \'nodeJs\') {\n            /* additional configuration */\n        }\n    }\n}\n</pre>\n<pre>// currently\nkotlin {    \n    jvm()\n    js(\'nodeJs\') { /* additional configuration */ }\n\n    // get the existing target:\n    def theJsTarget = js(\'nodeJs\')\n} \n</pre>\n<p>Note that if you need it, the previous functionality still exists, using <code>targetFromPreset(...)</code>.</p>\n<p>You can also independently configure Kotlin/Native binaries like executable files or native libraries. For instance, you can use this to export symbols of certain dependencies to an Objective-C framework.</p>\n<pre>kotlin {    \n    macosX64 {\n        binaries {\n            // Produce the framework and export the dependency.\n            framework {\n                export(project(\":dependency\"))\n            }\n        }\n    }\n}\n</pre>\n<p>For more information, please refer to the <a href=\"https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html\" rel=\"noopener noreferrer\">documentation</a>.</p>\n<p>Finally, we’ve also made <code>kotlinOptions</code> available, allowing for easier compiler configuration</p>\n<pre>compilations.all {\n    kotlinOptions {\n        freeCompilerArgs = [\"-progressive\", \"-Xskip-metadata-version-check\"]\n    }\n} \n</pre>\n<p>All improvements are available both in Groovy and Kotlin DSL.</p>\n<h3>Android Library (AAR) can be a part of a multiplatform library</h3>\n<p>You can now publish Android libraries (AAR) as a part of a multiplatform library. This functionality is disabled by default; to enable it, specify the list of the variants that you want to publish in the scope of the Android target:</p>\n<pre>kotlin {\n    android {\n      publishLibraryVariants(\"release\", \"debug\")\n    }\n}\n</pre>\n<p>You can read more about publishing libraries in <a href=\"https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#publishing-a-multiplatform-library\" rel=\"noopener noreferrer\">the documentation</a>.</p>\n<h2>Improvements for inline classes</h2>\n<p>Support for inline classes has been significantly improved, and some constraints have been mitigated. For instance, you can now define an inner class inside an inline class. There are also improvements for non-trivial cases, like using inline functions inside inline classes or passing references to inline classes as arguments to inline functions.</p>\n<p>You can now also use reflection with inline classes and have access to class literals and <code>javaClass</code> property</p>\n<pre>inline class Duration(val seconds: Int)\n\nfun test(duration: Duration) {\n    // the following expressions are translated into class objects for \"Duration\" class\n    Duration::class\n    duration::class\n    duration.javaClass\n    \n    assertEquals(duration::class.toString(), \"class Duration\")\n    assertEquals(Duration::class.simpleName, \"Duration\")  \n}\n</pre>\n<p>There’s also support for <code>call</code> and <code>callBy</code> for functions that have inline class types in their signature. For more information, refer to the corresponding section on the <a href=\"https://github.com/Kotlin/KEEP/blob/master/proposals/inline-classes.md#reflection\" rel=\"noopener noreferrer\">KEEP</a>.</p>\n<h2>Kotlin/Native</h2>\n<h3>Code contracts</h3>\n<p>Some time ago we introduced experimental support for <a href=\"https://kotlinlang.org/docs/reference/whatsnew13.html#contracts\" rel=\"noopener noreferrer\">contracts</a>, which allows a function to describe its behaviour in a way that the compiler understands. This functionality is now also available in Kotlin/Native.</p>\n<h3>Better interop</h3>\n<p>Improved interop including support for more C constructions such as <strong>enums with forward declarations</strong>, as well as better error reporting for cases of inheritance in Objective-C.</p>\n<h3>Native frameworks from libraries</h3>\n<p>With this release, we can now produce Apple frameworks not only from source files but also from Kotlin libraries (i.e. <code>.klib</code> files). This is possible using the <code>-Xexport-library</code> command line option or via <a href=\"https://github.com/ilmat192/kotlin-native-gradle-samples\" rel=\"noopener noreferrer\">Gradle plugins</a></p>\n<h3>Performance</h3>\n<p>Apart from reducing the memory footprint and improving runtime performance, this release also brings compiler optimizations for looping over ranges, making iterations much faster.</p>\n<h2>IntelliJ IDEA support</h2>\n<p>This release adds new refactorings, inspections, and intentions to the IntelliJ IDEA plugin. We’ll highlight some of them.</p>\n<h3>Template to generate <code>main</code> without parameters</h3>\n<p>Since Kotlin 1.3, you can use the <code>main</code> function without parameters. Now, the default ‘main’ live template adds this new version of <code>main</code>.</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/01/main-template-1.png\" alt=\"\" width=\"700\"></p>\n<p>If you need to pass some arguments, use ‘maina’ live template.</p>\n<h3>Inspections to improve coroutines code</h3>\n<p>When working with coroutines, you usually follow certain conventions. For instance, you would add an “Async” suffix to a function returning ‘Deferred’, or define a function either as a <code>suspend</code> one or as an extension to <code>CoroutineScope</code>, but never both at the same time (for more details, check this <a href=\"https://www.youtube.com/watch?v=a3agLJQ6vt8\" rel=\"noopener noreferrer\">talk</a> from KotlinConf). IntelliJ IDEA is now aware of these conventions and offers intentions to fix potential issues:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/01/add-async-intention-3.png\" alt=\"\" width=\"700\"></p>\n<h3>New intention for converting SAM as lambda to an anonymous object</h3>\n<p>A new intention allows to convert constructs using lambdas with SAM to anonymous objects. For instance</p>\n<pre>val runnable = Runnable {\n    action()\n}\n</pre>\n<p>can now be converted automatically by the IDE to</p>\n<pre>val runnable = object : Runnable {\n    override fun run() {\n        action()\n    }\n}\n</pre>\n<h3>String conversion improvements</h3>\n<p>‘Convert concatenation to template’ intention is now smarter, meaning</p>\n<pre>class Card(val suit: Any, val value: Any) {\n    override fun toString(): String = value.toString() + suit.toString()\n} \n</pre>\n<p>will be converted to</p>\n<pre>class Card(val suit: Any, val value: Any) {\n    override fun toString(): String = \"$value$suit\"\n}\n</pre>\n<p>removing the unnecessary <code>.toString()</code> calls on each parameter.</p>\n<h2>Kapt improvements</h2>\n<p>Using Kapt from the command line has been simplified, allowing for direct use as a separate command line tool as opposed to having to use it via the compiler:</p>\n<pre>// prior\nkotlinc -Xplugin=$KOTLIN_HOME/lib/kotlin-annotation-processing.jar ...\n\n// currently\nkapt ...\n</pre>\n<p>All kapt-related arguments are now passed as top-level arguments instead of using the verbose syntax:</p>\n<pre>// prior\n-P plugin:org.jetbrains.kotlin.kapt3:apclasspath=&lt;classpath&gt;\n\n// currently\n-Kapt-classpath=&lt;classpath&gt;\n</pre>\n<p>Note that a new option that shows processor timings (-Kapt-show-processor-timings`) has also been introduced in this release.</p>\n<h3>Compile avoidance for kapt</h3>\n<p>We’ve added support for <a href=\"https://docs.gradle.org/3.4/userguide/java_plugin.html#sec:java_compile_avoidance\" rel=\"noopener noreferrer\">Compile Avoidance</a> for <code>kaptKotlin</code> tasks in Gradle, improving build performance times. It skips annotation processing completely when there are no changes in kapt stubs and only method bodies are changed in dependencies. Setting</p>\n<pre>kapt.include.compile.classpath=false\n</pre>\n<p>in <code>gradle.properties</code> enables it. Note, however, that this setting also turns off the AP discovery in compile classpath, but if you add AP to <code>kapt*</code> configuration, that shouldn’t affect you.</p>\n<h2>Other notable mentions</h2>\n<p>In addition to the above, a few more fixes and improvements worth mentioning:</p>\n<ul>\n<li>Incremental compilation for Kotlin/JS is now stable enough and is enabled by default. If you encounter any issues, we’d appreciate if you <a href=\"https://youtrack.jetbrains.com/issues/KT\" rel=\"noopener noreferrer\">report it to us</a>, and in the meantime, you can disable the option:\n<ul>\n<li>In a Gradle project, add <code>kotlin.incremental.js=false</code> to <code>gradle.properties</code> or <code>local.properties</code></li>\n<li>In an IntelliJ IDEA project, go to <strong>Settings | Build, Execution, Deployment | Compiler | Kotlin Compiler | Kotlin to JavaScript</strong> and uncheck <strong>Enable incremental compilation</strong>.</li>\n</ul>\n</li>\n<li>We now provide a Kotlin BOM (Bill of Materials) file that lists the dependencies used from the <code>org.jetbrains.kotlin</code> group. </li>\n<li>Stable sorting is now available on all targets. Previously this was an issue when <a href=\"https://youtrack.jetbrains.com/issue/KT-12473\" rel=\"noopener noreferrer\">targeting JavaScript</a>.  </li>\n<li>Numerous fixes and improvements in scripting support.</li>\n<li><a href=\"https://youtrack.jetbrains.com/issue/KT-14416\" rel=\"noopener noreferrer\">Support for MethodHandle</a> and <a href=\"https://youtrack.jetbrains.com/issue/KT-26165\" rel=\"noopener noreferrer\">VarHandle</a> in JVM code generation.</li>\n<li>Modularized artifacts for Kotlin JVM libraries are <a href=\"https://youtrack.jetbrains.com/issue/KT-27919\" rel=\"noopener noreferrer\">included</a>.</li>\n<li>Kotlin/Native will embed <em>bitcode</em> by default for iOS frameworks targets in Gradle projects.</li>\n<li>Kotlin/Native annotations <code>@ThreadLocal</code> and <code>@SharedImmutable</code> are now accessible from common code (declared as <code>optional expect</code>).</li>\n</ul>\n<h2>How to update</h2>\n<p>To update your IntelliJ IDEA or Android Studio plugin, use <em>Tools</em> | <em>Kotlin</em> | <em>Configure Kotlin Plugin Updates</em> and click the “Check for updates now” button. The Eclipse IDE plugin can be installed or updated via the <a href=\"http://marketplace.eclipse.org/content/kotlin-plugin-eclipse\" rel=\"noopener noreferrer\">Eclipse Marketplace</a> (<em>Help</em> | <em>Eclipse Marketplace</em> and search for the Kotlin plugin).</p>\n<p>Also, don’t forget to update the compiler and standard library versions in your Maven and Gradle build scripts. As usual, if you run into any problems with the new release, you’re welcome to ask for help on the <a href=\"https://discuss.kotlinlang.org/\" rel=\"noopener noreferrer\">forums</a>, on Slack (get an invite <a href=\"http://slack.kotlinlang.org/\" rel=\"noopener noreferrer\">here</a>), or to report issues in the <a href=\"https://youtrack.jetbrains.com/issues/KT\" rel=\"noopener noreferrer\">issue tracker</a>.</p>\n<p>Let’s Kotlin!</p>\n<h2>External Contributions</h2>\n<p>Thank you once again to all community contributions for this release. In particular:</p>\n<ul>\n<li><a href=\"http://github.com/tommykw\" rel=\"noopener noreferrer\">Kenji Tomita</a></li>\n<li><a href=\"http://github.com/xaviarias\" rel=\"noopener noreferrer\">Xavi Arias Seguí</a></li>\n<li><a href=\"http://github.com/gavra0\" rel=\"noopener noreferrer\">Ivan Gavrilovic</a></li>\n<li><a href=\"http://github.com/cuihtlauac\" rel=\"noopener noreferrer\">Cuihtlauac Alvarado</a></li>\n<li><a href=\"http://github.com/inktomi\" rel=\"noopener noreferrer\">Matthew Runo</a></li>\n<li><a href=\"http://github.com/ma2gedev\" rel=\"noopener noreferrer\">Takayuki Matsubara</a></li>\n<li><a href=\"http://github.com/ting-yuan\" rel=\"noopener noreferrer\">Ting-Yuan Huang</a></li>\n<li><a href=\"http://github.com/khud\" rel=\"noopener noreferrer\">Vitaly Khudobakhshov</a></li>\n<li><a href=\"http://github.com/alllex\" rel=\"noopener noreferrer\">Aleksei Semin</a></li>\n<li><a href=\"http://github.com/SUPERCILEX\" rel=\"noopener noreferrer\">Alex Saveau</a></li>\n<li><a href=\"http://github.com/bernhardposselt\" rel=\"noopener noreferrer\">Bernhard Posselt</a></li>\n<li><a href=\"http://github.com/calexHG\" rel=\"noopener noreferrer\">Corey</a></li>\n<li><a href=\"http://github.com/djleeds\" rel=\"noopener noreferrer\">Dave Leeds</a></li>\n<li>Bradley Smith</li>\n<li>Fabian Mastenbroek</li>\n<li>Fedor Korotkov</li>\n<li>Ingo Kegel</li>\n<li>Itsuki Aoyagi</li>\n<li>James Wald</li>\n<li>John Eismeier</li>\n<li>Juan Chen</li>\n<li>Karen Schwane</li>\n<li>Keita Watanabe</li>\n<li>Lukas Welte</li>\n<li>Mikhail Levchenko</li>\n<li>Monchi</li>\n<li>Piotr Krzeminski</li>\n<li>Raluca Sauciuc </li>\n<li>Ricardo Meneghin Filho</li>\n<li>Timo Obereder</li>\n<li>Yuki Miida</li>\n<li>shiraji</li>\n<li>takattata</li>\n<li>technoir</li>\n<li>ymnder</li>\n</ul>\n<h4>Updates</h4>\n<p>We previously stated that it is necessary to enable parallel builds in Gradle using</p>\n<pre>org.gradle.parallel=true\n</pre>\n<p>This is in fact not required, as this would enable cross-project parallelism. Thank you to Cédric Champeau and Eric Wendelin for pointing this out.</p>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/01/main-template-1.png",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2019/01/kotlin-1-3-20-released/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=7044",
        link: "https://blog.jetbrains.com/kotlin/2019/04/kotlinnative-support-for-appcode-2019-1/",
        title: "Kotlin/Native Support for AppCode 2019.1",
        date: 2019-04-04T12:13:55Z,
        summary: Some(
            "We are happy to announce the new and improved Kotlin/Native plugin for AppCode 2019.1! Enjoy working on Kotlin, Swift, and Objective-C projects for macOS and iOS inside the same IDE. New to AppCode? AppCode is macOS-only IDE from JetBrains designed … Continue reading →",
        ),
        content: Some(
            "<p>We are happy to announce the new and improved <a href=\"https://plugins.jetbrains.com/plugin/10619-kotlin-native-for-appcode\" rel=\"noopener noreferrer\">Kotlin/Native plugin</a> for AppCode 2019.1! Enjoy working on Kotlin, Swift, and Objective-C projects for macOS and iOS inside the same IDE. New to AppCode? <a href=\"https://www.jetbrains.com/objc/\" rel=\"noopener noreferrer\">AppCode</a> is macOS-only IDE from JetBrains designed specifically for iOS/macOS developers. It offers extensive support for Objective-C and Swift.</p>\n<p>To try the plugin out open <a href=\"https://www.jetbrains.com/objc/\" rel=\"noopener noreferrer\">AppCode 2019.1</a> (EAP or Release), navigate to <em>Preferences | Plugins</em> and type Kotlin/Native in the Marketplace tab search to find and install the <em>Kotlin/Native for AppCode</em> <a href=\"https://plugins.jetbrains.com/plugin/10619-kotlin-native-for-appcode\" rel=\"noopener noreferrer\">plugin</a></p>\n<h2>New Kotlin/Native Projects for iOS</h2>\n<p>The Kotlin/Native plugin for AppCode adds support for Kotlin/Native projects written in Gradle. For reusing code between iOS and Kotlin, we set up Kotlin/Native <a href=\"https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html\" rel=\"noopener noreferrer\">build</a> to produce a framework which is used in Xcode. AppCode helps to configure an Xcode build for this scenario. We’ve added items to the New Project wizard to help us get started with a pre-configured project from scratch.</p>\n<p><span></span></p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/04/appcode2019.1-new-project-wizaed.png\" alt=\"appcode2019.1-new-project-wizaed\" width=\"70%\"></p>\n<p>The highlighted project template configures everything. It creates and binds Kotlin/Native Gradle project to an iOS Xcode project, so that the Xcode build will call the Kotlin/Native build automatically, with respect to the selected target. The project will then be ready to work in both Xcode (without Kotlin support) and AppCode.</p>\n<p>If you already have an existing project, you can add the Kotlin/Native Framework <em>target</em> by opening the Project Settings dialog (⌘;), clicking on the (+) button in the list of targets, and then selecting the <em>Kotlin/Native | Framework</em> option.</p>\n<p>Note that you will need to click on the <em>Import Gradle project</em> or <em>Import Changes</em> link in AppCode after the project is opened.</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/04/appcode2019.1-unlinked-gradle.png\" alt=\"appcode2019.1-unlinked-gradle\" width=\"45%\"></p>\n<p>The Open Gradle Project dialog will be shown. While the output of the compiler does not have any dependencies or virtual machine requirements, the compiler itself and the Gradle build system require the Java 1.8 or 11 runtime. Use the path to it to fill the <em>Gradle JVM</em> field. Check out the <a href=\"https://jdk.java.net/11\" rel=\"noopener noreferrer\">https://jdk.java.net/11</a> or <a href=\"https://adoptopenjdk.net/\" rel=\"noopener noreferrer\">https://adoptopenjdk.net/</a> for the best JRE, OpenJDK, or JDK distribution. By default on macOS, JVMs are installed to the <code>/Library/Java/JavaVirtualMachines</code> folder.</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/04/appcode2019.1-gradle-import.png\" alt=\"appcode2019.1-gradle-import\" width=\"55%\"></p>\n<h2>Kotlin/Native Gradle Projects Support</h2>\n<p>Writing Kotlin/Native code for iOS and macOS is now supported in AppCode too for <a href=\"https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html\" rel=\"noopener noreferrer\">Kotlin Multiplatform</a> projects. Open your Gradle project from <code>build.gradle</code> or <code>build.gradle.kts</code> files or use the project wizard to create a new one.</p>\n<h2>Kotlin Language Support</h2>\n<p>Just to remind you, the Kotlin/Native plugin for AppCode includes Kotlin language support, similar to what you have in <a href=\"https://plugins.jetbrains.com/plugin/10454-kotlin-native-for-clion\" rel=\"noopener noreferrer\">CLion</a> and IntelliJ IDEA. For example, there is code completion and quick doc dialogs for macOS or iOS classes which are also accessible directly from Kotlin/Native</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/04/appcode2019.1-completion.png\" alt=\"appcode2019.1-completion\" width=\"80%\"><br>\n<img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/04/appcode2019.1-quickdoc.png\" alt=\"appcode2019.1-quickdoc\" width=\"80%\"></p>\n<p>Debugger support for Kotlin/Native, Swift, and Objective-C code is improved and included for applications running in an emulator, a device, or a macOS host</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/04/appcode2019.1-debugger.png\" alt=\"appcode2019.1-debugger\" width=\"100%\"></p>\n<h2>Conclusion</h2>\n<p>This is all the functionality that we have to share with you at this time. Give it a try, let us know what you think, and stay tuned for more exciting features to come as we continue our work on Kotlin/Native and multiplatform projects!</p>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/04/appcode2019.1-new-project-wizaed.png",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2019/04/kotlinnative-support-for-appcode-2019-1/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=6991",
        link: "https://blog.jetbrains.com/kotlin/2019/04/kotlin-1-3-30-released/",
        title: "Kotlin 1.3.30 released",
        date: 2019-04-12T04:01:07Z,
        summary: Some(
            "We’re happy to announce the release of Kotlin 1.3.30, a new bug fix and tooling update for Kotlin 1.3. The main areas of focus for this release have been around Kotlin/Native, KAPT performance, as well as improvements for IntelliJ IDEA. … Continue reading →",
        ),
        content: Some(
            "<p>We’re happy to announce the release of Kotlin 1.3.30, a new bug fix and tooling update for Kotlin 1.3. The main areas of focus for this release have been around Kotlin/Native, KAPT performance, as well as improvements for IntelliJ IDEA.</p>\n<p>You can find the complete list of changes in the <a href=\"https://github.com/JetBrains/kotlin/blob/1.3.30/ChangeLog.md\" rel=\"noopener noreferrer\">change log</a>. As always, we’d like to thank our <a href=\"https://blog.jetbrains.com/kotlin/2019/04/kotlin-1-3-30-released/#external-contributions\" rel=\"noopener noreferrer\">external contributors</a>. Now let’s dive into the details!</p>\n<p><span></span></p>\n<h2>Incremental annotation processing in KAPT</h2>\n<p>KAPT now supports incremental annotation processors in an experimental mode. To try it, add the following setting to <code>gradle.properties</code> file:</p>\n<pre>kapt.incremental.apt=true\n</pre>\n<p>Note that in the current implementation, using any non-incremental annotation processor or a change in dependency’s ABI (so far, including modifying internal declarations) will lead to non-incremental annotation processing for a given module.</p>\n<p>It’s still work in progress and it’s going to be improved in future releases, but we encourage you to try it now and share your feedback!</p>\n<h3>KAPT: other performance improvements</h3>\n<p>Back in 1.2.60, we introduced two options to improve build performance. The first one was <a href=\"https://kotlinlang.org/docs/reference/kapt.html#running-kapt-tasks-in-parallel-since-1260\" rel=\"noopener noreferrer\">using Gradle workers</a>:</p>\n<pre>kapt.use.worker.api=true\n</pre>\n<p>and it has been improved with this release.</p>\n<p>The second option introduced, this time in 1.3.20, enabled <a href=\"https://kotlinlang.org/docs/reference/kapt.html#compile-avoidance-for-kapt-since-1320\" rel=\"noopener noreferrer\">Compile Avoidance</a>, which skips annotation processing if only method bodies are changed in dependencies. Compile Avoidance is possible only when all KAPT dependencies are declared explicitly in annotation processing classpath. To turn off AP discovery in compile path, and therefore turn on Compile Avoidance, add the following option:</p>\n<pre>kapt.include.compile.classpath=false\n</pre>\n<p>We’re considering enabling these options by default in the near future, so we’d love you to try these in your projects and share with us your feedback!</p>\n<p>Note that the minimal supported version of Gradle is now 4.1. For Android Gradle Plugin, it’s 3.0.</p>\n<h2>Standard library: operations for unsigned number arrays</h2>\n<p>Starting from Kotlin 1.3 you could use unsigned number types in an experimental mode. This release brings support for more operations for unsigned types and arrays of unsigned types that mirror those for regular number types:</p>\n<pre>fun main() {\n    val u1 = 2_147_483_649u\n    val u2 = 4_000_000_000u\n    println(u1.toDouble())\n    println(minOf(u1, u2))\n\n    val array: UIntArray = uintArrayOf(u1, u2)\n    println(array.max())\n    println(array.all { it &gt; Int.MAX_VALUE.toUInt() })\n}\n</pre>\n<p>Note that you already could use many functional operations like <code>filter</code> and <code>map</code> for unsigned arrays, because arrays of unsigned numbers implement <code>Collection</code>, e.g., <code>UIntArray</code> implements <code>Collection&lt;UInt&gt;</code>. But then it was tied with the performance overhead since the extra object was <a href=\"https://kotlinlang.org/docs/reference/inline-classes.html#representation\" rel=\"noopener noreferrer\">created</a> when <code>UIntArray</code> is passed as an object of <code>Collection&lt;UInt&gt;</code>. Now all the added extension functions take exact unsigned array types as receivers, which eliminates this overhead. You can work with an array of unsigned number types like you work with arrays of regular number types without worrying about the underlying performance.</p>\n<h2>Kotlin/Native</h2>\n<p>We are happy to announce that the list of supported Kotlin/Native targets has expanded. This release brings support for Windows 32 bit target (mingw_x86). In addition to that, Windows and macOS users can cross-compile their Kotlin/Native programs to Linux x86-64, arm32, as well as Android and Raspberry PI devices.</p>\n<p>From the compiler side we added fixes to an undefined behaviour when computing a remainder of a division by 0, which now throws an exception. Alignment related issues were also fixed for ARM32 and MIPS platforms.</p>\n<h3>Kotlin/Native for Apple platforms</h3>\n<p>For the Apple platform, we prepared several improvements too. Unhandled exceptions on iOS devices will now be logged to the iOS crash log. Exception backtraces (in debug mode) now contain symbolic information on iOS and macOS.</p>\n<p>Static frameworks can be generated too, use the <code>-Xstatic-framework</code> command line parameter or the following Gradle script for a multiplatform project:</p>\n<pre>kotlin {\n    macosX64 {\n        binaries {\n            framework {\n                isStatic = true\n            }\n        }\n    }\n}\n</pre>\n<h4>Cocoapods</h4>\n<p>Experimental integration with <a href=\"https://cocoapods.org/\" rel=\"noopener noreferrer\">CocoaPods</a> is added as a dedicated Gradle plugin. It turns a Kotlin/Native project into a <code>.podfile</code> dependency which can be included into a <code>Podfile</code>. This allows you to have the same experience when importing and building with Xcode, as you would with Swift or Objective-C pods. We’ve also made it easier to use and import CocoaPods dependencies into Kotlin/Native projects. The plugin does all necessary configuration steps to import a framework into a Kotlin/Native project. Note, that an Xcode project is now required to fetch and build these dependencies.</p>\n<pre>// Apply plugins.\nplugins {\n    id(\"org.jetbrains.kotlin.multiplatform\") version \"1.3.30\"\n    /// the new plugin for CocoaPods support\n    id(\"org.jetbrains.kotlin.native.cocoapods\") version \"1.3.30\"\n}\n\n// CocoaPods requires the podspec to have a version.\nversion = \"1.0\"\n\nkotlin {\n    cocoapods {\n        summary = \"a Kotlin/Native module\"\n        homepage = \"homepage\"\n\n        pod(\"AFNetworking\", \"~&gt; 3.2.0\")\n    }\n}\n</pre>\n<p>By running <code>./gradlew podspec</code> it generates a <code>.podspec</code> file which can be included into the <code>Podfile</code> file. For importing a pod, you can use the <code>pod()</code> function.</p>\n<h3>C interop</h3>\n<p>We now support returning structures from callback functions, meaning that <code>staticCFunction</code> now supports <code>CValue&lt;T&gt;</code> return types! For example, you can call a C function, passing a C function pointer to a Kotlin-implemented function that returns struct:</p>\n<pre>*typedef struct * { /*... */} result_value;\n*void *functionWithCallback(result_value (*fun_pointer)() );\n</pre>\n<p>In addition to that, the following changes were made:</p>\n<ul>\n<li>C-99 <code>bool</code> type is now correctly mapped</li>\n<li>UTF-32 C-strings are mapped into Kotlin <code>String</code> class</li>\n<li>C compiler intrinsics are included into the <code>platform.builtins</code> package</li>\n<li><a href=\"http://sourceware.org/libffi/\" rel=\"noopener noreferrer\">libffi</a> library is no longer used</li>\n<li>Clang modules are supported for Objective-C interop</li>\n<li>C interop definition files (<code>.def</code>) are supported in the IDE</li>\n</ul>\n<h3>Kotlin/Native IDE support</h3>\n<p>We are happy to announce the results of our ongoing work to support Kotlin/Native in our IDEs.</p>\n<p>In addition to IntelliJ IDEA, we will offer a Kotlin/Native plugin for CLion 2019.1, as well as AppCode 2019.1. C interop definition files (<code>.def</code>) will also be supported by all IDEs, albeit we do not currently provide code completion.</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/03/c-interop-def.png\" alt=\"c-interop-def\" width=\"500\"></p>\n<p>For CLion and AppCode, we’ve also added navigation from backtraces to source code as well as improvements in the debugger support.</p>\n<h2>IntelliJ IDEA support</h2>\n<h3>Debugging Improvements</h3>\n<p>We’re working hard on making debugging coroutines easier. When you debug coroutine code, you now see a separate “Async stack trace” showing the variables stored at the time of suspension. Let’s look at a small example:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/03/debug-coroutines-code.png\" alt=\"\" width=\"500\"></p>\n<p>When stopping on a breakpoint inside a suspend function or lambda (in this example, at line 13), “Async stack trace” additionally shows you the state of the variables at the last point of suspension (line 12). You can browse the whole stacktrace of suspend functions starting from the last suspension point in the current coroutine (lines 12 and 4) and check the stored values of the variables:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/03/debug-coroutines.png\" alt=\"\" width=\"500\"></p>\n<p>It should help you understand how you got to the current point of execution.</p>\n<p>While debugging Kotlin code, you can now choose “Kotlin” mode to observe the values of the variables. After clicking on the Kotlin icon, you see the variables by Kotlin names, not by auxiliary JVM names, as before:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/04/variables-mode-frame.png\" alt=\"\" width=\"700\"></p>\n<pre>fun main() {\n    1.foo()\n}\n\nfun Int.foo() {\n    with(\"ab\") {\n        println(this + this@foo)  // breakpoint\n    }\n}\n</pre>\n<p>Note that you can always add missing variables by using watches, and either merge “variables” and “watches” windows as in the screenshot above or keep them separate, as you prefer.</p>\n<h3>Interactive mode for scratch files</h3>\n<p>As you know, in Kotlin you can perform small experiments with your codebase using <a href=\"https://kotlinlang.org/docs/tutorials/quick-run.html#using-scratches\" rel=\"noopener noreferrer\">scratch files</a>. Now you can use interactive mode which shows you the results on the fly (after a given timeout), without the need to explicitly rerun the script:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/04/scratches.png\" alt=\"\" width=\"700\"></p>\n<h3>Other niceties</h3>\n<p>Do you check from time to time TODO items list in your project? IntelliJ IDEA now correctly highlights multiline TODO comments and displays them in the list:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/03/multiline-comments.png\" alt=\"\" width=\"500\"></p>\n<p>Some useful inspections and quickfixes were added in this release, such as a fix to automatically introduce an import alias for the imported class name, or a warning of using ‘forEach’ method from Java 8 interface rather than from the Kotlin standard library.</p>\n<h2>Eclipse IDE plugin update</h2>\n<p>New 0.8.14 release of the plugin for the Eclipse IDE brings: support for the Kotlin 1.3.30 compiler, numerous bugfixes and improvements in overall stability. This update also introduces experimental support for Gradle projects. You can now import your projects with <a href=\"https://projects.eclipse.org/projects/tools.buildship\" rel=\"noopener noreferrer\">Eclipse Buildship</a> and then you can find them in your Eclipse workspace with correct Kotlin plugin configuration.</p>\n<p>You can install experimental Gradle integration via the update site: <code>https://dl.bintray.com/jetbrains/kotlin/eclipse-plugin/last/</code>. To do so open <code>Install new software</code> dialog from Eclipse’s help menu. Then enter update site url and select <code>Kotlin-gradle</code>:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/04/eclipse-plugin-gradle.png\" width=\"700\"></p>\n<p>New Gradle integration works in Spring Tool Suite as well. You are no longer forced to use Maven when you want to develop a Spring application in Kotlin.</p>\n<h2>Specifying JVM bytecode targets 9 – 12</h2>\n<p>If you run the code under JVM versions 9, 10, 11, or 12, you can now set the corresponding <code>jvmTarget</code>. This setting will affect the version of the generated classfiles, and the resulting bytecode won’t run on any lower version of JVM. Note that so far newer versions don’t add any bytecode optimizations or features beyond the ones that exist in lower versions, but that is going to change in the future.</p>\n<h2>How to update</h2>\n<p>As always, you can <strong>try Kotlin online</strong> at <a href=\"http://play.kotl.in/\" rel=\"noopener noreferrer\">play.kotl.in</a>.</p>\n<ul>\n<li><strong>In Maven, Gradle and npm</strong>: Use <code>1.3.30</code> as the version number for the compiler and the standard library. See the docs <a href=\"http://kotlinlang.org/docs/reference/using-gradle.html\" rel=\"noopener noreferrer\">here</a>.</li>\n<li><strong>In IntelliJ IDEA</strong> and <strong>Android Studio</strong>: Update the Kotlin plugin to version 1.3.30. Use <em>Tools | Kotlin | Configure Kotlin Plugin Updates</em> and click the “Check for updates now” button.</li>\n<li><strong>In Eclipse</strong>: Install the plugin using <a href=\"https://marketplace.eclipse.org/content/kotlin-plugin-eclipse\" rel=\"noopener noreferrer\">Marketplace</a>.</li>\n<li><strong>The command-line compiler</strong> can be downloaded from the <a href=\"https://github.com/JetBrains/kotlin/releases/tag/v1.3.30\" rel=\"noopener noreferrer\">Github release page</a>.</li>\n</ul>\n<p>As usual, if you run into any problems with the new release, you’re welcome to ask for help on the <a href=\"https://discuss.kotlinlang.org/\" rel=\"noopener noreferrer\">forums</a>, on Slack (get an invite <a href=\"http://slack.kotlinlang.org/\" rel=\"noopener noreferrer\">here</a>), or to report issues in the <a href=\"https://youtrack.jetbrains.com/issues/KT\" rel=\"noopener noreferrer\">issue tracker</a>.</p>\n<p>Let’s Kotlin!</p>\n<h2>External Contributions</h2>\n<p>We’re especially grateful to our colleagues from Google for <a href=\"https://github.com/JetBrains/kotlin/pull/2179\" rel=\"noopener noreferrer\">the work on supporting incremental compilation in KAPT</a>!</p>\n<p>We also thank our community contributors for this release; we appreciate your work. In particular:</p>\n<ul>\n<li><a href=\"http://github.com/t-kameyama\" rel=\"noopener noreferrer\">Toshiaki Kameyama</a></li>\n<li><a href=\"http://github.com/madsager\" rel=\"noopener noreferrer\">Mads Ager</a></li>\n<li><a href=\"http://github.com/gavra0\" rel=\"noopener noreferrer\">Ivan Gavrilovic</a></li>\n<li><a href=\"http://github.com/ting-yuan\" rel=\"noopener noreferrer\">Ting-Yuan Huang</a></li>\n<li><a href=\"http://github.com/devbridie\" rel=\"noopener noreferrer\">Dereck Bridie</a></li>\n<li><a href=\"http://github.com/26274291+denisgaebler\" rel=\"noopener noreferrer\">denisgaebler</a></li>\n<li><a href=\"http://github.com/tommykw\" rel=\"noopener noreferrer\">kenji tomita</a></li>\n<li><a href=\"http://github.com/BernhardPosselt\" rel=\"noopener noreferrer\">Bernhard Posselt</a></li>\n<li><a href=\"http://github.com/wcarmon\" rel=\"noopener noreferrer\">Wil</a></li>\n<li>Burak Eregar </li>\n<li>Marcin Moskala</li>\n<li>Felix Guo</li>\n<li>shiraji</li>\n<li>Tor Norbye</li>\n<li>Yaroslav Ulanovych</li>\n<li>goodsauce</li>\n<li>hisaaki.sioiri</li>\n<li>Pavel Nikitin</li>\n<li>Mark Punzalan</li>\n<li>Kevin Peek</li>\n<li>Jim S</li>\n<li>Timo Obereder</li>\n</ul>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/03/c-interop-def.png",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2019/04/kotlin-1-3-30-released/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=7145",
        link: "https://blog.jetbrains.com/kotlin/2019/05/kotlin-census-2018-infographics-and-report/",
        title: "Kotlin Census 2018 Infographics and Report",
        date: 2019-05-06T13:56:14Z,
        summary: Some(
            "Kotlin 1.0 was released 3 years ago. It has been an amazing journey and a huge achievement to get to where we are today: Kotlin/Native has opened up incredible possibilities for Kotlin usage on all platforms, Kotlin was announced as … Continue reading →",
        ),
        content: Some(
            "<p>Kotlin 1.0 was released 3 years ago. It has been an amazing journey and a huge achievement to get to where we are today: Kotlin/Native has opened up incredible possibilities for Kotlin usage on all platforms, Kotlin was announced as a first-class language on Android, and our KotlinConf has become a successful annual event. The potential for the language is immense: every year Kotlin users double in number. Programmers all over the world are using Kotlin to create their server- and client-side web applications, Android and iOS mobile applications, and even data science.</p>\n<p>This is the first year when we present the Kotlin Census infographics report to provide you with more insights and trends around Kotlin. <a href=\"https://www.jetbrains.com/research/kotlin-census-2018/\" rel=\"noopener noreferrer\">Check it out!</a></p>\n<p><a href=\"https://www.jetbrains.com/research/kotlin-census-2018/\" rel=\"noopener noreferrer\"><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/05/Kotlin_Census_2018_blogpost_1@2.png\" alt=\"Kotlin_Census_2018_blogpost_1@2\" width=\"3200\" height=\"1600\"></a><br>\n<span></span></p>\n<h2>Methodology and general overview</h2>\n<p>We received 4,396 responses through our official Kotlin channels between December 2018 and March 2019 (these responses were not limited to only those who use Kotlin). The most meaningful insights have been made into an infographic and text report.</p>\n<p>We were excited to learn that Kotlin is the primary language for 39% of respondents, 46% use it for server-side production code, and 10% use Kotlin for data science. Usage of coroutines has doubled in comparison to the year before. The total usage of libraries has also doubled, and the popularity of the libraries continues to grow.</p>\n<h2>Community contribution and growth</h2>\n<p>Today more than 2 million people use Kotlin on every kind of platform, for the development of all possible types of software. More than 250 contributors help drive development and the ecosystem forward. We are very happy with the dedication and hard work of our community who have contributed so much to the Kotlin learning materials and spreading Kotlin knowledge.</p>\n<p>It was exciting to see community-driven learning resources such as Stack Overflow and blog posts overtaking official documentation in popularity among Kotlin adopters in 2018. We support this all the way and we want to thank all the authors and speakers out there for sharing their Kotlin knowledge!</p>\n<h4>You can find more insights like these in the <a href=\"https://www.jetbrains.com/research/kotlin-census-2018/\" rel=\"noopener noreferrer\">Kotlin Census 2018 report</a>. We also have the raw data available there, should you want to dig deeper and find more insights.</h4>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/05/Kotlin_Census_2018_blogpost_1@2.png",
        ),
        comments_link: None,
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=7157",
        link: "https://blog.jetbrains.com/kotlin/2019/05/kotlin-is-everywhere-join-the-global-event-series/",
        title: "Kotlin Is Everywhere! Join the Global Event Series",
        date: 2019-05-07T21:06:34Z,
        summary: Some(
            "When we say ‘Kotlin is everywhere’, we mean it. Kotlin works on all platforms, and it allows you to develop all types of applications. Developers are excited about Kotlin and hungry for opportunities to learn more. Now it’s time to … Continue reading →",
        ),
        content: Some(
            "<p>When we say ‘Kotlin is everywhere’, we mean it. Kotlin works on all platforms, and it allows you to develop all types of applications. Developers are excited about Kotlin and hungry for opportunities to learn more. Now it’s time to bring it to your city with the support of JetBrains and Google.</p>\n<p><a href=\"http://everywhere.kotlinlang.org/\" rel=\"noopener noreferrer\"><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/05/Blog-Post-Grey.png\" alt=\"Blog Post - Grey\" width=\"1024\" height=\"512\"></a></p>\n<p>We’re happy to announce our new program, <a href=\"http://everywhere.kotlinlang.org/\" rel=\"noopener noreferrer\">Kotlin/Everywhere</a> – a series of community-driven events focusing on the potential of Kotlin on all platforms. Its goal is to help people learn the essentials and best practices of using Kotlin everywhere, be it for Android, iOS, back-end, or front-end.</p>\n<p>Join the <a href=\"http://everywhere.kotlinlang.org/\" rel=\"noopener noreferrer\">Kotlin/Everywhere global event series</a> between June and December 2019.</p>\n<p><span></span></p>\n<h2>Who can attend the event?</h2>\n<p>Whether you are a developer, a speaker, a Kotlin User Group, or any other community leader – do join us! Anyone interested in learning Kotlin and its ecosystem, sharing knowledge, and hosting a Kotlin-focused event is welcome to attend.</p>\n<p>If you are a developer wanting to learn more about Kotlin, or a speaker excited to share your Kotlin experience with others, you can find events near you to join. Just go to the map on the website. More events will be added over time.</p>\n<h2>How to host your Kotlin/Everywhere event?</h2>\n<p>If you want to host an event in your city, you can begin by checking out the detailed <a href=\"https://docs.google.com/presentation/d/e/2PACX-1vRgpxfZ8nj2V3J_dfI9Z9_YW4vdP-neemsRlQHAVt0f8T614HAQIJQaoIKCMvVsafbg87uT-pppl-0Z/pub?start=false&amp;loop=false&amp;delayms=60000&amp;slide=id.g4c0cd0eecf_0_1867\" rel=\"noopener noreferrer\">organizers’ guide</a>. It will help you decide on the format and what kind of support you might need. All the necessary tips and tricks, materials, and branding assets are inside. Go ahead and submit your event on <a href=\"http://everywhere.kotlinlang.org/\" rel=\"noopener noreferrer\">the official web page</a>.</p>\n<p>Besides the detailed organizers’ guide, we also provide you with resources such as content, codelabs, and guidance to help you maximize your success. You can also apply for support: we have speakers from Google/JetBrains and can help by providing funding for venue, food and drinks, swag, or other. We will also list your event on the official website.</p>\n<p>Still have questions? Ask them at our <a href=\"https://docs.google.com/presentation/d/e/2PACX-1vRgpxfZ8nj2V3J_dfI9Z9_YW4vdP-neemsRlQHAVt0f8T614HAQIJQaoIKCMvVsafbg87uT-pppl-0Z/pub?start=false&amp;loop=false&amp;delayms=60000&amp;slide=id.g4c0cd0eecf_0_531\" rel=\"noopener noreferrer\">hangout sessions for organizers</a> on May 16 and 17.</p>\n<p>Let us know if you want to take part! Apply at <a href=\"https://kotl.in/everywhere\" rel=\"noopener noreferrer\">https://kotl.in/everywhere</a></p>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/05/Blog-Post-Grey.png",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2019/05/kotlin-is-everywhere-join-the-global-event-series/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=7189",
        link: "https://blog.jetbrains.com/kotlin/2019/06/kotlin-1-3-40-released/",
        title: "Kotlin 1.3.40 released",
        date: 2019-06-19T15:15:35Z,
        summary: Some(
            "We’re happy to present the new release today, Kotlin 1.3.40. In addition to the quality and tooling improvements the main focus for this version has been on: Gradle support for NPM, Yarn, and Webpack for Kotlin/JS Test runner improvements for … Continue reading →",
        ),
        content: Some(
            "<p>We’re happy to present the new release today, Kotlin 1.3.40. In addition to the quality and tooling improvements the main focus for this version has been on:</p>\n<ul>\n<li>Gradle support for NPM, Yarn, and Webpack for Kotlin/JS</li>\n<li>Test runner improvements for multiplatform projects</li>\n<li>New type inference</li>\n<li>Performance and interoperability improvements for Kotlin/Native</li>\n</ul>\n<p>Also, new functions were added to the standard library in an experimental state.</p>\n<p>You can find the complete list of changes in the <a href=\"https://github.com/JetBrains/kotlin/blob/1.3.40/ChangeLog.md\" rel=\"noopener noreferrer\">change log</a>. As always, we’re really grateful to our <a href=\"https://blog.jetbrains.com/kotlin/2019/06/kotlin-1-3-40-released/#external-contributions\" rel=\"noopener noreferrer\">external contributors</a>.</p>\n<p>Let’s dive into the details!</p>\n<p><span></span></p>\n<h2>Experimental functions in the standard library</h2>\n<p>We’ve added several new functions to the standard library in an experimental state. There are new common functions to encode/decode a byte/char array into a string in a UTF-8 encoding included:</p>\n<ul>\n<li><code>ByteArray.decodeToString</code> and <code>String.encodeToByteArray</code></li>\n<li><code>CharArray.concatToString</code> and <code>String.toCharArray</code></li>\n</ul>\n<p>Another experimental function <code>capitalize</code> has been added on the JVM which takes <code>Locale</code> object as a parameter.</p>\n<p>You need to explicitly opt-in to use them: either annotate the use site with <code>@UseExperimental(ExperimentalStdlibApi::class)</code> or provide the compiler argument <code>-Xuse-experimental=kotlin.ExperimentalStdlibApi</code>.</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/06/experimentalAPI.png\" alt=\"\"></p>\n<p>The <code>ExperimentalStdlibApi</code> annotation was introduced in this release to indicate experimental API in the standard library. The behavior of such API can change based on your feedback, so there is no compatibility guarantee. You can find more about the experimental annotations in the <a href=\"https://kotlinlang.org/docs/reference/experimental.html\" rel=\"noopener noreferrer\">documentation</a>.</p>\n<h3>Accessing the reified type using reflection on JVM</h3>\n<p>Another experimental function added in this release is the <code>typeOf</code> function. At a glance, you can use it to construct an instance of <code>KType</code> for a given type:</p>\n<pre>val intType: KType = typeOf&lt;Int&gt;()\nprintln(String::length.returnType == intType) // true\n</pre>\n<p>The real benefit, however, comes when you use it to retrieve information about the reified generic type argument. When you call <code>typeOf()</code> with <code>T</code> being a reified generic type argument, <code>typeOf</code> returns the actual value of the type argument:</p>\n<pre>@UseExperimental(ExperimentalStdlibApi::class)\ninline fun &lt;reified T&gt; accessReifiedTypeArg() {\n    val kType = typeOf&lt;T&gt;()\n    println(kType.toString())\n}\n\nfun main() {\n    accessReifiedTypeArg&lt;String&gt;() // kotlin.String\n    accessReifiedTypeArg&lt;List&lt;String&gt;&gt;() // kotlin.collections.List&lt;kotlin.String&gt;\n}\n</pre>\n<p>Currently, <code>typeOf</code> is only available in Kotlin/JVM, but in future versions, similar functions will be added to the other platforms: Kotlin/JS and Kotlin/Native.</p>\n<h2>Optimization for trimIndent and trimMargin</h2>\n<p>For better code formatting, multiline strings are usually used together with either <code>trimIndent</code> or <code>trimMargin</code>. Starting with this release, <code>trimIndent</code> and <code>trimMargin</code> calls are optimized by the compiler. Instead of calling the corresponding library functions, the compiler does the work itself and generates the trimmed string literals in the bytecode:</p>\n<pre>fun main() {\n    println(\n        \"\"\"\n             |first\n                |second\n            \"\"\".trimMargin()\n    )\n\n    // in the bytecode it is replaced with:\n    println(\"first\\nsecond\")\n}\n</pre>\n<p>Note that this optimization only works if the receiver function and the margin prefix are constant expressions, without any interpolated variables (like <code>\"$x\"</code>).</p>\n<p>As an <a href=\"https://youtrack.jetbrains.com/issue/KT-30451\" rel=\"noopener noreferrer\">optimization</a> <code>minBy</code> and <code>maxBy</code> functions do not call the specified <code>selector</code> function any longer if the collection they were invoked on contains just one element. Beware if you relied on side effects from <code>selector</code> function.</p>\n<h2>Using External annotations in IntelliJ IDEA</h2>\n<p>If you use <a href=\"https://www.jetbrains.com/help/idea/external-annotations.html\" rel=\"noopener noreferrer\">external nullability annotations for Java</a>, the IDE&nbsp;can now give warnings for incorrect usages of annotated Java methods from Kotlin.</p>\n<p>Imagine that your Java method is annotated with an external annotation. IntelliJ IDEA can show such an annotation, but it’s not present in the code:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/06/annotatedJavaMethod.png\" alt=\"annotatedJavaMethod\" width=\"700\"></p>\n<p>The annotation is declared in a separate <code>annotations.xml</code> file:</p>\n<p></p><pre>&lt;root&gt;\n    &lt;item name=\"JavaClass java.lang.String nullableString()\"&gt;\n        &lt;annotation name=\"org.jetbrains.annotations.Nullable\"/&gt;\n    &lt;/item&gt;\n&lt;/root&gt;</pre><p></p>\n<p>Starting from this release, you’ll get warnings for incorrect usages of this Java method from Kotlin:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/06/nullabilityWarning.png\" alt=\"nullabilityWarning\" width=\"700\"></p>\n<p>Note that this is purely IDE functionality; the corresponding code is compiled without warnings by the Kotlin compiler. The compiler still infers that the type of <code>nullableString</code> is a <a href=\"https://kotlinlang.org/docs/reference/java-interop.html#null-safety-and-platform-types\" rel=\"noopener noreferrer\">platform type</a> <code>String!</code>, but the IDE shows an additional warning.</p>\n<h2>Working on a New Type Inference Algorithm</h2>\n<p>We’ve been working on an improved algorithm for type inference. It fixes different corner-case problems and supports new scenarios: <a href=\"https://youtrack.jetbrains.com/issues?q=%23fixed-in-new-inference%20\" rel=\"noopener noreferrer\">the whole list of fixed issues</a> is quite impressive. In future versions of Kotlin, the new algorithm&nbsp;will replace the one currently in use and will become the default.</p>\n<p>The backward compatibility when switching to the new algorithm is really important to us. So, we have switched it on by default <em>only</em> in the IDE for this release, to gather feedback from real-life examples. Note that it’s possible that the code works correctly in the IDE but isn’t supported by the compiler since different bugs related to type inference for complicated corner-cases were fixed. If you observe any inconsistent behavior when the code is red in the IDE but compiles fine with the Kotlin compiler or vice versa, please let us know by <a href=\"http://kotl.in/issue\" rel=\"noopener noreferrer\">filing a new issue</a>. If this mode doesn’t work well for your projects, you can switch it off by unselecting the checkbox <code>Enable new type inference algorithm for IDE analysis</code> in the <a href=\"https://www.jetbrains.com/help/idea/compiler-kotlin-compiler.html\" rel=\"noopener noreferrer\">Kotlin Compiler tab in Preferences</a> (in Android Studio the option is located in a different place: Preferences | Kotlin Compiler).</p>\n<p>We are looking forward to your feedback!</p>\n<h2>Multiplatform Projects (MPP)</h2>\n<p>Test runners for Kotlin/Native and Kotlin/JS now implement all Gradle Test runner APIs and behave in a way similar to the Kotlin/JVM test runner. Test failure reports with source code navigation will be printed into the console. A test report will be generated by Gradle too. Test filtering parameters are also supported via the standard Gradle parameter, e.g. <code>--tests some.test.ClassName</code>.</p>\n<p>A combined test run report can be generated from Gradle to include all information in all test runs on all targets, including Kotlin/Native, Kotlin/JS, and Kotlin/JVM.</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/06/2019-06-17_17-08-16.png\" alt=\"kotlin-1.3.40-test-runner-report\" width=\"600\"></p>\n<h2>Kotlin/JS</h2>\n<p>Kotlin/JS incremental compilation performance has been improved. In particular, the compilation time of large projects and/or modules with lots of dependencies is reduced by up to 30% in some cases.</p>\n<p>The most visible changes to Kotlin/JS in this release are from the tooling side. We are happy to introduce the updated Kotlin/JS plugin for Gradle, we’ve renamed it <code>org.jetbrains.kotlin.js</code> and it is now available on the <a href=\"https://plugins.gradle.org/plugin/org.jetbrains.kotlin.js\" rel=\"noopener noreferrer\">Gradle plugin portal</a>. Just use the <code>plugins {}</code> syntax in your <code>build.gradle</code> to enable it:</p>\n<pre>plugins {\n    id(\"org.jetbrains.kotlin.js\") version \"1.3.40\"\n}\n</pre>\n<p>or use the <code>kotlin</code> function in <code>build.gradle.kts</code>:</p>\n<pre>plugins {\n    kotlin(\"js\") version \"1.3.40\"\n}\n</pre>\n<p>We are working hard to port all the features of the <a href=\"https://github.com/Kotlin/kotlin-frontend-plugin\" rel=\"noopener noreferrer\">kotlin-frontend-plugin</a> plugin into our Kotlin/JS plugin and Kotlin/Multiplatform plugins. Some of the features are already included as experimental. We plan to deprecate the <code>kotlin-frontend-plugin</code> when this work is complete.</p>\n<h3>Experimental support for NPM and Webpack</h3>\n<p>Today, we are happy to share with you a few more experimental features to help simplify the development of JavaScript projects that use Node.js, NPM, Yarn, or Webpack. We’ve added helper tasks to both Kotlin/JS and Multiplatform Gradle plugins to simplify the integration. The plugin will generate a temporary <code>package.json</code> for your project, and it will download and use <a href=\"https://yarnpkg.com/en/\" rel=\"noopener noreferrer\">Yarn</a> to manage the NPM dependencies and <code>node_modules</code> automatically. Webpack will be used behind the scenes to join all the dependencies and create browser-friendly scripts from your code.</p>\n<p>The plugin attaches all your Kotlin/JS dependencies declared in a Gradle project to the automatically maintained <code>node_modules</code> folder. Adding an NPM dependency is now supported in Gradle scripts via the newly added <code>npm</code> function in the <code>dependencies {}</code> block of a JS SourceSet:</p>\n<pre>dependencies {\n    implementation(npm(\"react\", \"16.8.3\"))\n}\n</pre>\n<p><a href=\"https://yarnpkg.com/lang/en/docs/workspaces/\" rel=\"noopener noreferrer\">Yarn Workspaces</a> are used for <a href=\"https://guides.gradle.org/creating-multi-project-builds/\" rel=\"noopener noreferrer\">Multi-Project Gradle builds</a>. A workspace is created per sub-project and configured under the root project’s build directory. This allows Yarn to reduce <code>node_modules</code> copies in sub-projects by extracting common dependencies to root <code>node_modules</code>.</p>\n<h3>Node.js and Browser Modes</h3>\n<p>Running or testing JavaScript projects has always depended on the environment. We’ve now added support for Node.js and browser execution environments. You may use <code>nodejs {}</code> or <code>browser {}</code> functions to configure the Kotlin target for both Kotlin/JS and Multiplatform Gradle plugins.</p>\n<pre>kotlin {\n    //use js() for a multiplatform project\n    target {\n        nodejs()\n        browser()\n    }\n\n    sourceSets[\"main\"].dependencies {\n        implementation(kotlin(\"stdlib-js\"))\n        implementation(npm(\"react\", \"16.8.3\"))\n    }\n}\n</pre>\n<p>The Gradle plugin will download and install (via Yarn, of course) all the required NPM dependencies, including a headless browser for Karma tests, to run the tests for your code. Mocha test framework will be used to run your tests in a Node.js environment. Test runners are integrated with Gradle and implement similar features as are available for Kotlin/JVM tests. For example, test failures are shown in the console, tests report will be generated, a test filter may be passed to the Gradle command line.</p>\n<p>Sometimes it is hard to trace an error back to the point in the code to improve it, so we’ve added JavaScript source maps support to all these tasks in our Gradle plugin.</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/06/kotlin-1.3.40-tests.png\" alt=\"kotlin-1.3.40-tests\" width=\"800\"></p>\n<p>You may easily configure to run browser tests in different browsers. The plugin will configure NPM dependencies for the Karma test runner to make it happen. The following DSL can be used in Gradle:</p>\n<pre>kotlin {\n    //use js() for multiplatform project\n    target {\n        browser {\n            testTask {\n                useKarma {\n                    useIe()\n                    useSafari()\n                    useFirefox()\n                    useChrome()\n                    useChromeCanary()\n                    useChromeHeadless()\n                    usePhantomJS()\n                    useOpera()\n                }\n            }\n        }\n    }\n}\n</pre>\n<p>A <code>run</code> task was also added to the Gradle plugin to execute the Kotlin/JS code in Node.js or Browser environments.</p>\n<p>Note, the new Kotlin/JS build features are experimental and currently only supported on macOS and Linux. Windows support will be added later.</p>\n<h2>Kotlin/Native</h2>\n<p>Several improvements were <a href=\"https://github.com/JetBrains/kotlin-native/pull/2813\" rel=\"noopener noreferrer\">added</a> in the memory manager to improve the performance of Kotlin/Native applications. We’ve noticed nearly twice the performance boost to our benchmarks.</p>\n<p>ARM x64 (ARM/AArch64) support is added for Linux targets. The <code>CoreLocation</code> framework is pre-imported and included out of the box on macOS. We’ve improved logging and error messages that are shown by the Kotlin/Native compiler.</p>\n<p><code>FreezableAtomicReference</code> is a new experimental <a href=\"https://github.com/JetBrains/kotlin-native/pull/2776\" rel=\"noopener noreferrer\">class</a> included in Kotlin/Native to help deal with multiple threads and concurrency. It behaves like an <code>AtomicReference</code> class, no matter if it is frozen or not.</p>\n<p><code>kotlin-platform-native</code> is now deprecated. Please migrate to the <code>kotlin-multiplatform</code> Gradle plugin. Check out the <a href=\"https://github.com/JetBrains/kotlin-native/blob/master/GRADLE_PLUGIN.md\" rel=\"noopener noreferrer\">documentation</a> for the migration guide and more info.</p>\n<p>We’ve also removed the previously deprecated API in the <code>kotlin-multiplatform</code> Gradle plugin to configure Kotlin/Native targets. Starting from 1.3.40, the <code>compilations.outputKinds</code> is no longer supported, please use the <code>binaries</code> API instead.</p>\n<h3>Interop</h3>\n<p>Experimental generics support for Kotlin/Native produced frameworks is <a href=\"https://github.com/JetBrains/kotlin-native/pull/2850\" rel=\"noopener noreferrer\">included</a>. It adds type information for generic parameters to Kotlin/Native generic classes for Objective-C/Swift. The feature is disabled by default, to enable it, pass the <code>-Xobjc-generics</code> command line argument to the compiler or add these lines to the Gradle project configuration:</p>\n<pre>kotlin {\n    iosX64 {\n        binaries {\n            framework {\n                freeCompilerArgs.add(\"-Xobjc-generics\")\n            }\n        }\n    }\n}\n</pre>\n<p>In addition to this, the Kotlin type <code>Unit</code> will turn into <code>Void</code> in the produced frameworks. Kotlin/Native method names will not clash with Objective-C declarations, because we’ve improved the way method names are <a href=\"https://github.com/JetBrains/kotlin-native/pull/2914\" rel=\"noopener noreferrer\">generated</a>. Variadic Objective-C functions are now <a href=\"https://github.com/JetBrains/kotlin-native/pull/2896\" rel=\"noopener noreferrer\">supported</a> in the interop.</p>\n<p>Nullable strings are now correctly <a href=\"https://github.com/JetBrains/kotlin-native/issues/2956\" rel=\"noopener noreferrer\">supported</a> in the C interop. We’ve fixed <a href=\"https://github.com/JetBrains/kotlin-native/issues/2941\" rel=\"noopener noreferrer\">issues</a> with the custom exception hook; now you can use the <code>setUnhandledExceptionHook {}</code> function in your code to catch unhandled Kotlin exceptions.</p>\n<h3>Tests in Kotlin/Native</h3>\n<p>We’ve added a separate binary type for Kotlin/Native test targets. Now it is easier to instruct the build to create a native tests executable:</p>\n<pre>kotlin.macosX64 {\n    binaries {\n        test(\"integration\") {\n            /* configuration if needed */\n        }\n    }\n}\n</pre>\n<p>Kotlin/Native test runner is now integrated with Gradle and implements features similar to those available for Kotlin/JVM tests, for example, test failures are shown in the console, tests report will be generated, and you may pass a tests filter to the Gradle command line.</p>\n<p>Now it’s easier to get the test binary via Gradle API using the <code>binaries.getTest</code> function. The old ways to find test executables, e.g., <code>binaries.getExecutable(\"test\", \"DEBUG\")</code>, will not work anymore, please use the new API instead: <code>binaries.getTest(\"DEBUG\")</code>.</p>\n<h2>How to update</h2>\n<p>As always, you can <strong>try Kotlin online</strong> at <a href=\"http://play.kotl.in/\" rel=\"noopener noreferrer\">play.kotl.in</a>.</p>\n<ul>\n<li><strong>In Maven, Gradle, and npm</strong>: Use <code>1.3.40</code> as the version for the compiler and the standard library. See the docs <a href=\"http://kotlinlang.org/docs/reference/using-gradle.html\" rel=\"noopener noreferrer\">here</a>.</li>\n<li><strong>In IntelliJ IDEA</strong> and <strong>Android Studio</strong>: Update the Kotlin plugin to version 1.3.40. Use <em>Tools | Kotlin | Configure Kotlin Plugin Updates</em> and click the “Check for updates now” button.</li>\n<li><strong>In Eclipse</strong>: Install the plugin using <a href=\"https://marketplace.eclipse.org/content/kotlin-plugin-eclipse\" rel=\"noopener noreferrer\">Marketplace</a>.</li>\n<li><strong>The command-line compiler</strong> can be downloaded from the <a href=\"https://github.com/JetBrains/kotlin/releases/tag/v1.3.40\" rel=\"noopener noreferrer\">Github release page</a>.</li>\n</ul>\n<p>If you run into any problems with the new release, you’re welcome to ask for help on the <a href=\"https://discuss.kotlinlang.org/\" rel=\"noopener noreferrer\">forums</a>, on Slack (get an invite <a href=\"http://slack.kotlinlang.org/\" rel=\"noopener noreferrer\">here</a>), or to report issues in the <a href=\"https://youtrack.jetbrains.com/issues/KT\" rel=\"noopener noreferrer\">issue tracker</a>.</p>\n<p>Let’s Kotlin!</p>\n<h2>External Contributions</h2>\n<p>We’re especially grateful to <a href=\"https://twitter.com/kpgalligan\" rel=\"noopener noreferrer\">Kevin Galligan</a> for his contribution of <a href=\"https://github.com/JetBrains/kotlin-native/pull/2850\" rel=\"noopener noreferrer\">adding support of generics in Kotlin/Native produced frameworks</a>.</p>\n<p>We’d like to thank our external contributors whose pull requests were included in this release:<br>\n* <a href=\"https://github.com/Dimach\" rel=\"noopener noreferrer\">Dimach</a><br>\n* <a href=\"https://github.com/t-kameyama\" rel=\"noopener noreferrer\">Toshiaki Kameyama</a><br>\n* <a href=\"https://github.com/pyos\" rel=\"noopener noreferrer\">pyos</a><br>\n* <a href=\"https://github.com/punzki\" rel=\"noopener noreferrer\">Mark Punzalan</a><br>\n* <a href=\"https://github.com/gavra0\" rel=\"noopener noreferrer\">Ivan Gavrilovic</a><br>\n* <a href=\"https://github.com/ting-yuan\" rel=\"noopener noreferrer\">Ting-Yuan Huang</a><br>\n* <a href=\"https://github.com/sfs\" rel=\"noopener noreferrer\">Steven Schäfer</a><br>\n* <a href=\"https://github.com/burakeregar\" rel=\"noopener noreferrer\">Burak Eregar</a><br>\n* Dereck Bridie<br>\n* <a href=\"https://twitter.com/JakeWharton\" rel=\"noopener noreferrer\">Jake Wharton</a><br>\n* Mads Ager<br>\n* Kirill Knize<br>\n* gcx11<br>\n* Austaon<br>\n* <a href=\"https://github.com/PP-Ryan\" rel=\"noopener noreferrer\">Ryan</a><br>\n* <a href=\"https://github.com/jan-gerling\" rel=\"noopener noreferrer\">Jan Gerling</a><br>\n* <a href=\"https://github.com/31311538+tiltorito\" rel=\"noopener noreferrer\">Harry Billinis</a><br>\n* <a href=\"https://github.com/geoand\" rel=\"noopener noreferrer\">Georgios Andrianakis</a><br>\n* <a href=\"https://github.com/gastaldi\" rel=\"noopener noreferrer\">George Gastaldi</a><br>\n* <a href=\"https://github.com/EdwarDDay\" rel=\"noopener noreferrer\">Eduard Wolf</a><br>\n* <a href=\"https://github.com/floralvikings\" rel=\"noopener noreferrer\">Caleb Brinkman</a><br>\n* <a href=\"https://github.com/wcarmon\" rel=\"noopener noreferrer\">Wil</a><br>\n* <a href=\"https://github.com/borsini\" rel=\"noopener noreferrer\">Benjamin Orsini</a><br>\n* <a href=\"https://github.com/Inego\" rel=\"noopener noreferrer\">Yanis Batura</a><br>\n* ilgonmic<br>\n* Kenji Tomita<br>\n* <a href=\"https://github.com/inktomi\" rel=\"noopener noreferrer\">Matthew Runo</a><br>\n* Kirill Rakhman<br>\n* <a href=\"https://twitter.com/kpgalligan\" rel=\"noopener noreferrer\">Kevin Galligan</a><br>\n* Kevin Peek<br>\n* Kerooker<br>\n* Juan Chen<br>\n* Nikolay Kasyanov<br>\n* Jorge Antonio Díaz-Benito Soriano<br>\n* Pavel Nikitin<br>\n* Peter Xu<br>\n* Rene Groeschke<br>\n* Jiaxiang Chen</p>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/06/experimentalAPI.png",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2019/06/kotlin-1-3-40-released/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=7295",
        link: "https://blog.jetbrains.com/kotlin/2019/07/kotlin-wins-breakout-project-of-the-year-award-at-oscon-19/",
        title: "Kotlin wins Breakout Project of the Year award at OSCON ’19",
        date: 2019-07-18T16:10:45Z,
        summary: Some(
            "Today at the O’Reilly Open Source Awards 2019, we were honored to hear that Kotlin has won the prestigious Breakout Project of the Year award, this award recognizes a project that has started “breaking out in a big way” over … Continue reading →",
        ),
        content: Some(
            "<p>Today at the O’Reilly Open Source Awards 2019, we were honored to hear that Kotlin has won the prestigious Breakout Project of the Year award, this award recognizes a project that has started “breaking out in a big way” over the past year, which we are really happy about. We want to say a massive thank you to O’Reilly OSCON for this recognition, but more importantly, we want to take a minute to thank the incredible Kotlin community who have brought the project to where it is today.</p>\n<p>Since our first commit to the GitHub repository on the 7th of November, 2010, we have watched in awe as the open-source community has embraced the language and driven it forward with their contribution, support, and ideas which have gone into the language we are all very proud of.</p>\n<p>There is still work to do, but as long as we have such an incredible community behind us we know we can make this language what it needs to be for developers. If you haven’t used Kotlin yet, we would love to have you try. Your contributions and feedback are what help us improve. Get involved in the evolution of the language and let’s see how far we can go together.</p>\n<p>Again, to everyone who has helped make Kotlin the success it is today, thank you and have a nice Kotlin! <img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/wp-includes/images/smilies/simple-smile.png\" alt=\":)\"></p>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/wp-includes/images/smilies/simple-smile.png",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2019/07/kotlin-wins-breakout-project-of-the-year-award-at-oscon-19/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=7309",
        link: "https://blog.jetbrains.com/kotlin/2019/08/kotlin-1-3-50-released/",
        title: "Kotlin 1.3.50 released",
        date: 2019-08-22T19:25:01Z,
        summary: Some(
            "We’re happy to announce the release of Kotlin 1.3.50 today. In addition to the quality and tooling improvements, the main focus for this version has been on: Designing a new Duration and Time Measurement API (available for preview). Working on … Continue reading →",
        ),
        content: Some(
            "<p>We’re happy to announce the release of Kotlin 1.3.50 today. In addition to the quality and tooling improvements, the main focus for this version has been on:</p>\n<ul>\n<li>Designing a new Duration and Time Measurement API (available for preview).</li>\n<li>Working on an improved Java-to-Kotlin converter.</li>\n<li>Experimental generation of external declarations for npm dependencies in Gradle Kotlin/JS projects (using Dukat).</li>\n<li>A separate plugin for debugging Kotlin/Native code in IntelliJ IDEA Ultimate.</li>\n<li>Java compilation support in multiplatform projects.</li>\n</ul>\n<p>You can find the complete list of changes in the <a href=\"https://github.com/JetBrains/kotlin/blob/1.3.50/ChangeLog.md\" rel=\"noopener noreferrer\">change log</a>. As always, we’d like to thank our <a href=\"https://blog.jetbrains.com/kotlin/2019/08/kotlin-1-3-50-released/#external-contributions\" rel=\"noopener noreferrer\">external contributors</a>. Now let’s dive into the details!</p>\n<h2>Null-check optimizations planned for Kotlin 1.4</h2>\n<p>As you probably know, Kotlin decreases the possibility of <code>NullPointerException</code>s by providing support for nullable types. However, because of interoperability with Java code, it’s impossible to avoid NPEs completely. To help developers better understand the source of a nullability problem if it occurs, Kotlin compiler throws different types of runtime exceptions with clear error messages instead of pure NPEs. It turned out that this approach has its disadvantages: it reduces possible null check optimizations that can be performed either by the Kotlin compiler or by various kinds of bytecode processing tools, such as the Android <a href=\"https://developer.android.com/studio/build/shrink-code\" rel=\"noopener noreferrer\">R8 optimizer</a>.</p>\n<p><span></span></p>\n<p>To solve this, starting from Kotlin 1.4, all runtime null checks will throw a <code>java.lang.NullPointerException</code> instead of a <code>KotlinNullPointerException</code>, <code>IllegalStateException</code>, <code>IllegalArgumentException</code>, and <code>TypeCastException</code>. This applies to: the <code>!!</code> operator, parameter null checks in the method preamble, platform-typed expression null checks, and the <code>as</code> operator with a non-null type. This doesn’t apply to <code>lateinit</code> null checks and explicit library function calls like <code>checkNotNull</code> or <code>requireNotNull</code>.</p>\n<p>Note that from a developer’s perspective, things won’t change that much: the Kotlin code will throw exceptions with the same error messages as before. <em>The type</em> of exception changes, but the information passed stays the same. For instance, the following code currently throws an <code>IllegalStateException</code> with the error message “JavaCode.getNull() must not be null”:</p>\n<pre>fun main() {\n    duplicate(JavaCode.getNull())  // 1\n}\n\nfun duplicate(s: String) = s + s\n</pre>\n<pre>public class JavaCode {\n    public static String getNull() { return null; }\n}\n</pre>\n<p>Right before the <code>duplicate</code> function call at line <code>1</code>, a special check is generated which throws this exception if the expression <code>JavaCode.getNull()</code> stores <code>null</code>. Starting with Kotlin 1.4, this code will throw a <code>NullPointerException</code> instead with the same message, “JavaCode.getNull() must not be null”.</p>\n<p>After this change of behavior, the optimizers will be able to decrease the total number of null-checks present in the bytecode by removing repetitive null-checks when possible: since all checks throw the same NPE exception, only one can remain. During such optimizations, the specific helpful messages of NPEs can be lost, but that’s the price to be paid for the gained performance benefits. Note that these optimizations are still to be implemented in the corresponding tools, and when implemented, there will be more details about that, but the change of the exception type makes it possible in the future.</p>\n<h2>Standard library changes</h2>\n<p>Note that all new functions are added to the standard library in the “experimental” state.</p>\n<h3>Duration and time measurement API</h3>\n<p>A new duration and time measurement API is available for preview. Duration can be measured in a variety of units: seconds, milliseconds, nanoseconds, etc. The confusion between different units is a known source of bugs: if the API expects the duration stored as primitive value like <code>Long</code>, one can erroneously pass the value in the wrong unit, and unfortunately the type system doesn’t help prevent that. Creating a regular class to store duration solves this problem, but brings another one: additional allocations.</p>\n<p>Inline classes provide a very elegant solution to that: they bring both type system guarantees and an allocation-free approach. Now the API can use the <code>Duration</code> type, and all the clients will need to specify the time in the desired units explicitly. Since <code>Duration</code> is declared as an inline class, no extra allocations are happening under the hood:</p>\n<pre>import kotlinx.coroutines.delay\nimport kotlin.time.*\n\n@ExperimentalTime\nsuspend fun greetAfterTimeout(duration: Duration) {\n    delay(duration.toLongMilliseconds())\n    println(\"Hi!\")\n}\n\n@UseExperimental(ExperimentalTime::class)\nsuspend fun main() {\n    greetAfterTimeout(100.milliseconds)\n    greetAfterTimeout(1.seconds)\n}\n</pre>\n<p>This release brings support for <code>MonoClock</code> which represents the <em>monotonic clock</em>. The recommended approach to measuring time duration from a given point in your program is to use the monotonic clock, which doesn’t depend on the system time. System time might be changed outside, and that might lead to erroneous behavior. The monotonic clock can only measure time difference between given time points, but doesn’t know the “current time.”</p>\n<p>The <code>Clock</code> interface provides a general API for measuring time intervals. <code>MonoClock</code> is an object implementing <code>Clock</code>; it provides the default source of monotonic time on different platforms.</p>\n<p>When using the <code>Clock</code> interface, you explicitly mark the time of action start, and later the time elapsed from the start point. It is especially convenient if you want to start and finish measuring time from different functions:</p>\n<pre>import kotlin.time.*\n\n@UseExperimental(ExperimentalTime::class)\nfun main() {\n    val clock = MonoClock\n    val mark = clock.markNow() // might be inside the first function\n    Thread.sleep(10)           // action\n    println(mark.elapsedNow()) // might be inside the second function\n}\n</pre>\n<p>The <code>measureTimedValue</code> function allows you to measure the duration of a given action and get its result together with the duration of the elapsed time interval. It measures the elapsed time with <code>MonoClock</code>.</p>\n<pre>import kotlin.time.*\n\n@UseExperimental(ExperimentalTime::class)\nfun main() {\n    val (value, duration) = measureTimedValue {\n        Thread.sleep(100)\n        42\n    }\n    println(value)     // 42\n    println(duration)  // e.g. 103 ms\n}\n</pre>\n<p>For more details about the implementation of the <code>Duration</code> class and the details of the <code>Clock</code> interface and <code>MonoClock</code> implementations for different platforms, please refer to the corresponding <a href=\"https://github.com/Kotlin/KEEP/blob/durations/proposals/stdlib/durations-and-clocks.md\" rel=\"noopener noreferrer\">KEEP</a>. Note that this API is experimental and is subject to change based on your feedback. You will need to explicitly give your consent to use it by applying the corresponding <a href=\"https://kotlinlang.org/docs/reference/experimental.html\" rel=\"noopener noreferrer\">annotations</a>.</p>\n<p>We’re looking forward to your feedback!</p>\n<h3>Functions for bit manipulation</h3>\n<p>The standard library now contains an API for bit manipulation (as usual, in the experimental state initially):</p>\n<pre>@UseExperimental(ExperimentalStdlibApi::class)\nfun main() {\n    val number = \"1010000\".toInt(radix = 2)\n    println(number.countOneBits())\n    println(number.countTrailingZeroBits())\n    println(number.takeHighestOneBit().toString(2))\n    println(number.rotateRight(3).toString(2))\n    println(number.rotateLeft(3).toString(2))\n}\n</pre>\n<p>Note that similar extension functions for Int, Long, Short, Byte, and their unsigned counterparts have been added.</p>\n<h2>IntelliJ IDEA support</h2>\n<h3>Improved Java to Kotlin converter</h3>\n<p>We plan to improve the Java-to-Kotlin converter to minimize the amount of “red code” one has to fix manually after the conversion. As the current converter almost always generates non-nullable types, you need to fix the nullability issues by hand afterward. It can often lead to runtime errors from nullability mismatch later.</p>\n<p>The new, improved version of the Java-to-Kotlin converter tries to infer nullability more correctly based on the Java type usages in the code. Note that there’s no goal to produce 100% error-free code. The goal is to decrease the number of compilation errors and to make the produced Kotlin code more convenient to work with. The new converter fixes many other known bugs, too; for instance, it now correctly handles implicit Java type casts.</p>\n<p>In the future, the new converter is going to become the default one. In this release, it’s available for preview. To turn it on, specify the <code>Use New J2K (experimental)</code> flag in settings.</p>\n<p>Please give it a try and share your feedback with us!</p>\n<h3>Debugging improvements</h3>\n<p>We’ve improved how the Kotlin “Variables” view chooses the variables to display. As there’s a lot of additional technical information in the bytecode, the Kotlin “Variables” view highlights only the relevant variables. Now it works better when you set a breakpoint inside a lambda (either inlined or non-inlined). Local variables inside the lambda, as well as captured variables from the outer context and parameters of the outer function, are correctly displayed:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/08/debug_lambda_variables.png\" alt=\"debug_lambda_variables\" width=\"600\"></p>\n<p>You can now set a breakpoint at the end of the function, if needed:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/08/end_of_function_breakpoint.png\" alt=\"end_of_function_breakpoint\" width=\"600\"></p>\n<p>Support for the “Evaluate expression” functionality in the debugger was improved for many non-trivial language features, such as local extension functions or accessors of member extension properties. Also, you can now modify variables via “Evaluate expression”:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/08/evaluate_expression2.png\" alt=\"\" width=\"600\"></p>\n<p>Note that, alternatively, you can modify variables in the “Variables” view directly.</p>\n<h3>New intentions and inspections</h3>\n<p>New intentions and inspections have been added. One of the goals of intentions is to help you learn how to write idiomatic Kotlin code. The following intention, for instance, suggests using the <code>indices</code> property rather than building a range of indices manually:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/08/indices2.png\" alt=\"\" width=\"600\"></p>\n<p>If the index isn’t used, the loop can be automatically replaced with a for loop over elements.</p>\n<p>IntelliJ IDEA now:</p>\n<ul>\n<li>Can automatically replace the <code>lateinit</code> property of a primitive type with the <code>by Delegates.notNull()</code> syntax.</li>\n<li>Can convert a regular property to a lazy one and back.</li>\n<li>Detects usages of Java methods for array comparison (like <code>Arrays.equals()</code> or <code>Array.deepEquals()</code>) and suggest replacing them with their Kotlin counterparts (like <code>contentEquals</code> and <code>contentDeepEquals</code>).</li>\n<li>Highlights the deprecated import in the completion list.</li>\n</ul>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/08/deprecated_imports.png\" alt=\"deprecated_imports\" width=\"600\"></p>\n<p>The general performance of IDE actions has been improved, and several known situations that were causing the UI to freeze (such as calling the “Move” refactoring on a file with a huge number of usages) have been fixed.</p>\n<h2>Kotlin/JS</h2>\n<p>This update adds support for building and running Kotlin/JS Gradle projects using the <code>org.jetbrains.kotlin.js</code> plugin on Windows. Just like on other platforms, you can build and run your projects using Gradle tasks, dependencies from NPM required in your Gradle configuration are resolved and included, you can try out your applications using webpack-dev-server (e.g. by invoking the <code>browserRun</code> Gradle task), and more. As with the other platforms, all of this can be used without having to manually install and manage a node, npm, or yarn distribution.</p>\n<p>Under the hood, there have also been a series of performance improvements for Kotlin/JS, improving the incremental compilation time for projects. This means that you can expect speedups of up to 30% when compared to 1.3.41.</p>\n<p>Our improved integration with NPM means that projects are now resolved lazily and in parallel, and support for projects with transitive dependencies between compilations in the same project has been added.</p>\n<p>The new version also brings with it changes in the structure and naming of generated artifacts. Generated artifacts are now bundled in the distributions folder, and they include the version number of the project and <code>archiveBaseName</code> (which defaults to the project name), e.g. <code>projectName-1.0-SNAPSHOT.js</code>.</p>\n<h3>Dukat</h3>\n<p><a href=\"https://github.com/Kotlin/dukat\" rel=\"noopener noreferrer\">Dukat</a> allows the automatic conversion of TypeScript declaration files (<code>.d.ts</code>) into Kotlin external declarations (and thus replaces the <code>ts2kt</code> command-line tool). This makes it more comfortable to use libraries from the JavaScript ecosystem in a type-safe manner in Kotlin, by drastically reducing the need for manually writing wrappers for JS libraries.</p>\n<p>Kotlin/JS now ships with experimental support for dukat integration for Gradle projects. With this integration, by running the build task in Gradle, typesafe wrappers are <em>automatically</em> generated for npm dependencies and can be used from Kotlin.</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/08/kotlin-dukat-preview-1.png\" alt=\"kotlin-dukat-preview\" width=\"902\" height=\"542\"></p>\n<p>Because dukat is still in a very early stage, its integration is disabled by default. Add the <code>kotlin.js.experimental.generateKotlinExternals=true</code> line into the <code>gradle.properties</code> file in a project root directory to turn on dukat for your project. We’ve prepared an <a href=\"https://github.com/JetBrains/kotlin-js-demo-1.3.50\" rel=\"noopener noreferrer\">example project</a> for it too, which demonstrates the use of dukat in Kotlin/JS projects. Try it out and share your <a href=\"https://github.com/kotlin/dukat/issues\" rel=\"noopener noreferrer\">feedback</a> with us.</p>\n<h2>Kotlin/Native</h2>\n<p>It was not easy but possible to notice that the version of Kotlin/Native differed from the version of Kotlin. Not anymore! The version schemes for Kotlin and Kotlin/Native are now aligned. This release uses version 1.3.50 for both Kotlin and Kotlin/Native binaries, reducing the complexity.</p>\n<p>This release brings more pre-imported Apple frameworks for all platforms, including macOS and iOS. The Kotlin/Native compiler now includes actual bitcode in produced frameworks.</p>\n<p>Several improvements have been made for interop. We now support the <code>kotlin.Deprecated</code> annotation when producing a framework, and the generated Objective-C headers code will not have warnings. The <code>getOriginalKotlinClass()</code> function is added into the standard library to get a <code>KClass</code> from an Objective-C class or protocols.</p>\n<p>The standard library has been updated to support the <code>kotlin.reflect.typeOf()</code> function for Kotlin/Native types. The new function <code>executeAfter()</code> is added to the <code>Worker</code> type to execute actions after a delay. In addition, you can call the <code>processQueue()</code> function on the <code>Worker</code> to process the tasks queue explicitly.</p>\n<p>The older functions <code>ByteArray.stringFromUtf8()</code> and <code>ByteArray.stringFromUtf8OrThrow()</code> are now deprecated. In the previous release, we added the <code>ByteArray.decodeToString()</code> function (in the <code>kotlin.text</code> package) to convert a UTF-8 string to a Kotlin string. That function does not support NULL-terminated strings, so to fix that, in 1.3.50 we’ve added a new function to deal with NULL-terminated UTF-8 strings easily. The <code>ByteArray.toKString()</code> function (from the <code>kotlinx.cinterop</code> package) can be used to turn a NULL-terminated UTF-8 string into a Kotlin string. You can pass start and end indices to the function if needed.</p>\n<p>We’ve deprecated and removed the <code>kotlin-platform-native</code> Gradle plugin in favor of the <code>kotlin-multiplatform</code> Gradle plugin, so now you can easily benefit from all multiplatform project features. Check out the <a href=\"https://github.com/JetBrains/kotlin-native/blob/master/GRADLE_PLUGIN.md\" rel=\"noopener noreferrer\">documentation</a> for the migration guide and more info</p>\n<p>Finally, we are happy to share that the Kotlin/Native compiler and the interop tool performance has been improved in this release.</p>\n<h2>Multiplatform Projects</h2>\n<p>Java compilation can now be included in Kotlin/JVM targets of a multiplatform project by calling the newly added <code>withJava()</code> function of the DSL. It will configure Java plugin to use the <code>src/&lt;targetName&gt;Main/java</code> and <code>src/&lt;targetName&gt;Test/java</code> paths by default. Here is a full example to create a Kotlin/JVM target with enabled Java compilation:</p>\n<pre>plugins { \n    kotlin(\"multiplatform\") version \"1.3.50\"\n}\nkotlin {\n    jvm {\n        withJava()\n    }\n}\n</pre>\n<p>Kotlin’s New Project wizard now generates Gradle Kotlin DSL for new projects.</p>\n<p>Debugging Kotlin/Native code in IntelliJ IDEA Ultimate is now supported too! Try installing the new <a href=\"https://plugins.jetbrains.com/plugin/12775-native-debug-for-intellij\" rel=\"noopener noreferrer\">Native Debug for IntelliJ IDEA Ultimate</a> plugin. It should detect Kotlin/Native run configurations and the debug action is supported:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/08/debugging-kotlin-native-1.3.50.png\" alt=\"debugging-kotlin-native-1.3.50\" width=\"1620\" height=\"1516\"></p>\n<h2>Scripting</h2>\n<p>This release adds multiple features and improvements in scripting and REPL support. Using Kotlin as a scripting language for your application is even easier! Now the scripting support works out of the box: we’ve published a default JSR-223 implementation library, so to add Kotlin scripting support for your application, you only need to add <code>kotlin-scripting-jsr223</code> as a dependency and use the <code>javax.script</code> API with Kotlin.</p>\n<p>Properties that are set via the JSR-223 API are now accessible from scripts as regular Kotlin properties (before, that you had to use the <code>bindings</code> map):</p>\n<pre>val engine = ScriptEngineManager().getEngineByExtension(\"kts\")!!\nengine.put(\"z\", 42)\nengine.eval(\"\"\"println(\"answer = $z\")\"\"\")\n</pre>\n<p><a href=\"https://github.com/Kotlin/KEEP/blob/master/proposals/scripting-support.md#kotlin-main-kts\" rel=\"noopener noreferrer\">The <code>kotlin-main-kts</code> artifact</a>, which was introduced in Kotlin 1.3 to simplify the creation and usage of the basic utility scripts, can now be used as a JSR-223 host as well. In addition to the annotations like <code>Repository</code> and <code>DependsOn</code> for resolving dependencies, it now supports the <code>@Import</code> annotation instructing the scripting compiler to “import” another script into the current one:</p>\n<pre>// common.main.kts:\nval foo = \"common foo\"\n</pre>\n<pre>// script.main.kts:\n@file:Import(\"common.main.kts\")\nval bar = \"bar with $foo\"\n</pre>\n<p>Read more about scripting in <a href=\"https://github.com/Kotlin/KEEP/blob/master/proposals/scripting-support.md\" rel=\"noopener noreferrer\">KEEP-75</a>. You can find <a href=\"https://github.com/JetBrains/kotlin/tree/master/libraries/examples/scripting\" rel=\"noopener noreferrer\">examples</a> in the Kotlin repository. Please share your feedback in the #scripting channel on the Kotlin Slack!</p>\n<h2>How to update</h2>\n<p>As always, you can <strong>try Kotlin online</strong> at <a href=\"http://play.kotl.in/\" rel=\"noopener noreferrer\">play.kotl.in</a>.</p>\n<ul>\n<li><strong>In Maven, Gradle, and npm</strong>: Use <code>1.3.50</code> as the version for the compiler and the standard library. See the docs <a href=\"http://kotlinlang.org/docs/reference/using-gradle.html\" rel=\"noopener noreferrer\">here</a>.</li>\n<li><strong>In IntelliJ IDEA</strong> and <strong>Android Studio</strong>: Update the Kotlin plugin to version 1.3.50. Use <em>Tools | Kotlin | Configure Kotlin Plugin Updates</em> and click the “Check for updates now” button.</li>\n<li><strong>In Eclipse</strong>: Install the plugin using the <a href=\"https://marketplace.eclipse.org/content/kotlin-plugin-eclipse\" rel=\"noopener noreferrer\">Marketplace</a>.</li>\n<li><strong>The command-line compiler</strong> can be downloaded from the <a href=\"https://github.com/JetBrains/kotlin/releases/tag/v1.3.50\" rel=\"noopener noreferrer\">Github release page</a>.</li>\n</ul>\n<p>If you run into any problems with the new release, you’re welcome to ask for help on the <a href=\"https://discuss.kotlinlang.org/\" rel=\"noopener noreferrer\">forums</a>, on Slack (get an invite <a href=\"http://slack.kotlinlang.org/\" rel=\"noopener noreferrer\">here</a>), or to report issues in the <a href=\"https://youtrack.jetbrains.com/issues/KT\" rel=\"noopener noreferrer\">issue tracker</a>.</p>\n<p>Let’s Kotlin!</p>\n<h2>External Contributions</h2>\n<p>We want to especially thank <a href=\"http://github.com/t-kameyama\" rel=\"noopener noreferrer\">Toshiaki Kameyama</a> for his ongoing work on providing many useful intentions and inspections for IntelliJ IDEA.</p>\n<p>We’d like to thank all our external contributors whose pull requests were included in this release:<br>\n* <a href=\"https://github.com/sfs\" rel=\"noopener noreferrer\">Steven Schäfer</a><br>\n* <a href=\"https://github.com/pyos\" rel=\"noopener noreferrer\">pyos</a><br>\n* <a href=\"https://github.com/gavra0\" rel=\"noopener noreferrer\">Ivan Gavrilovic</a><br>\n* <a href=\"https://github.com/madsager\" rel=\"noopener noreferrer\">Mads Ager</a><br>\n* <a href=\"https://github.com/ting-yuan\" rel=\"noopener noreferrer\">Ting-Yuan Huang</a><br>\n* <a href=\"https://github.com/ilgonmic\" rel=\"noopener noreferrer\">ilgonmic</a><br>\n* <a href=\"https://github.com/neetopia\" rel=\"noopener noreferrer\">Jiaxiang Chen</a><br>\n* Mark Punzalan<br>\n* Jake Wharton<br>\n* Jeffrey van Gogh<br>\n* Peter Xu<br>\n* Amaury<br>\n* Benjamin Orsini<br>\n* Dereck Bridie<br>\n* Eduard Wolf<br>\n* George Gastaldi<br>\n* Juan Chen<br>\n* Kevin Peek<br>\n* KilianCallebaut<br>\n* Louis CAD<br>\n* Martin Petrov<br>\n* <a href=\"https://github.com/inktomi\" rel=\"noopener noreferrer\">Matthew Runo</a><br>\n* <a href=\"https://github.com/ajalt\" rel=\"noopener noreferrer\">AJ Alt</a><br>\n* Ty Smith<br>\n* ghedeon<br>\n* technoir<br>\n* <a href=\"https://github.com/Dattish\" rel=\"noopener noreferrer\">Dat Trieu</a></p>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/08/debug_lambda_variables.png",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2019/08/kotlin-1-3-50-released/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=7401",
        link: "https://blog.jetbrains.com/kotlin/2019/08/kotlin-heroes-programming-contest-round-2/",
        title: "Kotlin Heroes programming contest, round #2",
        date: 2019-08-29T09:16:56Z,
        summary: Some(
            "We are excited to announce the second round of our Kotlin Heroes programming contest taking place on the Codeforces platform. JetBrains is working once again with Codeforces to promote Kotlin in the competitive programming community, as well as to give … Continue reading →",
        ),
        content: Some(
            "<p><img src=\"https://blog.jetbrains.com/wp-content/uploads/2019/05/kotlin_heroes_blog_announcment.png\" alt=\"Kotlin Heroes\" width=\"500\" height=\"350\"></p>\n<p>We are excited to announce the second round of our Kotlin Heroes programming contest taking place on the Codeforces platform. JetBrains is working once again with Codeforces to promote Kotlin in the competitive programming community, as well as to give the Kotlin community a platform to compare and hone their algorithmic programming skills. We hope that any of you who entered our first round on the 22nd of May this year will join us again now you know what to expect and try to improve (or at least hold) your standing on the leaderboard.</p>\n<p>You can see the standings from the first Kotlin heroes <a href=\"https://codeforces.com/contest/1170/standings?locale=en\" rel=\"noopener noreferrer\">here</a>, it was a closely fought contest. We would like to thank everyone for entering and submitting their answers and congratulate the top 3 winners <strong><a href=\"https://codeforces.com/profile/Petr\" rel=\"noopener noreferrer\">Petr</a></strong>, <strong><a href=\"https://codeforces.com/profile/ecnerwala\" rel=\"noopener noreferrer\">ecnerwala</a></strong>, and <strong><a href=\"https://codeforces.com/profile/abacabadabacaba\" rel=\"noopener noreferrer\">abacabadabacaba</a></strong> on their incredible achievement, especially considering they were up against 4,500 other registrants from over 63 countries. We’d also like to give a shout out to <strong><a href=\"https://codeforces.com/profile/tourist\" rel=\"noopener noreferrer\">tourist</a></strong>, for being the only other person who managed to solve every problem set.</p>\n<p>Episode 2 of the Kotlin Heroes competition will be hosted again on Codeforces, this time on the 7th of September, 2019, at 14:35 UTC (17:35 MSK, 07:35 PDT, 22:35 CST). The contest will last 2,5 hours and will feature a set of problems designed for both beginners and seasoned competitive programmers alike. The top three winners will receive prizes of $512, $256, and $128, respectively. The top 50 contestants will win a Kotlin Heroes t-shirt and an exclusive Kotlin badge. Finally, every competitor who solves at least one problem will enter a draw for one of the 50 exclusive Kotlin Heroes t-shirts.</p>\n<p><a title=\"Join Kotlin Heroes!\" href=\"https://www.jetbrains.com/promo/kotlin-heroes/\" rel=\"noopener noreferrer\">Join Kotlin Heroes!</a></p>\n<p><span></span></p>\n<p>Whether you are a long-time competitive programmer or a Kotlin developer who has never participated in a programming contest before, we think you’ll find Kotlin Heroes a useful, entertaining, and thought-provoking contest to be a part of to gain more experience.</p>\n<p>Contests are a great way to test your programming knowledge and improve it. It is a mind sport where contestants write programs to solve precisely formulated algorithmic problems within strict constraints. Problems can range from simple ones, which can be solved by any developer and require little code to achieve the correct solution, to complex ones that require knowledge of specific algorithms and data structures and lots of experience. Codeforces is a platform that brings together professional developers and students from all over the world for education, fun, and the opportunity to improve their programming skills.</p>\n<p>If you find Kotlin a fun and enjoyable language, we think you will enjoy participating in Kotlin Heroes and maybe even using Kotlin in other programming contests! We wish you good luck and have a nice Kotlin!</p>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://blog.jetbrains.com/wp-content/uploads/2019/05/kotlin_heroes_blog_announcment.png",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2019/08/kotlin-heroes-programming-contest-round-2/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=7408",
        link: "https://blog.jetbrains.com/kotlin/2019/09/instil-kotlin-happiness/",
        title: "Instil + Kotlin == Happiness",
        date: 2019-09-20T06:41:13Z,
        summary: Some(
            "A Case Study of the JetBrains Training Partnership Instil is a software development company based in Belfast, Northern Ireland. They specialize in mobile / cloud projects, consultancy, and training. Their training department is made up of 3 full-time and 4 … Continue reading →",
        ),
        content: Some(
            "<h2>A Case Study of the JetBrains Training Partnership</h2>\n<p><em><span>Instil is a software development company based in Belfast, Northern Ireland. They specialize in mobile / cloud projects, consultancy, and training. Their training department is made up of 3 full-time and 4 associate trainers, all of whom have at least 15 years of experience in developing, coaching, and consultancy.&nbsp;</span></em></p>\n<p><em>At JetBrains,&nbsp; we’re very excited to have partnered with Instil&nbsp;for our <a href=\"https://www.jetbrains.com/company/partners/kotlin/\" rel=\"noopener noreferrer\">Kotlin Certified Training Program</a>.&nbsp;</em><em><span>The following post, which tells their Kotlin story, has been written by </span><a href=\"https://instil.co/training/team/\" rel=\"noopener noreferrer\"><span>Garth Gilmour</span></a><span> from Instil.</span></em></p>\n<p><span>Instil first became involved in Kotlin in 2014. Back then Microservices, Single Page Applications and Cloud were very much in their infancy, and polyglot programming meant some adventurous soul had extended their Grade build file via Groovy. We were very much a traditional JVM shop focused around Java. Several of our developers had successfully completed the Coursera Scala certification and I had written </span><a href=\"https://instil.co/courses/scala-programming-for-java-developers/\" rel=\"noopener noreferrer\"><span>a modestly popular Scala course</span></a><span>, but there didn’t seem to be much appetite on either the development or the training side for pushing that option any harder.</span></p>\n<p><span>It was my colleague </span><a href=\"https://instil.co/training/team/\" rel=\"noopener noreferrer\"><span>Gareth Fleming</span></a><span> who first spotted the merits of Kotlin and began to advocate for it within the company. This was no accident. Gareth has an extensive background in mobile development, but at the time was teaching Java courses in response to overwhelming demand on the services side of the business. So he was well placed to appreciate how Kotlin would be an advantage both to experienced software teams and to graduate developers trying to acclimatise to the JVM ecosystem. Gareth became such a fan he started </span><a href=\"https://www.youtube.com/watch?v=sjuAhrDSdoI\" rel=\"noopener noreferrer\"><span>speaking on Kotlin at conferences</span></a><span>, managed to drag me away from Scala (not an easy task at the time) and persuaded our development teams to try Kotlin on new Android projects.</span></p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/09/InstilRebelConWorkshop.jpg\" alt=\"Workshop\" width=\"4032\" height=\"3024\"></p>\n<p><span>For our software business the rest, as they say, is history. We used Kotlin internally with increasing enthusiasm and started making it an integral part of our sales pitch in 2016. Since then we have delivered multiple projects using Kotlin, including mobile applications, Spring Boot based Web Applications, and Serverless systems deployed to AWS. We actively evangelise Kotlin to the other software companies we work with, and have been instrumental in helping several of them make the switch. As part of this we set up the </span><a href=\"https://www.meetup.com/kotlin-belfast/\" rel=\"noopener noreferrer\"><span>Belfast Kotlin User Group</span></a><span> in March of this year, organised </span><a href=\"https://www.meetup.com/Google-Developer-Group-Belfast/events/263782918/\" rel=\"noopener noreferrer\"><span>a Kotlin Everywhere event</span></a><span> and are actively collaborating with our sister groups in Dublin, Cork and Limerick.&nbsp;</span></p>\n<p>Returning to 2017 those of us working in the services side of the business began to make Kotlin a priority. Every year we take a punt on a technology that we think is going to explode into the near future and write a new classroom-based course from scratch. As a team we decided Kotlin’s star was in the ascendent, so we reached out to JetBrains for some official collaboration.&nbsp;JetBrains were kind enough to provide us with reviews and feedback on the material.</p>\n<p><span>This process continued for about six months, with additional feedback from our own coders and the wider development community in Belfast. By January 2018, we were ready to </span><a href=\"https://instil.co/courses/kotlin-development/\" rel=\"noopener noreferrer\"><span>formally announce the course</span></a><span>, so we ran a public training course with Svetlana Isakova (from JetBrains) attending as an official reviewer for the training.&nbsp;</span></p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/09/SvetlanaAtBASHNo2.jpg\" alt=\"Svetlana at BASH Event\" width=\"4000\" height=\"3000\"></p>\n<p><span>Since that first delivery, Kotlin training has become one of our specialities. My colleagues and I have been to Germany, Spain and all over the US to deliver bespoke Kotlin courses. Based on client demand we have written additional courses to </span><a href=\"https://instil.co/courses/swift-kotlin-android-conversion/\" rel=\"noopener noreferrer\"><span>convert Swift developers to Kotlin</span></a><span>, explore </span><a href=\"https://instil.co/courses/kotlin-pure-functional-programming/\" rel=\"noopener noreferrer\"><span>advanced Functional Programming techniques</span></a><span> and </span><a href=\"https://instil.co/courses/kotlin-microservices-kafka/\" rel=\"noopener noreferrer\"><span>make use of new frameworks like Spring WebFlux and Ktor</span></a><span>.&nbsp;</span></p>\n<p><span>As the good news about Kotlin has spread, we’ve also been approached to do talks and single-day workshops at Kotlin, including </span><a href=\"https://gotoams.nl/2019/workshops/172\" rel=\"noopener noreferrer\"><span>GOTO Amsterdam</span></a><span>, </span><a href=\"https://gotocph.com/2019/workshops/192\" rel=\"noopener noreferrer\"><span>GOTO Copenhagen</span></a><span>, </span><a href=\"https://www.nidevconf.com/\" rel=\"noopener noreferrer\"><span>NI Dev Conf</span></a><span> (</span><a href=\"https://www.youtube.com/watch?v=A27QdquQaS0\" rel=\"noopener noreferrer\"><span>video here</span></a><span>), </span><a href=\"https://rebelcon.io/talks/2019/garth-gilmour-coroutines-reactive-streams-and-effects/\" rel=\"noopener noreferrer\"><span>RebelCon</span></a><span>, </span><a href=\"https://conference.accu.org/\" rel=\"noopener noreferrer\"><span>ACCU</span></a><span> and (last but definitely not least) </span><a href=\"https://kotlinconf.com/workshops/\" rel=\"noopener noreferrer\"><span>KotlinConf</span></a><span>. We’ve had so many invites in 2019 that we ended up putting them on a t-shirt <img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/wp-includes/images/smilies/simple-smile.png\" alt=\":-)\"></span></p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/09/InstilOnTourTShirts.jpg\" alt=\"InstilOnTourTShirts\" width=\"1600\" height=\"1200\"></p>\n<p>We’re hoping to collaborate with the other beneficiaries in 2020. If you are a software team considering Kotlin adoption, I would be unequivocal in recommending that you have a go. All of our experiences have been overwhelmingly positive, and the speed bumps we did encounter were never showstoppers. As a result of adopting Kotlin, both we at Instil and our partners are delivering projects faster, and we see developers having a more positive experience on the JVM.</p>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/09/InstilRebelConWorkshop.jpg",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2019/09/instil-kotlin-happiness/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=7422",
        link: "https://blog.jetbrains.com/kotlin/2019/10/kotlinconf-2019-global-join-in/",
        title: "KotlinConf 2019 Global: Join In!",
        date: 2019-10-22T14:43:42Z,
        summary: Some(
            "2019 has been amazing for the Kotlin community with developments like the language of choice on Android, a wave of Kotlin/Everywhere events, Breakout Project of the Year at OSCON ’19… and the year is not over yet. Today we reveal … Continue reading →",
        ),
        content: Some(
            "<p>2019 has been amazing for the Kotlin community with developments like the language of choice on Android, a wave of Kotlin/Everywhere events, Breakout Project of the Year at OSCON ’19… and the year is not over yet.</p>\n<p>Today we reveal one more wonderful opportunity for Kotlin lovers: get together for KotlinConf 2019 Global with your local user group!</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/10/KC19_Global_badge_Blogpost.png\" alt=\"KC19_Global_badge_Blogpost\" width=\"2560\" height=\"1600\"></p>\n<p>Organize a meetup for your community to watch the KotlinConf 2019 keynote and other sessions together, and JetBrains will support your community. If you’re not an organizer, keep an eye on future blog posts and follow @kotlinconf on Twitter, where we will share a global map of the upcoming events.</p>\n<h2>Submit your Event</h2>\n<p>To host KotlinConf 2019 Global, please complete and send us the form below. Every community, be it KUG, GDG, AWSUG, or any other, is welcome to join in. You can request support for the events happening between December 5, 2019 and March 5, 2020 the events should be submitted until January 5, 2020.</p>\n<p>Before you submit an event, please make sure to announce it on your website or any other suitable platform.</p>\n<h3><a href=\"https://surveys.jetbrains.com/s3/kotlin-conf-submission-form\" rel=\"noopener noreferrer\">Submit an event</a></h3>\n<h2>KotlinConf 2019 Live Stream</h2>\n<p>We will kick off the KotlinConf live stream on December 5, at 8 am GMT, with an opening keynote by Andrey Breslav, and will continue streaming all tracks over the two conference days. Feel free to join the live stream at any point or access the video recordings later.</p>\n<p>The keynote and session recordings should be available within the next two weeks following the conference. Follow @kotlinсonf for the latest information.</p>\n<h2>KotlinConf Global Branding</h2>\n<p>To announce your event, use the branding materials provided. Please do not use Kotlin or JetBrains branding. The name of the event should include “KotlinConf 2019 Global” and the name of the event location. You can edit the materials according to your event location and date.</p>\n<h3><a href=\"https://drive.google.com/drive/folders/1DVOrkv5x7ZCfQfZHT2HG2rf4WLReMUVx?usp=sharing\" rel=\"noopener noreferrer\">Branding materials</a></h3>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/10/KC19_Global_badge_Blogpost.png",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2019/10/kotlinconf-2019-global-join-in/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=7498",
        link: "https://blog.jetbrains.com/kotlin/2019/11/kotlinconf-2019-live-join-the-broadcast-attend-the-qa/",
        title: "KotlinConf 2019 Live: Join the Broadcast, Attend the Q&A!",
        date: 2019-11-12T08:28:40Z,
        summary: Some(
            "It’s turning into a nice tradition to broadcast KotlinConf. This year the community will have full access to the conference via the KotlinConf 2019 Live broadcast. We will be covering four of the presentation tracks scheduled for the conference, and … Continue reading →",
        ),
        content: Some(
            "<p>It’s turning into a nice tradition to broadcast KotlinConf. This year the community will have full access to the conference via the KotlinConf 2019 Live broadcast.</p>\n<p>We will be covering four of the presentation tracks scheduled for the conference, and the icing on the cake is that there will be some special content that’s only available online through KotlinConf 2019 Live! Tune in to watch 12 insightful interviews with the speakers over both conference days, moderated by Huyen Tue Dao, also a speaker at KotlinConf and the host of “Android Dialogs”.</p>\n<p><a href=\"https://kotlinconf.com/\" rel=\"noopener noreferrer\"><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/11/stream_banners_1200x628.png\" alt=\"stream_banners_1200x628\" width=\"1200\" height=\"628\"></a><br>\nWe will begin our broadcast with the Keynote by Andrey Breslav, then continue with two full days of talks, and finish with a closing panel. During the panel, speakers and the Kotlin development team will answer questions raised from the community. Don’t miss the discussion – post your questions on Twitter with the <strong><a href=\"https://twitter.com/search?q=%23kc19ask&amp;src=typeahead_click\" rel=\"noopener noreferrer\">#kc19ask</a></strong> hashtag, and then tune into the Closing Panel live stream to get the answers.</p>\n<p>There is also another cool opportunity to watch KotlinConf 2019 together with your community. Host a <strong>KotlinConf 2019 Global</strong> meetup and get support from JetBrains! <a href=\"https://blog.jetbrains.com/kotlin/2019/10/kotlinconf-2019-global-join-in/\" rel=\"noopener noreferrer\">Learn more about these events in our blog post</a> and submit your own event for support.</p>\n<h2>What, when, and how</h2>\n<p>The broadcast will begin on December 5, at 8 AM GMT, with the Keynote delivered by Kotlin development team lead Andrey Breslav. After the keynote, you can tune in to one of 4 streams of the talks <a href=\"https://kotlinconf.com/talks/5-dec\" rel=\"noopener noreferrer\">scheduled at the conference website</a> (the “Hands-on Labs” track will not be broadcast). The schedule of 12 interviews with speakers, hosted by Huyen Tue Dao, will be announced soon, so please follow us on Twitter <strong><a href=\"https://twitter.com/kotlinconf\" rel=\"noopener noreferrer\">@kotlinconf</a></strong> for the latest updates. The closing panel broadcast will begin on December 6, at 4:15 PM GMT.</p>\n<p>Join the broadcast on the <a href=\"https://kotlinconf.com/\" rel=\"noopener noreferrer\">kotlinconf.com</a> home page at any time. <a href=\"https://kotlinconf.com/registration/\" rel=\"noopener noreferrer\">Sign up for reminders</a> to make sure you don’t miss the keynote or the closing panel. We will remind you 24 hours prior to the keynote, and again once we are live.</p>\n<p>If you cannot attend the broadcast of a talk or cannot choose among the four tracks, don’t worry – all the talks will be recorded and linked to from the KotlinConf website. We will also email you as soon as the videos are available.</p>\n<p>Enjoy KotlinConf 2019!</p>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/11/stream_banners_1200x628.png",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2019/11/kotlinconf-2019-live-join-the-broadcast-attend-the-qa/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=7440",
        link: "https://blog.jetbrains.com/kotlin/2019/11/kotlin-1-3-60-released/",
        title: "Kotlin 1.3.60 Released",
        date: 2019-11-18T16:45:58Z,
        summary: Some(
            "We’re happy to present the new release today, Kotlin 1.3.60. In addition to the quality improvements, this version focuses on: Optimizing the comparison of inline classes. Tooling improvements for debugging, J2K converter, and Gradle scripts written in Kotlin. Support for … Continue reading →",
        ),
        content: Some(
            "<p>We’re happy to present the new release today, Kotlin 1.3.60. In addition to the quality improvements, this version focuses on:</p>\n<ul>\n<li>Optimizing the comparison of <code>inline</code> classes.</li>\n<li>Tooling improvements for debugging, J2K converter, and Gradle scripts written in Kotlin.</li>\n<li>Support for more Kotlin/Native platforms/targets.</li>\n<li>Improving the Kotlin/MPP IDE experience.</li>\n<li>For Kotlin/JS, adding support for source maps and improving the platform test runner integration.</li>\n<li>Preview for some already implemented features of Kotlin 1.4.</li>\n</ul>\n<p>You can find the complete list of changes in the <a href=\"https://github.com/JetBrains/kotlin/blob/1.3.60/ChangeLog.md\" rel=\"noopener noreferrer\">change log</a>. As always, we’re really grateful to our <a href=\"https://blog.jetbrains.com/kotlin/2019/11/kotlin-1-3-60-released/#external-contributions\" rel=\"noopener noreferrer\">external contributors</a>.</p>\n<p>Let’s dive into the details!</p>\n<h2>Language changes</h2>\n<p>An incremental release doesn’t bring any language changes other than minor improvements (like changing confusing error messages) or updates for experimental features (like <code>inline</code> classes). To take a sneak peek at what is coming in Kotlin 1.4, read the <a href=\"https://blog.jetbrains.com/kotlin/2019/11/kotlin-1-3-60-released/#upcoming-in-14\" rel=\"noopener noreferrer\">corresponding section below</a>.</p>\n<p><span></span></p>\n<h3>Improvements for inline classes</h3>\n<p>The equality comparison of two instances of <code>inline</code> classes caused unnecessary boxing of their underlying values. Starting with v1.3.60, value comparisons are optimized:</p>\n<pre>inline class MyClass(val value: Int) {\n  // Generated by the compiler:\n  // public static final boolean equals-impl0(int p1, int p2) {\n  //   return p1 == p2;\n  // }\n}\nfun main() {\n  val first = MyClass(1)\n  val second = MyClass(1)\n  println(first == second)\n  // Called under the hood:\n  // MyClass.equals-impl0(first, second)\n}\n</pre>\n<p>In the bytecode, a special static method <code>equals-impl0</code> which compares the underlying values is generated for each <code>inline</code> class. When you use the equality comparison on unboxed instances, it’s called under the hood to avoid extra boxing.</p>\n<p>Note that for now, it’s not possible to override <code>equals/hashCode</code> for inline classes. The generated <code>equals-impl0</code> method simply compares the values. In the future versions, when the custom <code>equals</code> for inline classes is supported, the same <code>equals-imp0</code> method is intended to be used under the hood.</p>\n<p>Note that for compatibility reasons, this optimization will work for the <code>kotlin.Result</code> class starting with Kotlin 1.4 only.</p>\n<h3>Improved error messages</h3>\n<p>In rare situations, when you read a compiler error message, it’s not obvious why the error occurs. We try to fix this and to improve any error messages that might cause confusion.</p>\n<p>Kotlin supports the trailing lambda convention: the lambda can be moved out of the parentheses. Such a lambda can also begin on the following line. This convention causes confusion sometimes when the compiler assumes that the curly braces on the next line should be the lambda argument of the function, but they’re not:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/11/danglingLambdas1.png\" alt=\"\" width=\"600\"></p>\n<p>Now the error message for such cases has been improved, and you can automatically apply an easy fix: insert a semicolon at the end of the preceding line. (Yes, a semicolon is sometimes necessary in Kotlin!)</p>\n<p>Another case worth highlighting is trying to make a mutable variable lazy. A <code>lazy</code> variable is by design read-only, but this might cause confusion. Now the error message is improved and an automatic quick-fix is available:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/11/diagnosticsLazy.png\" alt=\"\" width=\"600\"></p>\n<p>If you have other use-cases in mind that seem confusing or if you’re missing some useful quick-fixes, please log such requests in our <a href=\"http://kotl.in/issue\" rel=\"noopener noreferrer\">issue tracker</a>.</p>\n<h2>IntelliJ IDEA support</h2>\n<h3>Scratches and Worksheets</h3>\n<p>We’ve redesigned and improved <a href=\"https://kotlinlang.org/docs/tutorials/quick-run.html\" rel=\"noopener noreferrer\">Scratch files</a>, which let you perform small experiments with your codebase. Now it’s easier to see the results, which are shown in a different window. The multiline output is wrapped, and the output for the given line is highlighted:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2022/11/Scratches.png\" alt=\"\" width=\"600\"></p>\n<p>Sometimes, however, scratch files don’t play well. There are situations where you would prefer to use a sandbox that’s part of the project, rather than to be defined outside of the project. This can be especially useful for educational purposes, creating demo projects, or during presentations. For all such use-cases, please welcome the brand new Kotlin Worksheets:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2022/11/worksheets.png\" alt=\"\" width=\"600\"></p>\n<p>Kotlin Worksheets are conceptually and technically very similar to Scratch files: you can play with your codebase and see the results right away. The major difference between the two is that Worksheets are a part of the project, which means they can be stored in a VCS and shared, while Scratches are intended to be used outside of a project.</p>\n<h3>build.gradle.kts</h3>\n<p>We’re working on enhancing your user experience with Kotlin Gradle build scripts. We already have completion and highlighting performance improvements, and we will continue working closely with Gradle to improve it further.</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/11/gradleKts.png\" alt=\"\" width=\"600\"></p>\n<h3>Debugging improvements</h3>\n<p>You can now set <a href=\"https://www.jetbrains.com/help/idea/using-breakpoints.html#method_breakpoint\" rel=\"noopener noreferrer\">function breakpoints</a> in the Kotlin code. The debugger will then stop execution on entering or exiting the corresponding function. You can also set an additional entry condition if needed:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/11/functionBreakpoints.png\" alt=\"\" width=\"500\"></p>\n<h3>Completion and imports improvements</h3>\n<p>Several known bugs have been fixed, like completion for cases when the package name matches the local variable name:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/11/packageNames1.png\" alt=\"\" width=\"600\"></p>\n<p>Now if you define a typealias for enum, its members are now correctly shown in completion:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/11/completionEnums1.png\" alt=\"\" width=\"600\"></p>\n<p>If you use an operator function like <code>invoke</code> via the concise operator syntax, IntelliJ IDEA will suggest importing it automatically:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2022/11/operatorImport1.png\" alt=\"\" width=\"500\"></p>\n<h3>New Java-to-Kotlin converter</h3>\n<p>We’ve done some good work on the new Java-to-Kotlin converter. Many corner-case issues have been fixed, such as conversion for static imports and proper analysis of usages of a collection, should a collection become mutable or read-only after the conversion, even if this collection itself is a generic argument.</p>\n<p>Now, when you convert several files at once, they are analyzed together and the usages from the other files affect the final result. For example, if you pass <code>null</code> as a <code>String</code> argument to a <code>foo</code> function in Java, after converting a function and its usage together, the converted Kotlin function will take a nullable <code>String?</code> as an argument:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/11/j2k1.png\" alt=\"\" width=\"600\"></p>\n<p>Note that the new converter is now used by default.</p>\n<h2>Eclipse IDE plugin update</h2>\n<p>We are happy to announce that the kotlin-eclipse plugin now supports experimentally incremental compilation for single modules. To try it, select the “incremental compilation” checkbox in the <code>Kotlin | Building</code> section of Eclipse properties. It’s still an experimental feature, so we will be happy to hear any feedback you may have!</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2022/11/EclipseScreenshot.png\" alt=\"EclipseScreenshot\" width=\"600\"></p>\n<h2>Kotlin/Multiplatform</h2>\n<p>We’ve devoted a lot of focus to MPP tooling, so if anything didn’t quite work the way you expected in the past, please give it another try!</p>\n<p>While future release(s) may bring new <em>superpowers</em> to the multiplatform side of Kotlin, this one comes with a <strong>lot</strong> of improvements/fixes to the usability within the IDE. In particular, we’ve significantly enhanced some “create <code>expect</code>” quick-fixes.</p>\n<h2>Kotlin/Native</h2>\n<p>The Kotlin/Native compiler has acquired a few new capabilities:</p>\n<ul>\n<li>Compatibility with the latest tooling bits: <a href=\"https://developer.apple.com/documentation/xcode_release_notes/xcode_11_release_notes\" rel=\"noopener noreferrer\"><strong>XCode 11</strong></a> and <a href=\"https://releases.llvm.org/8.0.0/docs/ReleaseNotes.html\" rel=\"noopener noreferrer\"><strong>LLVM 8.0</strong></a>.<p></p>\n</li>\n<li>\n<p>A plethora of <a href=\"https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#using-kotlinnative-targets\" rel=\"noopener noreferrer\">new platforms/targets</a>:</p>\n<ul>\n<li><em>watchOS</em><br>\n<code>watchos_x86</code><br>\n<code>watchos_arm64</code><br>\n<code>watchos_arm32</code><p></p>\n</li>\n<li>\n<p><em>tvOS</em><br>\n<code>tvos_x64</code><br>\n<code>tvos_arm64</code></p>\n</li>\n<li>\n<p><em>Android (native)</em><br>\n<code>android_x86</code><br>\n<code>android_x64</code></p>\n</li>\n</ul>\n</li>\n<li>\n<p>Experimental <a href=\"https://github.com/JetBrains/kotlin-native/blob/master/IOS_SYMBOLICATION.md\" rel=\"noopener noreferrer\">symbolication</a> of iOS crash reports for release binaries (including LLVM-inlined code, which is one step further than what XCode is able to decode).</p>\n</li>\n<li>\n<p>Thread-safe tracking of Objective-C weak/shared references to Kotlin objects.</p>\n</li>\n<li>\n<p>Support for <code>suspend</code> <a href=\"https://kotlinlang.org/docs/reference/reflection.html#callable-references\" rel=\"noopener noreferrer\">callable references</a>.</p>\n</li>\n<li>\n<p>Functions with “big arity” (on par with the <a href=\"https://github.com/Kotlin/KEEP/blob/71f3e9d1a74801857274ab304dd102a5dee0585b/proposals/functional-types-with-big-arity-on-jvm.md#motivation\" rel=\"noopener noreferrer\">JVM limit</a>)</p>\n</li>\n<li>\n<p>The ability to associate a <a href=\"https://github.com/JetBrains/kotlin-native/blob/b8df05ed495964b4ffcc08511ec47e7cb998bc88/runtime/src/main/kotlin/kotlin/native/concurrent/Worker.kt#L44-L50\" rel=\"noopener noreferrer\">work queue</a> with any context/thread, not just the ones created ad\u{2060}-\u{2060}hoc through <a href=\"https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native.concurrent/-worker/start.html\" rel=\"noopener noreferrer\"><code>Worker.start</code></a>.</p>\n</li>\n</ul>\n<h3>Generic Kotlin/Multiplatform command-line parser</h3>\n<p>Some of you may have noticed that the <a href=\"https://github.com/Kotlin/kotlinx.cli\" rel=\"noopener noreferrer\"><code>kotlinx.cli</code></a> project has been dormant for a few months. We’re happy to share that the project’s code has been (mostly) rewritten, and it’s also included in this release of the Kotlin/Native compiler.</p>\n<p>We appreciate feedback from early adopters! You can check out how it’s used in some samples (<a href=\"https://github.com/JetBrains/kotlin-native/blob/3b81f1202050167d803abf300642262a3d6c5e14/samples/tetris/src/tetrisMain/kotlin/main.kt#L10\" rel=\"noopener noreferrer\">tetris game</a>, <a href=\"https://github.com/JetBrains/kotlin-native/blob/3b81f1202050167d803abf300642262a3d6c5e14/samples/csvparser/src/csvParserMain/kotlin/CsvParser.kt#L33\" rel=\"noopener noreferrer\">CSV parser</a>, <a href=\"https://github.com/JetBrains/kotlin-native/blob/3b81f1202050167d803abf300642262a3d6c5e14/samples/videoplayer/src/videoPlayerMain/kotlin/VideoPlayer.kt#L159\" rel=\"noopener noreferrer\">\u{200d}video player</a>), and even <a href=\"https://github.com/JetBrains/kotlin-native/blob/85a812064b136557f3dc45a989af1f362cc6301e/tools/benchmarksAnalyzer/src/main/kotlin/main.kt#L131\" rel=\"noopener noreferrer\">internally</a>.</p>\n<h3>Performance</h3>\n<p>Even though the Kotlin/Native compiler is yet to be deeply optimized for performance, this release brings a few improvements that result in some impressive speedups.</p>\n<p>The compilation speed, especially for large projects, has been increased by producing native libraries directly from klibs (instead of sources).</p>\n<p>The runtime performance has also been improved: interface calls are now up to <strong>5x</strong> faster, and type checks up to <strong>50x</strong> faster!</p>\n<h3>Fixes</h3>\n<ul>\n<li>\n<dl>\n<dt>\n<h4>Missing debug information for inlined code</h4>\n</dt>\n<dd>\nSome inlining optimizations were forgetting to update the mapping between source line numbers and binary code location, which resulted in misbehaving breakpoints that would “overshoot their destination”.\n</dd>\n<dd>We’ve taught them to be more diligent, and now breakpoints work as expected.</dd>\n</dl>\n</li>\n<li>\n<dl>\n<dt>\n<h4>Passing <code>null</code> to variadic arguments</h4>\n</dt>\n<dd>\nWhenever <code>null</code> was passed as an argument to a function with <code>vararg</code> arguments, such as:<p></p>\n<pre>   platform.posix.printf(\"%p\", null)\n   </pre>\n<p>…the compiler wasn’t exactly sure what type to assign to it, and would protest by crashing!\n</p></dd>\n<dd>Heeding this, now we treat those values as <a href=\"https://kotlinlang.org/api/latest/jvm/stdlib/kotlinx.cinterop/-c-opaque-pointer.html\" rel=\"noopener noreferrer\"><code>COpaquePointer</code></a>: the untyped/void pointer, equivalent to <code>void *</code> in C.</dd>\n</dl>\n</li>\n<li>\n<dl>\n<dt>\n<h4>Unboxing negative values on iOS/macOS</h4>\n</dt>\n<dd>\nSometimes, handling negative bytes would result in a <a href=\"https://github.com/JetBrains/kotlin-native/pull/3290\" rel=\"noopener noreferrer\">nasty crash</a>; it turned out to be an LLVM bug, for which we have suggested a manual <a href=\"https://github.com/JetBrains/kotlin-native/issues/3290#issuecomment-526137528\" rel=\"noopener noreferrer\">workaround</a>.\n</dd>\n<dd>Starting from this release, the workaround will be applied automatically by the compiler.</dd>\n</dl>\n</li>\n</ul>\n<h2>Kotlin/JS</h2>\n<p>In the world of Kotlin/JS, new changes are landing that focus on your quality of life and simplifying working with the new <code>org.jetbrains.kotlin.js</code> plugin, most notably support for source maps and improvements for test runners.</p>\n<h3>Source maps</h3>\n<p>With Kotlin 1.3.60, source maps are generated automatically for your code that targets JavaScript through the <code>org.jetbrains.kotlin.js</code> Gradle plugin. This makes it a lot more comfortable to debug your own code, as it provides readable stack traces when you run into an error, and equips you with the superpowers provided by the developer tools in the case of targeting the browser – with support for breakpoints, code annotations, information about the local scope, and more. They also simplify working with tests for the JS target, as we will see in the next section.</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2022/11/source-maps.png\" alt=\"source-maps\"></p>\n<h3>Test runner improvements</h3>\n<p>When running your tests on the JS platform, the standard output generated by your tests on the regular channels (ie. <code>log</code>, <code>warn</code>, <code>error</code>) is included in the generated Gradle reports. This functionality is available for the Node.js and browser targets. Integration with source maps makes the stack traces of your tests readable and easy to relate to your code – with file names and line numbers pointing directly to your Kotlin sources:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2022/11/test-runner.png\" alt=\"test-runner\" width=\"600\"></p>\n<p>Test filtering support for the JS target means that tests can be run selectively instead of having to execute all tasks at once. You can use this functionality via the Gradle command line interface through the <code>--tests</code> flag:</p>\n<pre>./gradlew browserTest --tests AppTest.testOperationExecution\n</pre>\n<p>Alternatively, you can use the gutter icons in IntelliJ IDEA to run individual tests or tests from a specific set:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2022/11/gutter-icons.png\" alt=\"gutter-icons\" width=\"600\"></p>\n<h2>Upcoming changes in Kotlin 1.4</h2>\n<p>Kotlin 1.4 is planned to be released some time in 2020. However, you can already try some implemented features by specifying the corresponding language version:</p>\n<pre>compileKotlin {\n    kotlinOptions {\n        languageVersion = \"1.4\"\n    }\n}\n</pre>\n<p>Note that so far Kotlin 1.4 is available in the <em>experimental</em> state.</p>\n<h3>NPE assertions</h3>\n<p>By also setting the <code>apiVersion</code> to <code>1.4</code>, you can observe the changed behavior with null-check optimizations described <a href=\"https://blog.jetbrains.com/kotlin/2019/08/kotlin-1-3-50-released/#npe-optimizations\" rel=\"noopener noreferrer\">earlier</a>. The following code now throws a <code>NullPointerException</code> instead of an <code>IllegalStateException</code> with the old message <code>\"JavaCode.getNull() must not be null\"</code>:</p>\n<pre>fun main() {\n    duplicate(JavaCode.getNull())  // 1\n}\n\nfun duplicate(s: String) = s + s\n</pre>\n<pre>public class JavaCode {\n    public static String getNull() { return null; }\n}\n</pre>\n<h3>Break &amp; continue inside <code>when</code></h3>\n<p>One of the language changes in Kotlin 1.4 is allowing <code>break</code> and <code>continue</code> inside <code>when</code>. Currently, <code>break</code> and <code>continue</code> expressions without labels are forbidden because these keywords were reserved to possibly be used for fall-through in <code>when</code>. However, using labels turned out to be rather cumbersome, so <code>break</code> and <code>continue</code> get their expected meaning inside outer loops:</p>\n<pre>fun foo(list: List&lt;Int&gt;) {\n    for (i in list) {\n        when (i) {\n            42 -&gt; continue\n            else -&gt; println(i)\n        }\n    }\n}\n</pre>\n<p>The fall-through behavior inside <code>when</code> is subject to further design.</p>\n<h3>Changes for tail-recursive functions</h3>\n<p>We’re going to fix some “corner-case” behavioral peculiarities for tail-recursive functions.</p>\n<h4>Initialization order of default values</h4>\n<p>The change is only noticeable if your tail-recursive function defines default values <em>with side effects</em>. In Kotlin 1.3, the initialization order of default values inside the <code>tailrec</code> function is wrong: the default values are initialized from the last one to the first one, even though they should be initialized vice versa, from the first one to the last one, as it works for regular functions.</p>\n<p>The change is apparent with the following example:</p>\n<pre>var counter = 0\nfun inc() = counter++\n\ntailrec fun test(i: Int, x: Int = inc(), y: Int = inc()) {\n    println(\"x: $x, y: $y\")\n    if (i &gt; 0) test(i - 1)\n}\n\nfun main() {\n    test(1)\n}\n</pre>\n<p>The output in Kotlin 1.3 is:</p>\n<pre>x: 0, y: 1\nx: 3, y: 2\n</pre>\n<p>In Kotlin 1.4, the output is:</p>\n<pre>x: 0, y: 1\nx: 2, y: 3\n</pre>\n<p>We expect that such cases should very rarely occur in practice. (But if for some reason you use this complicated combination of language features, please take note of this upcoming change.)</p>\n<h4>Prohibiting <code>open</code> <code>tailrec</code> functions</h4>\n<p>In Kotlin 1.3, combining <code>open</code> and <code>tailrec</code> modifiers is a warning, in Kotlin 1.4 it becomes an error. Note that it’s a “breaking change”: code that used to work doesn’t work anymore, but we don’t expect this case to ever be used in practice.</p>\n<p>It’s unclear whether an <code>open</code> tail-recursive function is supposed to behave as a tail-recursive or as an <code>open</code> function primarily. In Kotlin 1.3, the <code>open</code> modifier is “ignored” but that leads to some confusing behavior:</p>\n<pre>open class A {\n    open tailrec fun foo(count: Int) { // Note: open &amp; tailrec modifiers\n        println(\"A.foo($count)\")\n        if (count &gt; 0) foo(count - 1)\n    }\n}\n\nclass B : A() {\n    override fun foo(count: Int) {\n        println(\"B.foo($count)\")\n    }\n\n    fun callSuperFoo(count: Int) = super.foo(count)\n}\n\nfun main() {\n    B().callSuperFoo(3)\n}\n</pre>\n<p>The output of this code is:</p>\n<pre>A.foo(3)\nA.foo(2)\nA.foo(1)\nA.foo(0)\n</pre>\n<p>The <code>foo</code> function behaves as expected for a tail-recursive function: it calls itself and this call is optimized under the hood.</p>\n<p>If we remove the <code>tailrec</code> modifier from the <code>foo</code> function in <code>A</code>, then the output becomes:</p>\n<pre>A.foo(3)\nB.foo(2)\n</pre>\n<p>Now the <code>foo</code> function behaves as expected for an <code>open</code> function: at first, <code>super.foo(count)</code> calls explicitly a function from the parent <code>A</code> class. Then <code>foo(count - 1)</code> is a virtual call that calls a function from the <code>B</code> subclass.</p>\n<p>Because such behavior is confusing, Kotlin 1.4 prohibits using <code>open</code> and <code>tailrec</code> at the same time.</p>\n<h2>How to update</h2>\n<p>As always, you can <strong>try Kotlin online</strong> at <a href=\"http://play.kotl.in/\" rel=\"noopener noreferrer\">play.kotl.in</a>.</p>\n<ul>\n<li><strong>In Maven, Gradle, and npm</strong>: Use <code>1.3.60</code> as the version for the compiler and the standard library. See the docs <a href=\"http://kotlinlang.org/docs/reference/using-gradle.html\" rel=\"noopener noreferrer\">here</a>.</li>\n<li><strong>In IntelliJ IDEA</strong> and <strong>Android Studio</strong>: Update the Kotlin plugin to version 1.3.60. Use <em>Tools | Kotlin | Configure Kotlin Plugin Updates</em> and click the “Check for updates now” button.</li>\n<li><strong>In Eclipse</strong>: Install the plugin using the <a href=\"https://marketplace.eclipse.org/content/kotlin-plugin-eclipse\" rel=\"noopener noreferrer\">Marketplace</a>.</li>\n<li><strong>The command-line compiler</strong> can be downloaded from the <a href=\"https://github.com/JetBrains/kotlin/releases/tag/v1.3.60\" rel=\"noopener noreferrer\">Github release page</a>.</li>\n</ul>\n<p>If you run into any problems with the new release, you’re welcome to ask for help on the <a href=\"https://discuss.kotlinlang.org/\" rel=\"noopener noreferrer\">forums</a> on Slack (get an invite <a href=\"http://slack.kotlinlang.org/\" rel=\"noopener noreferrer\">here</a>), or to report issues in the <a href=\"https://youtrack.jetbrains.com/issues/KT\" rel=\"noopener noreferrer\">issue tracker</a>.</p>\n<p>Let’s Kotlin!</p>\n<h2>External Contributions</h2>\n<p>We want to especially thank <a href=\"https://github.com/sfs\" rel=\"noopener noreferrer\">Steven Schäfer</a> for implementing the <a href=\"https://blog.jetbrains.com/kotlin/2019/11/kotlin-1-3-60-released/#inline-classes\" rel=\"noopener noreferrer\">equality comparison optimization for <code>inline</code> classes</a>.</p>\n<p>We’d like to thank all our external contributors whose pull requests were included in this release:</p>\n<ul>\n<li><a href=\"https://github.com/t-kameyama\" rel=\"noopener noreferrer\">Toshiaki Kameyama</a></li>\n<li><a href=\"https://github.com/gavra0\" rel=\"noopener noreferrer\">Ivan Gavrilovic</a></li>\n<li><a href=\"https://github.com/madsager\" rel=\"noopener noreferrer\">Mads Ager</a></li>\n<li><a href=\"https://github.com/punzki\" rel=\"noopener noreferrer\">Mark Punzalan</a></li>\n<li><a href=\"https://github.com/pyos\" rel=\"noopener noreferrer\">pyos</a></li>\n<li>Jake Wharton</li>\n<li>Yanis Batura</li>\n<li>Kristoffer Andersen</li>\n<li>Sebastian Schuberth</li>\n<li>Kevin Bierhoff</li>\n<li>scache</li>\n<li>keijumt</li>\n<li>Louis CAD</li>\n<li>Matthew Gharrity</li>\n<li>Jim Sproch</li>\n<li>Jim S</li>\n<li>Dereck Bridie</li>\n<li>Sascha Peilicke</li>\n<li>SatoShun</li>\n<li>Dat Trieu</li>\n<li>Burak Eregar</li>\n<li>Ty Smith</li>\n<li>Vladimir Krivosheev</li>\n<li>Alex Chmyr</li>\n</ul>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/11/danglingLambdas1.png",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2019/11/kotlin-1-3-60-released/#comments",
        ),
    },
    Post {
        id: -1,
        unique_id: "http://blog.jetbrains.com/kotlin/?p=7623",
        link: "https://blog.jetbrains.com/kotlin/2019/12/what-to-expect-in-kotlin-1-4-and-beyond/",
        title: "What to Expect in Kotlin 1.4 and Beyond",
        date: 2019-12-05T22:45:37Z,
        summary: Some(
            "During the keynote at KotlinConf, Andrey highlighted our strategic view on the current areas of focus for the evolution of Kotlin, and our plans for Kotlin 1.4 which will be released some time next year. Watch the entire keynote below … Continue reading →",
        ),
        content: Some(
            "<p>During the keynote at KotlinConf, Andrey highlighted our strategic view on the current areas of focus for the evolution of Kotlin, and our plans for Kotlin 1.4 which will be released some time next year.</p>\n<p>Watch the entire keynote below</p>\n<p></p>\n<p>Our vision is for Kotlin to be a reliable companion for all your endeavors, a default language choice for your tasks. To accomplish this, we’re going to make it shine on all platforms. Multiple case studies from companies well-known in the industry show that we are making good progress in this direction.</p>\n<p>Kotlin 1.4 that is going to arrive in spring 2020 will make another step forward for the Kotlin ecosystem.</p>\n<h2>Focusing on quality</h2>\n<p>Most of all, Kotlin 1.4 will focus on quality and performance. Kotlin is a modern language that already pioneers many ideas and approaches. We’re going to keep it modern and always evolving. At the moment, however, we believe that Kotlin has reached the stage where improving the overall experience is more important than adding big features. This is why Kotlin 1.4 will deliver only a few small language changes, which are explained in detail <a href=\"https://blog.jetbrains.com/kotlin/2019/12/what-to-expect-in-kotlin-1-4-and-beyond/#language-features\" rel=\"noopener noreferrer\">below</a>.</p>\n<p><span></span></p>\n<p>We’ve already managed to achieve some impressive results in boosting the performance of IDEs that support Kotlin. The code completion speed has increased substantially compared to previous versions:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/12/completion.png\" alt=\"\" width=\"600\"></p>\n<p>Together with the Gradle team, we’ve made Gradle scripts faster. Kotlin 1.3.60, Gradle Import in Android Studio is about 2.5 times as fast and takes about 75% less memory than it did in Kotlin 1.3.10:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/12/Memory2.png\" alt=\"Memory\" width=\"1309\" height=\"384\"></p>\n<p>What’s more, loading <code>build.gradle.kts</code> entails almost zero CPU usage! Also, compiling Kotlin/Native in dev mode is becoming up to 2 times as fast with code caching.</p>\n<p>We understand that build speed is often the biggest concern for our users, and we are constantly improving our toolchain to address that. But incremental improvements cannot keep up with the natural growth of production codebases: while we make compilation faster, users write more code, and the overall build time doesn’t improve enough. It’s become clear that we need to reimplement the compiler to make it really fast.</p>\n<h2>New compiler</h2>\n<p>The goal for the new compiler implementation is to be really fast, unify all the platforms Kotlin supports, and provide an API for compiler extensions. This is going to be a multi-year effort, but we started a while ago, so some parts of this new implementation are going to arrive in 1.4, and the transition will be very gradual. It’s happening already; for instance, if you’ve tried <a href=\"https://blog.jetbrains.com/kotlin/2019/06/kotlin-1-3-40-released/#new-type-inference\" rel=\"noopener noreferrer\">the new algorithm for type inference</a>, that’s a part of the new compiler. The approach for other parts will be the same; that is, both versions will be available for some time, the old one and the new one in an experimental mode; and when the new one becomes stable, it will become the default.</p>\n<h3>Speed-up with the new front-end</h3>\n<p>The bulk of the speed-up we expect from the new compiler will come through a new front-end implementation.</p>\n<p>To provide a little background, compilation can be thought of as a pipeline that takes source files and turns them into executable code step by step. The first big step in this pipeline is colloquially referred to as the front-end of the compiler. It parses the code, resolves names, performs type checking, etc. This part of the compiler also works inside the IDE when it highlights errors, navigates to definitions, and searches for symbol usages in your project. And this is the step where <code>kotlinc</code> spends the most time nowadays, so we want to make it much faster.</p>\n<p>The current implementation is not complete yet, and it will not arrive in 1.4. However, it already does most of the time-consuming work, and we can measure the expected speed-up. Our benchmarks (compiling YouTrack and the Kotlin compiler itself) show that the new front-end will be about 4.5 times as fast as the existing one.</p>\n<h3>Unified back-ends and extensibility</h3>\n<p>After the front-end is done analyzing the code, a back-end generates the executables. We have three back-ends: Kotlin/JVM, Kotlin/JS, and Kotlin/Native. The first two were historically written independently and didn’t share much code. When we started Kotlin/Native, it was based on a new infrastructure built around an internal representation (IR) for Kotlin code which serves a function somewhat similar to bytecode in virtual machines. We are now migrating the other two back-ends to the same IR. As a result, we will share a lot of the back-end logic and have a unified pipeline, to allow most features, optimizations, and bugfixes to be done only once for all targets.</p>\n<p>We will gradually migrate to the new back-ends, and in 1.4 they are unlikely to be enabled by default, but users will be able to opt into using them explicitly.</p>\n<p>A common back-end infrastructure opens the door for multiplatform compiler extensions. One can plug into the pipeline and add some custom processing and/or transformations which will automatically work for all targets. In 1.4 we do not provide a public API for such extensions (the API will be stabilized later), but we are working closely with our partners, including <a href=\"https://developer.android.com/jetpack/compose\" rel=\"noopener noreferrer\">JetPack Compose</a>, who are building their compiler plugins already.</p>\n<h3>Meet KLib: Kotlin Library Format</h3>\n<p>To build a multiplatform library in Kotlin and ship it so that clients can depend on it, one needs a distribution format that works equally on any platform. This is why we’re introducing KLib: a library format for Kotlin multiplatform. A KLib file contains serialized IR. Your code may add it as a dependency, and the compiler back-end will pick it up and generate executable code for the given platform. The analogy with bytecode still holds here: one can analyze and transform KLibs much like JVM bytecode. Any transformations done to the serialized IR will affect any platform the KLib will be used for.</p>\n<p>In fact, Kotlin/Native has been using the KLibs format to distribute Kotlin native libraries for quite a while, and now we are extending the format to support other back-ends and multiplatform libraries. The format will be experimental in 1.4, and we will work on providing a stable ABI for it in future versions.</p>\n<h2>More multiplatform news</h2>\n<h3>Running iOS code in Android Studio</h3>\n<p>We are working on a plugin for Android Studio that will be able to run, test, and debug Kotlin code on iOS devices and simulators. The plugin is using proprietary code from IntelliJ, so it will be closed-source. It will not bring language support for Objective-C or Swift, and some operations such as deployment to AppStore may require running Xcode, but anything you do with Kotlin code will work from Android Studio with the new plugin installed. We expect to open a preview for this plugin in 2020.</p>\n<h3>Kotlin/Native runtime improvements</h3>\n<p>Apart from Linux, Windows, macOS, and iOS, Kotlin/Native now works on watchOS and tvOS, so virtually any device can run Kotlin. We are also working on the runtime performance of Kotlin/Native to make iOS Kotlin programs run even faster.</p>\n<h3>Core libraries</h3>\n<p>The Kotlin core libraries work on all platforms. This includes <code>kotlin-stdlib</code> which handles all the basic types and collections, <code>kotlinx.coroutines</code>, <code>kotlinx.serialization</code>, and <code>kotlinx.io</code>. The support for dates is really needed in the multiplatform world, and this is what we are working on: experimental Durations have been already added to stdlib, and DateTime support is under way.</p>\n<p>Another important addition to Kotlin libraries is <a href=\"https://kotlinlang.org/docs/reference/coroutines/flow.html\" rel=\"noopener noreferrer\">Flow</a> which is a coroutine-based implementation of Reactive Streams. Flow is great at processing streams of data, and it’s making use of the power of Kotlin in doing so. Apart from its ergonomics, Flow brings extra speed. On <a href=\"https://github.com/Kotlin/kotlinx.coroutines/blob/develop/benchmarks/src/jmh/kotlin/benchmarks/flow/scrabble/README.md\" rel=\"noopener noreferrer\">some benchmarks</a> it is almost 2 times as fast as existing popular Reactive Streams implementations.</p>\n<h3>For library authors</h3>\n<p>As creating new libraries is vital for the Kotlin ecosystem, we keep improving the experience of library authors. The new library authoring mode will help shape your code in the way that’s best for stable APIs. Also, we are going to release Dokka 1.0 to support docs generation for all platforms.</p>\n<h3>Multiplatform web</h3>\n<p>Sharing code across platforms is great for mobile, but it’s also great for Web clients: a lot can be shared with the server and/or with mobile apps. We invest more and more in the Kotlin/JS tooling, and now can do very fast development roundtrips, from changing Kotlin code to seeing results in the browser:</p>\n<p><img src=\"https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/12/RoundTrip.png\" alt=\"\"></p>\n<p>We’ve also improved JS interop so that now you’ll be able to attach an NPM dependency to a Kotlin project and any <code>.d.ts</code> type definitions will be picked up automatically by the Kotlin toolchain.</p>\n<p>The new IR-based back-end will also bring significant improvements in binary sizes. Compiled JS files can become half their current size.</p>\n<h2>New language features</h2>\n<p>Kotlin 1.4 will deliver a few new language features.</p>\n<h3>SAM conversions for Kotlin classes</h3>\n<p>The community has requested us to introduce support for SAM conversions for Kotlin classes (<a href=\"https://youtrack.jetbrains.com/issue/KT-7770\" rel=\"noopener noreferrer\">KT-7770</a>). SAM conversion applies if you pass a lambda as an argument when an interface or a class with only one single abstract method is expected as a parameter. Then the compiler automatically converts the lambda to an instance of the class implementing the abstract member function.</p>\n<p>SAM conversions currently only work for Java interfaces and abstract classes. The initial idea behind this design was to use function types explicitly for such use-cases. It turned out, however, that function types and typealiases don’t cover all the use-cases, and people often had to keep an interface in Java only to get a SAM-conversion for it.</p>\n<p>Unlike Java, Kotlin will not allow a SAM conversion for every interface with one single abstract method. We believe that an intention to make an interface applicable for SAM conversion should be explicit. Thus, to define a SAM interface, you’ll need to mark an interface with the <code>fun</code> keyword to emphasize that it can be used as a functional interface:</p>\n<pre>fun interface Action {\n    fun run()\n}\n\nfun runAction(a: Action) = a.run()\n\nfun main() {\n    runAction {\n        println(\"Hello, KotlinConf!\")\n    }\n}\n</pre>\n<p>Note that passing a lambda instead of a <code>fun interface</code> will be supported only in a new type inference algorithm.</p>\n<h3>Mixing named and positional arguments</h3>\n<p>Kotlin prohibits mixing arguments with explicit names (“named”) and regular ones without names (“positional”) unless you put named arguments only after all the positional ones. In one case, however, it’s really annoying: when all arguments stay in their correct positions and you want to specify a name for one argument in the middle. Kotlin 1.4 will fix this issue, so you will be able to write code like:</p>\n<pre>fun f(a: Int, b: Int, c: Int) {}\n\nfun main() {\n    f(1, b = 2, 3)\n}\n</pre>\n<h3>Optimized delegated properties</h3>\n<p>We’ll improve the underlying way in which the <code>lazy</code> property and some other delegated properties are compiled.</p>\n<p>Generally, a delegated property can access the corresponding <code>KProperty</code> reflection object. For instance, when using <code>Delegates.observable</code>, you can display information about the modified property:</p>\n<pre>import kotlin.properties.Delegates\n\nclass MyClass {\n    var myProp: String by Delegates.observable(\"&lt;no name&gt;\") {\n        kProperty, oldValue, newValue -&gt;\n        println(\"${kProperty.name}: $oldValue -&gt; $newValue\")\n    }\n}\n\nfun main() {\n    val user = MyClass()\n    user.myProp = \"first\"\n    user.myProp = \"second\"\n}\n</pre>\n<p>To make this possible, the Kotlin compiler generates an additional syntactic member property, an array storing all <code>KProperty</code> objects that represent delegated properties used inside the class:</p>\n<pre>&gt;&gt;&gt; javap MyClass\n\npublic final class MyClass {\n    static final kotlin.reflect.KProperty[] $$delegatedProperties;\n    ...\n}\n</pre>\n<p>Some delegated properties, however, don’t use <code>KProperty</code> in any way. For them, generating an object in <code>$$delegatedProperties</code> is suboptimal. The Kotlin 1.4 release will optimize such cases. If the delegated property operators are <code>inline</code>, and the <code>KProperty</code> parameter is not used, the corresponding reflection objects will not be generated.</p>\n<p>The most outstanding example is the <code>lazy</code> property. The implementation of <code>getValue</code> for the<code>lazy</code> property is <code>inline</code> and doesn’t use the <code>KProperty</code> parameter:</p>\n<pre>inline operator fun &lt;T&gt; Lazy&lt;T&gt;.getValue(thisRef: Any?, property: KProperty&lt;*&gt;): T = value\n</pre>\n<p>Starting with Kotlin 1.4, when you define a <code>lazy</code> property, the corresponding <code>KProperty</code> instance won’t be generated. If the only delegated properties you use in a class are <code>lazy</code> properties (and other properties that comply with this optimization), the whole <code>$$delegatedProperties</code> array won’t be generated for the class:</p>\n<pre>class MyOtherClass {\n    val lazyProp by lazy { 42 }\n}\n\n&gt;&gt;&gt; javap MyOtherClass\npublic final class MyOtherClass {\n    // no longer generated:\n    static final kotlin.reflect.KProperty[] $$delegatedProperties; \n    ...\n}\n</pre>\n<h3>Trailing Commas</h3>\n<p>This minor syntactic change turns out to be incredibly convenient! You can place an additional trailing comma after the last parameter in a parameter list. You can then swap lines or add new parameters without having to add or remove the missing commas.</p>\n<h3>Other notable changes</h3>\n<p>A useful <code>typeof</code> function introduced <a href=\"https://blog.jetbrains.com/kotlin/2019/06/kotlin-1-3-40-released/#type-of\" rel=\"noopener noreferrer\">in Kotlin 1.3.40</a> is going to become stable and supported on all platforms.</p>\n<p>The feature that lets you enable <code>break</code> and <code>continue</code> inside <code>when</code> was already described in <a href=\"https://blog.jetbrains.com/kotlin/2019/11/kotlin-1-3-60-released/#break-and-continue\" rel=\"noopener noreferrer\">the 1.3.60 release blog post</a>.</p>\n<h2>Thank you!</h2>\n<p>We’re really grateful to everyone who has tried the Kotlin EAPs and experimental features and has given us feedback. We are developing the Kotlin language together with you, and making many design decisions based on your invaluable inputs. Keeping this fast and effective feedback loop going with the community is really important to help Kotlin become the best it can be!</p>\n<p>We’re really grateful to all members of our community who are creating so many amazing things with Kotlin. Let’s continue to Kotlin together!</p>\n<p>By the way, the Kotlin plugin inside IntelliJ IDEA and Android Studio collects anonymized statistics of your usage of its functionality. We want to kindly ask you to opt into these statistics, as they help us understand what works, what is causing difficulties, and what we should focus on improving.</p>\n",
        ),
        media_type: Some(
            MediaType {
                mime: "image/*",
            },
        ),
        media_link: Some(
            "https://d3nmt5vlzunoa1.cloudfront.net/kotlin/files/2019/12/completion.png",
        ),
        comments_link: Some(
            "https://blog.jetbrains.com/kotlin/2019/12/what-to-expect-in-kotlin-1-4-and-beyond/#comments",
        ),
    },
]
