The Kotlin Blog : Kotlin Programming Language by JetBrains | The JetBrains Blog https://blog.jetbrains.com Developer Tools for Professionals and Teams Thu, 08 Jun 2023 15:12:23 +0000 en-US hourly 1 https://blog.jetbrains.com/wp-content/uploads/2023/02/cropped-icon-512-32x32.png The Kotlin Blog : Kotlin Programming Language by JetBrains | The JetBrains Blog https://blog.jetbrains.com 32 32 Join the Livestream: Launch Your Kotlin Course with New Materials for Educators! https://blog.jetbrains.com/kotlin/2023/06/livestream-launch-your-kotlin-course/ Thu, 08 Jun 2023 12:42:48 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/06/DSGN-16593-Launch-Your-Kotlin-Course_Blog-Featured-image-1280x600-1.png https://blog.jetbrains.com/?post_type=kotlin&p=362015 Are you looking to launch your own Kotlin course? We are excited to equip you with the necessary tools! Join us for a special livestream for Kotlin educators on Jun 21, 2023 at 16:00 UTC!

Join Livestream on YouTube

Or sign up to get an email reminder.

Our guest, Anastasia Birillo, is a JetBrains researcher, Kotlin developer and instructor, an active member of the Kotlin community, and one of the authors of the ‘Programming in Kotlin’ course materials. Anastasia is teaching this course at Constructor University in Bremen, Germany and Neapolis University Pafos, Cyprus. During this livestream, Anastasia will share her teaching experience and the new course materials, designed specifically for Kotlin educators and available for free. You will also have the opportunity to ask questions and get them answered during the Q&A part of the livestream.

The ‘Programming in Kotlin’ course materials include:

 Downloadable slides on the core concepts of Kotlin:

  • Introduction to Kotlin
  • Object-oriented programming
  • Build systems and testing
  • Generics
  • Containers
  • Functional programming
  • JVM + the Kotlin compiler
  • Parallel and concurrent programming
  • Asynchronous programming
  • Exceptions
  • Testing

Assessment resources for educators:

  • Quizzes
  • Homework assignments
  • Tests

The course covers core topics such as data types, variables and control flow, functions, object-oriented programming, exception handling, collections and generics, lambdas, and higher-order functions. It also covers significant features of Kotlin, including null safety, extension functions, and coroutines. At the end of the course students will study build systems, using Gradle as an example, as well as explore compilation techniques and how the Kotlin K2 compiler works.

This is a comprehensive toolkit for teaching Kotlin and it can be easily customized to align with specific educational needs. 

Join Livestream on YouTube

Or sign up to get an email reminder.

Don’t miss out on this opportunity to access these course materials and launch your very own Kotlin course. Mark your calendars and join us for the livestream!

See you there!

Anastasia Birillo

Anastasia Birillo

Anastasia Birillo is a JetBrains researcher and an experienced Kotlin developer who is heavily involved in the Kotlin community. Anastasia has authored the Kotlin Onboarding course from JetBrains and has worked on several projects related to static code analysis and code quality in education for the Hyperskill platform. As a Kotlin expert, she also teaches both basic and advanced Kotlin at Constructor University in Germany and at Neapolis University in Cyprus. Additionally, Anastasia is the main contributor to the Reflekt project, a plugin for the Kotlin compiler that enables compile-time reflection. 

LinkedIn

Twitter

]]>
Compose Multiplatform for iOS Is in Alpha https://blog.jetbrains.com/kotlin/2023/05/compose-multiplatform-for-ios-is-in-alpha/ Thu, 18 May 2023 11:41:58 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/05/compose-blog-featured-image-1280x600-1.png https://blog.jetbrains.com/?post_type=kotlin&p=356072 Compose Multiplatform, the declarative framework from JetBrains for building cross-platform user interfaces with Kotlin, is now able to target iOS! That means you can use Compose Multiplatform to build your user interface once, 100% in Kotlin, and use it on Android, iOS, and beyond.

At a glance, here’s what you need to know about this release:

  • JetBrains released Compose Multiplatform for iOS as Alpha, meaning it’s ready to be used in experiments and toy projects. Try it out, and help shape the future of shared mobile user interfaces with Kotlin!
  • Compose Multiplatform uses APIs that are already being used for UI development on Android. This makes it very easy for developers with a background in modern Android development to quickly get up and running with Compose Multiplatform for iOS. It also allows newcomers to base their learning on established concepts and best practices.
  • As an Alpha release, Compose Multiplatform for iOS still has many areas that are works in progress. We rely on the community to help inform and shape the future of shared Kotlin user interfaces, so give the technology a try and share your feedback!

Get started with Compose for iOS

JetBrains first announced Compose Multiplatform for iOS at KotlinConf 2023. For a detailed look at Compose Multiplatform for iOS in action, watch the recording of the announcement talk “Compose Multiplatform on iOS” by Sebastian Aigner and Nikita Lipsky:

Pushing Kotlin Multiplatform beyond business logic

With Kotlin Multiplatform, Kotlin developers already have a tried-and-tested approach to code sharing. It allows you to share business logic between different platforms without having to give up access to platform-specific APIs and features – an approach that has been validated by many applications in production, with more and more companies leveraging it to get rid of unnecessary duplication of logic in their applications.

But one part of the Kotlin Multiplatform story was missing: a solution for when you don’t want to build and maintain separate user interfaces for each platform you target. There are a multitude of reasons why this may be the case for you: You may lack the resources or people to provide implementations that are tailor-made for each target platform. Or you might find yourself in a situation where you need to get your application into the hands of users as fast as possible, with quick iterations, and can’t spend time manually keeping two or more UI implementations in sync.

Compose Multiplatform addresses this. It gives you the option to implement your user interface once and then share it across target platforms – whether that’s the typical mobile case of sharing between Android and iOS or includes further platforms like desktop or web.

Compose Multiplatform is an optional layer for Kotlin Multiplatform applications that allows you to build declarative user interfaces once and use them for multiple target platforms.

Built on Jetpack Compose

Compose Multiplatform builds on top of Jetpack Compose from Google, the recommended UI framework for modern Android development, which is 100% Kotlin. The team at JetBrains that develops Compose Multiplatform collaborates with Google and regularly upstreams changes to the Jetpack Compose repositories.

The APIs in Compose Multiplatform are the same ones that have already been tried and tested in Jetpack Compose. That means developers who have experience writing modern Android user interfaces using Jetpack Compose can transfer those skills directly to write a shared user interface with Compose Multiplatform, targeting iOS and beyond.

To illustrate the fact that the APIs really are the same, take a look at this example snippet of Compose Multiplatform code that animates the visibility of an image whenever the user presses a button:

If you have worked with Jetpack Compose before, most of this code should be familiar to you: Compose Multiplatform allows you to use the exact same APIs that you would use for modern Android development, including state management, layout, and even animations. For tasks that are system-specific in Jetpack Compose, like loading resources, Compose Multiplatform provides convenient alternatives that work on all platforms – like the painterResource function in the above snippet.

As you can see, this code runs on both Android and iOS, with consistent results:

On iOS, Compose Multiplatform user interfaces are rendered via a canvas implementation based on the graphics library Skiko. On Android, Compose Multiplatform is Jetpack Compose. This means that if you ever decide to move your application to platform-specific UIs, you can continue using your Compose Multiplatform application on Android without any drawbacks and without having to throw away the code you’ve written.

Built on Kotlin Multiplatform

Apps built using Compose Multiplatform are Kotlin Multiplatform applications, meaning they can use the same established mechanisms to access platform APIs such as sensors, preferences, data storage, cryptography, and others. They can also make use of the ever-growing ecosystem of Kotlin Multiplatform libraries that provide anything from database wrappers to cross-platform wrappers for SDKs. You can also, of course, continue to use Kotlin Multiplatform independently of Compose Multiplatform to share business logic, networking, and other abstractions.

Interoperability with SwiftUI and UIKit views

Real-world applications need access to device-specific capabilities, and in many cases, the UI layer is no exception: Whether it’s embedding a browser or playing back video, you may find yourself wanting to access the built-in functionality that iOS provides to enrich your users’ experience.

For these situations, the Alpha version of Compose Multiplatform comes with a prototype for two-way interoperability on the UI layer. By using UIKitView, you can embed complex platform-specific widgets like maps, web views, media players, and camera feeds within your shared user interface. In the other direction, via ComposeUIViewController, you can embed Compose Multiplatform screens in SwiftUI applications, helping you gradually adopt Compose Multiplatform in iOS applications.

Compose Multiplatform on iOS allows two-way interoperability with native user interfaces: You can embed complex UI views like MapKit’s MKMapView in your Compose UI, or embed Compose screens in a SwiftUI application.

Working on an excellent user experience

Compose Multiplatform for iOS is currently in Alpha, which also means there are a number of areas that are still works in progress. Providing an excellent user experience across multiple platforms is a subject that requires great care, and the whole team wants to make sure to address all aspects necessary to make Compose Multiplatform applications feel comfortable and natural, no matter where they are used. This starts from the most basic interactions, like gestures and scroll physics, which define the fundamental feel of an application. It extends further to navigation principles and transitions, as well as complex interactions like text selection, input management, context menus, and similar interactions.

We also recognize how important it is for Compose Multiplatform applications to provide solid accessibility integrations, as well as respect user choices, and we are committed to providing solid integrations with the underlying iOS mechanisms – integrating with everything from the system’s text-to-speech functionality to the zoom and contrast preferences that users have set on their devices.

Obviously, this is a diverse and broad set of focus areas. We want to give all of them the level of care needed to ensure Compose Multiplatform on iOS provides the best user experience possible. In doing so, we want to be sure we’re putting your needs first, and we welcome your feedback!

We’re also aware that absolutely smooth performance, even on high refresh rate displays, is a major factor in providing a great user experience. As such, the Compose Multiplatform and Kotlin/Native teams are working together closely to improve the performance of shared user interfaces on iOS.

Theming Compose Multiplatform for iOS

Because Compose Multiplatform on iOS uses canvas-based rendering, both iOS and Android applications look the same by default. Currently, Compose Multiplatform provides Material and Material 3 widgets out of the box on all platforms. These are the same widgets that you may already be familiar with from Android applications. Using the builtin theming functionality, you can adjust the look and feel of these widgets to reflect your branding, either consistently across platforms or with custom platform-specific themes.

Out of the box, mobile apps built with Compose Multiplatform currently come with Material widgets. You can customize their look and feel, build your own interface components, and even apply platform-specific theming.

Of course, a key question for a cross-platform UI framework is to which degree elements should mimic the look and feel of its target platforms. At the current stage, the JetBrains team has not yet made any decisions about providing native or common-looking UI elements. Since this is a key part of the Compose Multiplatform user experience, we don’t want to make decisions on this without first gathering feedback from the development community, and we welcome you to share your thoughts and opinions with us.

Try Compose Multiplatform for iOS yourself!

We hope you’re excited to give Compose Multiplatform for iOS a try! As we’ve discussed, there are a lot of things that are still works in progress, but there are also many that already work well and are ready for you to play around with!

We provide a number of different ways for you to get acquainted with the Alpha release of Compose Multiplatform for iOS, including sample applications and project templates.

Get started with the template

The easiest way to get started writing your own applications targeting Android and iOS with Compose Multiplatform is to use the official GitHub template, which comes with its own tutorial to get your first Compose Multiplatform app up and running.

Get started with Compose for iOS

Explore Compose for iOS with demo applications

A good way to explore how a new technology is used is to look at some samples. We have prepared a number of example projects that demonstrate Compose Multiplatform on iOS and its other targets. You can find them in the Compose Multiplatform repository.

Explore sample projects

Other sample projects like the Kotlin Multiplatform Mobile Production Sample now feature a branch that contains a UI implementation based on Compose Multiplatform, allowing you to compare differences and similarities between sharing only the business logic between apps, and sharing the UI layer of the application as well.

Share your feedback!

Compose Multiplatform on iOS is in Alpha, and we want to evolve the technology based on your needs.

Help us help you by reporting problems, telling us about APIs that you feel are missing, and requesting features you’d like to see. You can do all of this in the project’s issue tracker.

If you want to talk to the team behind Compose Multiplatform or other developers, we also invite you to join the discussion on the Kotlin Slack. In the #compose-ios channel, you can find discussions about Compose Multiplatform for iOS. In #compose you can discuss general topics related to Compose Multiplatform and Jetpack Compose.

We’re looking forward to seeing what you’ll build next with Compose Multiplatform!

See also

]]>
https://blog.jetbrains.com/zh-hans/kotlin/2023/05/compose-multiplatform-for-ios-is-in-alpha/ https://blog.jetbrains.com/pt-br/kotlin/2023/05/compose-multiplatform-for-ios-is-in-alpha/ https://blog.jetbrains.com/ko/kotlin/2023/05/compose-multiplatform-for-ios-is-in-alpha/ https://blog.jetbrains.com/ja/kotlin/2023/05/compose-multiplatform-for-ios-is-in-alpha/ https://blog.jetbrains.com/fr/kotlin/2023/05/compose-multiplatform-for-ios-is-in-alpha/ https://blog.jetbrains.com/es/kotlin/2023/05/compose-multiplatform-for-ios-is-in-alpha/ https://blog.jetbrains.com/de/kotlin/2023/05/compose-multiplatform-for-ios-is-in-alpha/
Kotlin News: 1.8.20 Release, KotlinConf Keynote, Redesigned Mascot, Kotlin Foundation News, and More https://blog.jetbrains.com/kotlin/2023/05/kotlin-news-april-2023/ Tue, 09 May 2023 08:23:25 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/05/DSGN-16469-11-01.png https://blog.jetbrains.com/?post_type=kotlin&p=348751 April has been a busy and eventful month with many updates and a lot of exciting news in the world of Kotlin. Catch up on all the highlights in our digest.

Kotlin Multiplatform user survey 

If you’re a Kotlin developer, we want to hear from you! We are currently conducting a Kotlin Multiplatform survey to collect insights that will help us shape the future of Kotlin Multiplatform. Complete the survey and contribute to a better developer experience!

By participating, you will not only help us with our research, but you will also have the chance to win a one-year JetBrains All Products Pack subscription or a $100 Amazon gift card.

Take the survey

Kotlin 1.8.20 released

Kotlin 1.8.20 Released

Here are some highlights of the Kotlin 1.8.20 release:

  • Updates for the new Kotlin K2 compiler.
  • AutoCloseable interface and Base64 encoding in the standard library.
  • New JVM incremental compilation enabled by default.
  • New experimental Kotlin/Wasm target.

Try 1.8.20

Stay up to date with our regular digest, featuring the most important news about the Kotlin ecosystem! Subscribe here.

KotlinConf 2023: A look at the opening keynote

KotlinConf Opening Keynote Highlights

At the KotlinConf 2023 opening keynote, the JetBrains team made several big announcements regarding JetBrains’ recent work on the Kotlin language, along with the Google team that shared its latest news. We collected the keynote’s main announcements in a single blog post for you to explore. Alternatively, you can watch the keynote recording.

Watch now

KotlinConf 2023: Watch the recordings

KotlinConf 2023 Session Recordings

All of the KotlinConf 2023 session recordings are now available for you to watch and enjoy! You can find the entire list of videos in our blog post. Check the schedule, choose your favorite talks, and view the additional materials at your own pace.

Explore

The Kotlin mascot returns – say hello to Kodee!

The Kotlin Mascot Returns

During KotlinConf, we announced the return of Kotlin’s mascot. We know it’s been a while since we first introduced it, but it’s back! So, please meet Kodee. We listened to what our community had to say and redesigned our mascot to create a friendly companion that people can relate to and use to express themselves. We have prepared Kotlin mascot assets for you to download and explore. Get inspired, experiment, and engage your inner artist with Kodee!

Discover more

The Kotlin DSL is now the default for new Gradle builds

The Kotlin DSL is now the default for new Gradle builds

Gradle has chosen the Kotlin DSL as the default for new Gradle builds! It will be the default option in the plugins and documentation. We believe this will improve the developer experience and make script and plugin development easier and more consistent. Read our blog post to learn more about the key advantages of using the Kotlin DSL for writing Gradle scripts.

Find out more

Visualizing MIDI sequences with Kotlin and OpenRNDR [webinar]

Visualizing MIDI sequences with Kotlin and OpenRNDR [webinar]

Watch the recording of our new creative coding livestream with Edwin Jakobs. In this session, Edwin demonstrates what you can do with MIDI signals processed by a Kotlin program using OpenRNDR, an open-source framework for creating stunning visuals.

Watch now

Shout-out to Kotlin Multiplatform content creators

Kotlin Multiplatform Content Creators

Check out the new compelling pieces of Kotlin Multiplatform content:

See our blog post for more links to interesting content from the community.

See the full list

Kotlin Foundation news

There are several important pieces of news from the Kotlin Foundation that we want to share with you.

Kotlin Foundation News

The Kotlin Foundation Grants Program is live

The Kotlin Foundation introduced its Grants Program for individual contributors. The initiative will provide financial awards to authors of libraries, frameworks, and other tools who contribute to the Kotlin ecosystem. The program is focused on supporting authors of multiplatform projects, as well as those looking to expand their projects to Kotlin Multiplatform. The first round of submissions ends on May 15.

Learn more

Gradle Inc, Touchlab, and Shopify become the Kotlin Foundation’s first members

The first members to join the Kotlin Foundation are Gradle Inc., Touchlab, and Shopify. These companies are well-known in the Kotlin community and bring a wealth of expertise and experience on how Kotlin is used in production and what the Kotlin ecosystem needs to continue to thrive.

Read on

Results of the Kotlin Multiplatform contest: And the winners are…

The Kotlin Foundation recently hosted a Kotlin Multiplatform Contest for all the students and recent graduates who love coding in Kotlin. We got 43 submissions from developers all over the world, each of whom demonstrated remarkable skills and creativity.

The grand prize winners of the contest are:

  • Ahmet Burak Ilhan, Istanbul Biruni University, Turkey – DoGoodMobile.
  • Brian Kamau Mbigo, Multimedia University of Kenya – VisioZoezi.
  • Maciej Procyk, University of Warsaw, Poland – mini-games.

Read the full news

]]>
Contributors to Kotlin Projects for Google Summer of Code Announced https://blog.jetbrains.com/kotlin/2023/05/kotlin-gsoc-contributors-announced/ Mon, 08 May 2023 12:51:20 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/03/DSGN-15981-Blogpost-banner-for-GSoC-with-Kotlin_Blog-Featured-image-1280x600-1.png https://blog.jetbrains.com/?post_type=kotlin&p=349818 Google Summer of Code with Kotlin

We are thrilled to announce that 5 Kotlin project contributors have been selected for Google Summer of Code 2023! With the guidance of mentors from JetBrains, Google, and Gradle, they will work on 12-week programming projects with the Kotlin Foundation.

We were impressed by the number of high-quality proposals we received. After careful review, we have selected top contributors to the following projects:

  1. Kotlin Multiplatform library version of Flogger
  2. Enhance the kotlinx-benchmark library API and user experience
  3. Eclipse Gradle KTS editing
  4. Parallel stacks for Kotlin coroutines in the debugger
  5. Improve support for parameter forwarding in the Kotlin plugin for IntelliJ IDEA

If you applied to the Kotlin Multiplatform libraries project but weren’t selected, consider applying to the Kotlin Foundation’s Grants Program for multiplatform library authors before May 15, 2023.

Congratulations to the selected contributors and mentors! We believe that each of these projects will have a significant impact on the Kotlin community, and we can’t wait to see what you accomplish during Google Summer of Code 2023.

For those who were not selected this time, we encourage you to submit your proposals again next year. We thank everyone who applied to participate in Google Summer of Code with the Kotlin Foundation!

Stay tuned for updates on the progress of our selected projects!

]]>
KotlinConf 2023: Watch the Recordings https://blog.jetbrains.com/kotlin/2023/05/kotlinconf-2023-recordings/ Thu, 04 May 2023 15:24:07 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/05/DSGN-16229-Banners-for-KotlinConf-recordings_Blog-Featured-image-1280x600-1.png https://blog.jetbrains.com/?post_type=kotlin&p=348956 KotlinConf 2023 session recordings are now available!

Whether you missed out on the event or just want to re-watch your favorite talks, you can now easily find all the talks on the KotlinConf website, along with photos from the conference. Slides from some of the sessions can be accessed by clicking on the respective talk and then on “Download slides”. You can also find all of the recordings on the Kotlin YouTube channel.

KotlinConf took place in Amsterdam on April 12–14, 2023, with more than 1,300 attendees, speakers, and partners participating. We had a day full of hands-on workshops on April 12. Day 2 opened the conference with a keynote by Roman Elizarov, Svetlana Isakova, Egor Tolstoy, and Grace Kloba. Following that, there were 2 days of simultaneous sessions in 5 content-packed tracks. The final flourish was the entertaining and informative closing panel by Hadi Hariri and the speakers answering questions from the audience, both on-site and online.

Don’t miss these additional materials from the conference:

  • Recap the highlights from the keynote in this blog post.
  • Watch KotlinConfersations, a show filmed at the conference, featuring interviews with the speakers and conference attendees and hosted by KotlinConf speaker Huyen Tue Dao. 

Enjoy KotlinConf 2023 from the comfort of your own screen!

To stay up to date with news about the conference, subscribe to the KotlinConf newsletter and follow KotlinConf on Twitter @kotlinconf.

]]>
https://blog.jetbrains.com/zh-hans/kotlin/2023/05/kotlinconf-2023-recordings/ https://blog.jetbrains.com/ko/kotlin/2023/05/kotlinconf-2023-recordings/ https://blog.jetbrains.com/ja/kotlin/2023/05/kotlinconf-2023-recordings/ https://blog.jetbrains.com/fr/kotlin/2023/05/kotlinconf-2023-recordings/
The Kotlin Mascot Returns – Say Hello to Kodee! https://blog.jetbrains.com/kotlin/2023/04/the-kotlin-mascot-returns/ Wed, 26 Apr 2023 16:49:06 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/04/DSGN-16174-Blog-post-banner-and-promo-materials-for-post-about-Kotlin-mascot_Blog-Featured-image-1280x600-1.png https://blog.jetbrains.com/?post_type=kotlin&p=345074 We are excited to announce the arrival of Kotlin’s newly reimagined mascot that took the spotlight during KotlinConf. It’s been a while since we first introduced our mascot, but it is back and it has a name now – Kodee!

With your feedback in mind, we have redesigned our mascot to create an approachable and fun character that the Kotlin community can relate to.

Kotlin's redesigned mascot Kodee

We wanted to give our community something that was special and would spark imagination and evoke a sense of connection. We believe that our mascot should be more than just a symbol. It should be a friendly companion that our community can use to express themselves. 

Take a look at how our little friend can express a variety of emotions. It can be cheerful and happy, or, like the rest of us, it may feel blue at times. Kodee gained new abilities, such as running to speed up the process, chilling out, or even dancing.

Kotlin's newly redesigned mascot with a variety of emotions

We invite you to use Kodee in your digital and print materials. We have created specific Kotlin mascot guidelines that outline how our mascot should be used, including color schemes, font styles, and an overall design aesthetic.

We have also prepared Kotlin mascot assets for you to explore. You can download the assets here. We hope that our revamped mascot will help you spark your inner artist. Be creative and see where Kodee takes you!

If you are interested in developing your own adaptations, here are a few examples of what Kodee can look like.

Adaptations of Kotlin's newly updated mascot Kodee

Thank you so much for your feedback! It helped us create a mascot that truly represents who we are.

Stay tuned for more updates and news!

]]>
https://blog.jetbrains.com/zh-hans/kotlin/2023/04/the-kotlin-mascot-returns/ https://blog.jetbrains.com/ko/kotlin/2023/04/the-kotlin-mascot-returns/ https://blog.jetbrains.com/ja/kotlin/2023/04/the-kotlin-mascot-returns/ https://blog.jetbrains.com/fr/kotlin/2023/04/the-kotlin-mascot-returns/
Kotlin 1.8.20 Released https://blog.jetbrains.com/kotlin/2023/04/kotlin-1-8-20-released/ Tue, 25 Apr 2023 10:43:10 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/03/DSGN-16128-1.8.20-Release_Blog-Featured-image-1280x600-1.png https://blog.jetbrains.com/?post_type=kotlin&p=335770 The Kotlin 1.8.20 release is out! Here are some highlights from this release:

For the complete list of changes, refer to What’s new in Kotlin 1.8.20 or release notes on GitHub.

New experimental Kotlin/Wasm target

Kotlin 1.8.20 introduces a new compilation target called WebAssembly.

We think WebAssembly is a promising technology, and we want to find better ways for you to use it and get all of the benefits of Kotlin.

Starting from this release, you can use Kotlin/Wasm in your multiplatform projects. Compiling Kotlin code to WebAssembly allows you to run it directly in the browser or any other environment that supports WebAssembly and meets Kotlin requirements. This opens up a wide range of possibilities, from building high-performance web applications to serverless functions.

Kotlin/Wasm is now Experimental. Your feedback is especially important at this stage of the product, and we encourage you to try Kotlin/Wasm. Follow this tutorial to create your first Kotlin/Wasm application:

GET STARTED

How to install Kotlin 1.8.20

If you already use IntelliJ IDEA 2022.2, 2022.3, the IDE will suggest updating Kotlin to 1.8.20 automatically. You can also update manually by following these instructions. IntelliJ IDEA 2023.1 has the built-in Kotlin plugin 1.8.20.

For Android Studio Flamingo (222) and Giraffe (223), the Kotlin plugin 1.8.20 will be delivered with upcoming Android Studios updates.

If you need the command-line compiler, download it from the GitHub release page.

If you run into any problems

Stay up to date with the latest Kotlin features! Subscribe to receive Kotlin updates by filling out the form to the right of this post.

Special thanks to our EAP Champions 🥇👏

They reported issues and helped us stabilize the Kotlin 1.8.20 release:

What else to read and watch

]]>
https://blog.jetbrains.com/zh-hans/kotlin/2023/04/kotlin-1-8-20-released/ https://blog.jetbrains.com/ko/kotlin/2023/04/kotlin-1-8-20-released/ https://blog.jetbrains.com/fr/kotlin/2023/04/kotlin-1-8-20-released/
KotlinConf 2023: A Look at the Opening Keynote https://blog.jetbrains.com/kotlin/2023/04/kotlinconf-2023-opening-keynote/ Thu, 13 Apr 2023 08:19:16 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/04/Featured-KotlinConf-keynote-blog-post_Blog-Featured-image-1280x600-1.png https://blog.jetbrains.com/?post_type=kotlin&p=341654 At the KotlinConf 2023 opening keynote, Roman Elizarov, Svetlana Isakova, and Egor Tolstoy made several exciting announcements regarding JetBrains’ recent work on the Kotlin language, while Grace Kloba shared the latest news from Google:

  • The K2 compiler will be released in Kotlin 2.0.
  • The Gradle Kotlin DSL will be the default for new builds.
  • Kotlin language adoption is skyrocketing at Google.
  • The Kotlin Foundation is launching a funding program for library authors and a membership program for companies.
  • Kotlin Multiplatform will become stable this year.
  • Compose for iOS is in Alpha.
  • Experimental Compose for Web will be powered by Kotlin/Wasm.

Watch the keynote or read on for the main announcements.

The conference has just started in Amsterdam and is set to take place today and tomorrow, April 13 and 14.

📽️ If you’re eager to immerse yourself in the event, explore the schedule and handpick the most captivating talks to enjoy via livestream!

Kotlin 2.0 and further language evolution

Back in 2019, we started developing the new K2 compiler, aiming for a performance breakthrough. As work on the new compiler nears completion, we’re thrilled to announce that it will be released as Kotlin 2.0, following version 1.9.

The most notable improvement in the new compiler is a substantial increase in compilation speed. With the new architecture, the compilation pipeline will be twice as fast! Of course, exact speed improvements will vary depending on the specific project.

You can see an example of the compilation speed improvement for the Kotlin compiler building itself with the 2.0 version preview below.

Try Kotlin 2.0

We develop Kotlin and make design decisions based on your invaluable feedback and insights. Please try Kotlin 2.0 and tell us whether it works for you and what problems you run into. Starting with Kotlin 1.8.20, you can enable a preview of the Kotlin 2.0 language version via the regular Kotlin language version flag.

Provide your feedback directly to Kotlin 2.0 developers on YouTrack.

Try Kotlin 2.0

New tooling and compiler plugins

Kotlin 2.0 is going to accelerate future language evolution. With the new architecture, we can introduce new features faster without having to make dozens of modifications to the compiler. It is also considerably more powerful regarding what can be accomplished outside of the language using compiler plugins.

The new compiler will also be incorporated into many tools. The Kotlin IDE plugin will be rewritten. Google is working on an update for the Kotlin Symbol Processing (KSP) engine so that existing plugins will be able to start automatically working with Kotlin 2.0. Google is also working closely with JetBrains to integrate K2 into Android Studio and the Compose compiler, further enhancing the developer experience.

Other language news

We also have a couple more cool things to share! Several highly anticipated features are set to be delivered after the release of Kotlin 2.0: static extensions, collection literals, name-based destructuring, context receivers, and explicit fields.

Last but not least, we will soon release the first preview of Kotlin Notebooks, integrated into IntelliJ IDEA.

Watch the keynote recording for more details about these language features and demos of the Kotlin compiler plugin and Kotlin Notebooks by Roman Elizarov.

Read more about the new compiler and Kotlin 2.0 roadmap in this blog post by Roman Elizarov

The Kotlin DSL to become the default build language in Android Studio

Among other exciting announcements, the Gradle Kotlin DSL will become the default build language starting in Android Studio Giraffe. With this change, users get a much-improved experience over Groovy, as Kotlin provides inlay hints, semantic highlighting, navigation, and code completion. These features are critical for working with unfamiliar or complex build scripts without knowing all of their rules.

Learn More

Kotlin adoption inside Google

Since Google officially started supporting Kotlin for the development of its own products, adoption of the language at Google has grown far beyond Android applications. The Kotlin codebase at Google has grown to over 15 million lines of code, doubling year over year. In fact, more than 45% of Google engineers using Kotlin write server-side code, and the Google Workspace team is exploring the possibilities of Kotlin Multiplatform.

Learn more about Google’s investments in Kotlin in their KotlinConf blog post.

Learn More

The Kotlin Foundation to fund multiplatform library authors

The Kotlin Foundation is now offering grants to support individual contributors! This program is focused on assisting authors of multiplatform projects, as well as those looking to expand their projects to Kotlin Multiplatform.

The Kotlin Foundation Ecosystem Committee will consider the project’s target audience, the issues it aims to solve, and its stability when reviewing applications. It is also important to adhere to our recently published Library API guidelines.

The first round of submissions ends on May 15. Read more about the program and apply!

Learn More

Kotlin Foundation membership program

The Kotlin Foundation has launched a membership program, welcoming more companies to collaborate on language development governance, advance the Kotlin ecosystem, and promote the language.

The first members to join the Kotlin Foundation are Gradle Inc., Touchlab, and Shopify. Those companies are well known in the Kotlin community for their incredible contribution to the language and the ecosystem.

Join the Foundation and build a connection between your company and the community to shape the future of Kotlin!

Learn More

Kotlin Multiplatform is on its way to Stable 

Kotlin Multiplatform has experienced incredible adoption and boasts a rapidly growing ecosystem thanks to a significant community contribution. The number of Multiplatform libraries exceeds 1,000 and covers virtually any use case you can think of! An upgraded set of Jetpack libraries is among them, thanks to Google’s contribution. 

We have successfully validated concepts such as memory management, project configuration, and multiplatform libraries, and in 2023 we’re fully committed to bringing Kotlin Multiplatform to a stable release.

With its versatility, extensive ecosystem, and all-platform coverage, Kotlin Multiplatform has the potential to become the go-to choice for cross-platform development. There was one piece missing in that puzzle – a cross-platform UI – and we’ve added it! 

Compose for iOS in Alpha

The Alpha version of Compose Multiplatform targeting iOS is now available. Now you can use Compose Multiplatform to build the same app on Android and iOS. While the benefits of a shared UI for mobile development are significant, the natural flexibility of Multiplatform empowers you to choose whether to share your app’s business logic and keep the UI native or go cross-platform for both. It’s up to you – share the code on your terms! Of course, you’re free to use other UI frameworks and design systems in addition to Multiplatform.

Although it’s in Alpha, we are committed to bringing iOS support to Compose Multiplatform. Want to help? Give it a try, and share your feedback with us in the Kotlin Slack #compose-ios channel (if you’re not a member, apply here).

Try Compose for iOS

Experimental Compose for Web powered by Kotlin/Wasm

We’re continuously expanding Kotlin to embrace emerging platforms. You may have already tried the Experimental support for WebAssembly in the latest Kotlin version, and now you can also experiment with porting your existing Compose code to the web using Kotlin/Wasm, as a prototype is available! Share your feedback with us on the Kotlin Slack #compose-web channel (if you’re not a member, apply here).

Try Compose for Web

More fun facts and stats from the keynote 

  • Over 1 million GitHub projects use Kotlin as their primary language.
  • The number of Kotlin Multiplatform libraries increased by 60% in the past year, and the growth is continuing at the same rapid pace.
  • 86% of all Kotlin users across all platforms are satisfied or very satisfied with Kotlin.
  • 96.9% of professional Android developers using Kotlin are satisfied with it, and this rate is 9 percentage points higher than that for their Java counterparts.
  • Kotlin is the most popular language for Android development, with over 95% of the top 1,000 Android apps using it.
  • Over 21% of the top 1,000 Android apps use Jetpack Compose, which is more than double the number from last year.

Thank you, and enjoy KotlinConf 2023!

We are deeply thankful to everyone in the community who has passionately contributed to shaping Kotlin into what it was envisioned to be – a language for the industry that empowers developers to build any part of an application with confidence and joy.

Enjoy the KotlinConf 2023 livestream. We recommend the following talks for a deep dive into the major announcements:

Kotlin 2.0: 

  1. How We’re Improving the Performance of the IntelliJ IDEA Kotlin Plugin by Vladimir Dolzhenko. April 14, 13:00 CEST. 
  2. K2 Compiler Plugins by Mikhail Glukhikh. April 14, 10:15 CEST. 

Kotlin at Google:

  1. Adopting Kotlin at Google Scale by Jeffrey van Gogh and John Pampuch. April 13, 10:15 CEST.
  2. Kotlin Multiplatform in Google Workspace by Jason Parachoniak. April 13, 11:15 CEST.
  3. Kotlin Multiplatform Conversions at Android Jetpack Scale by Dustin Lam and James Ward. April 13, 13:00 CEST.
  4. Adventures Building a Kotlin Multiplatform Benchmarking Library by Rahul Ravikumar. April 13, 16:15 CEST.

Compose and Multiplatform:

  1. Compose Multiplatform for iOS by Sebastian Aigner and Nikita Lipsky. April 13, 15:15 CEST. 
  2. You Can Do Desktop Too! by Victor Kropp. April 14, 10:15 CEST.
  3. Level Up on Kotlin Multiplatform by Pamela Hill. April 13, 14:00 CEST.

More resources

  1. The K2 Compiler Is Going Stable in Kotlin 2.0, a blog post by Roman Elizarov.
  2. The Kotlin DSL Is Now the Default for New Gradle Builds – blog posts by Google and Gradle.
  3. Announcing the Kotlin Foundation Membership Program.
  4. The Kotlin Foundation Grants Program Is Live
]]>
https://blog.jetbrains.com/zh-hans/kotlin/2023/04/kotlinconf-2023-opening-keynote/ https://blog.jetbrains.com/ko/kotlin/2023/04/kotlinconf-2023-opening-keynote/ https://blog.jetbrains.com/ja/kotlin/2023/04/kotlinconf-2023-opening-keynote/ https://blog.jetbrains.com/fr/kotlin/2023/04/kotlinconf-2023-opening-keynote/
Kotlin DSL Is Now the Default for New Gradle Builds https://blog.jetbrains.com/kotlin/2023/04/kotlin-dsl-is-the-default-for-new-gradle-builds/ Thu, 13 Apr 2023 08:00:30 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/04/DSGN-15924-Kotlin-as-Gradles-Go-To-DSL_Blog-Featured-image-1280x600-1.png https://blog.jetbrains.com/?post_type=kotlin&p=338798 We always strive to help developers write better-structured and more maintainable builds. Given this aim, applying Kotlin to writing Gradle build scripts and plugins seems only natural. Kotlin provides many powerful features that make it an excellent choice for creating a DSL and significantly improve the developer experience.

We have done a lot of work since Kotlin was brought to Gradle for the first time, aiming to make the experience of Gradle users smooth and enjoyable. Today, we are thrilled to share some important news with you: Gradle announced that they have chosen the Kotlin DSL as the default for new Gradle builds! From now on it will be the default option in the plugins and documentation. Thanks to its rich features, like first-class functions and extension methods, Kotlin can maintain and even improve the best elements of creating Gradle scripts.

JetBrains, Google, and Gradle announced that the Kotlin DSL is now the default for new Gradle builds

Thanks to the collaborative effort between JetBrains, Google and Gradle, the Kotlin DSL reached the next level of maturity and is now an even more efficient and user-friendly tool for developers to use in their projects.” ~ The Gradle team

In addition, Google made a statement about the Kotlin DSL as the default script for Gradle build files for Android apps.

Google, Gradle, and JetBrains will continue to collaborate closely together to have a unified code style and defined idioms, which in the end will help us improve code quality.

In this post, we want to share some key advantages of the Kotlin DSL for writing Gradle scripts, along with the existing capabilities of IDE support of build.gradle.kts files.

Benefits of choosing the Kotlin DSL over Groovy

Different developers may have different reasons for choosing one language over the other. In the sections below, we highlight the key strengths of Kotlin that make the Kotlin DSL a better choice for writing Gradle build scripts and plugins.

So, if you are still on the fence about converting your Android’s Gradle build files from Groovy to Kotlin, here are the 4 main advantages of using Kotlin.

  1. Compile-time checking

A crucial difference between the two languages is that Groovy is a dynamic language, while Kotlin is statically typed. This means that, when the Kotlin DSL is used, build script errors might occur at compile time rather than at runtime.

With dynamic type checking, errors are not detected until the build script is executed. With compile-time errors, though, you have a chance to fix the problems earlier. What’s more, if you are working in an IDE, an editor can highlight the errors. For example, this is what you will see when trying to reference the configuration name `applications` instead of `application`.

When the Kotlin DSL is used, build script errors might occur at compile time

2. Better IDE experience

With more semantic information about code, you can use IDE features to their full extent, including:

  • Auto-completion and content assistance
  • Source code navigation
  • Refactorings

So far, IntelliJ IDEA and Android Studio provide the most integrated experience for Kotlin. However, you can import and work with Kotlin-DSL-based builds in other IDEs as well. In the Gradle documentation, you can check the IDE support matrix for the Kotlin DSL.

3. Simplified, declarative plugin syntax

The Kotlin DSL provides an alternative syntax to the traditional Groovy DSL and offers the same benefits as the core Kotlin language. Let’s look at the two languages side by side.

When you apply Gradle plugins to a project, you need to specify only the plugin ID. For example, when you specify the `application` plugin with the Groovy DSL, it will look as follows:

Specifying the plugin ID with the Groovy DSL

Thanks to the simplified syntax of the Kotlin DSL, you only need to type “application” in Kotlin:

Specifying the plugin ID with the Kotlin DSL

As mentioned above, if you try to apply a plugin that doesn’t exist, the IDE will show you a syntax error.

4. A growing community of Kotlin developers

Kotlin has a large and thriving community of developers who contribute to the language and libraries and provide Gradle plugins.

A growing community results in a wealth of information for both experienced developers and those who are new to Kotlin. These include Kotlin’s official documentation, forums, blogs, threads on social media, and online educational courses.

With many helpful resources available, you can easily find solutions to problems and take your skills to the next level.

Migrate from Groovy to the Kotlin DSL

As you can see, the listed advantages and robust features of the Kotlin DSL make it the perfect choice for boosting productivity and building high-performance software. If you want to migrate your existing Gradle build from Groovy to the Kotlin DSL, you can check out Gradle’s migration tutorial. And for Android developers, there is a thorough guide on how to convert your Android app’s Gradle build files from Groovy to KTS.

Gradle will still retain support for the Groovy DSL. When it comes to large projects with complex build logic that are using the Groovy DSL, Gradle recommends not to migrate them yet. However, now that Kotlin is Gradle’s default choice of DSL, we believe the Kotlin DSL will significantly benefit Gradle users who are looking to improve their experience when writing and editing build scripts.

As always, the JetBrains team is committed to enhancing our technology further to provide our users with feature-rich tools for developing efficient applications.

]]>
https://blog.jetbrains.com/zh-hans/kotlin/2023/04/kotlin-dsl-is-the-default-for-new-gradle-builds/ https://blog.jetbrains.com/ko/kotlin/2023/04/kotlin-dsl-is-the-default-for-new-gradle-builds/ https://blog.jetbrains.com/ja/kotlin/2023/04/kotlin-dsl-is-the-default-for-new-gradle-builds/ https://blog.jetbrains.com/fr/kotlin/2023/04/kotlin-dsl-is-the-default-for-new-gradle-builds/
KotlinConf 2023: Join the Livestream and Get Your Questions Answered! https://blog.jetbrains.com/kotlin/2023/03/kotlinconf-2023-livestream/ Fri, 31 Mar 2023 11:37:44 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/03/DSGN-16095-KotlinConf-Livestream-promotion_Blog-Featured-image-1280x600-1.png https://blog.jetbrains.com/?post_type=kotlin&p=338081 KotlinConf 2023 is almost here! 

Are you ready to be a part of the conference experience? We will be streaming KotlinConf’23 live on YouTube, so you will have full access to the conference, even if you can’t attend in person! 

Join livestream

Here are some highlights you definitely don’t want to miss:

Opening keynote

We will kick off our livestream with an opening keynote by Roman Elizarov, Svetlana Isakova, Egor Tolstoy, and Grace Kloba. Be sure to tune in on April 13 at 9:00 am CEST.

Five tracks

The livestream will continue after the keynote with sessions on April 13 and April 14.

Check out the KotlinConf’23 schedule for your favorite sessions and save the dates on your calendar. The links to the broadcast for each track and session will be available on the KotlinConf schedule shortly.

Closing panel

Join us for the closing panel with Hadi Hariri and speakers on April 14 at 5:15 pm CEST. This is the perfect opportunity to ask all the questions about Kotlin you’ve ever had! Simply post them on Twitter, Facebook, or LinkedIn with a #kc23ask hashtag. We’ll select the most interesting ones for the closing panel participants to answer. 

Check the schedule

Recordings

Watching KotlinConf’23 live is without a doubt the most immersive experience. But if you can’t make it in person, the recordings of all the sessions will be available on our YouTube channel by May 1, 2023. You’ll also have access to recordings of KotlinConfersations, a show filmed on the spot, featuring interviews with the speakers and conference attendees. The show is hosted by KotlinConf speaker Huyen Tue Dao.

KotlinConf Global

Get on board with KotlinConf Global and you’ll be able to watch the conference and discuss it together with community members. Check our map to see if there’s a KotlinConf Global event taking place near you. 

Have a great KotlinConf 2023!

]]>
https://blog.jetbrains.com/zh-hans/kotlin/2023/03/kotlinconf-2023-livestream/ https://blog.jetbrains.com/pt-br/kotlin/2023/03/kotlinconf-2023-livestream/ https://blog.jetbrains.com/ko/kotlin/2023/03/kotlinconf-2023-livestream/ https://blog.jetbrains.com/ja/kotlin/2023/03/kotlinconf-2023-livestream/ https://blog.jetbrains.com/fr/kotlin/2023/03/kotlinconf-2023-livestream/ https://blog.jetbrains.com/es/kotlin/2023/03/kotlinconf-2023-livestream/ https://blog.jetbrains.com/de/kotlin/2023/03/kotlinconf-2023-livestream/
Shout-Out to Kotlin Multiplatform Content Creators! https://blog.jetbrains.com/kotlin/2023/03/kotlin-multiplatform-content-creators/ Thu, 23 Mar 2023 07:50:57 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/03/DSGN-15953-Kotlin-Multiplatform-Content-Creators-Campaign-Banner_Blog-Featured-image-1280x600-1.png https://blog.jetbrains.com/?post_type=kotlin&p=335548 Kotlin Multiplatform is steadily progressing toward Stable, and the technology’s ecosystem is continuing to expand and mature. None of this would be possible without the community’s contributions. In order to celebrate the community’s creation of articles, videos, and samples, we regularly run the Kotlin Multiplatform Content Creators Recognition Campaign. Today, we would like to share some great new content that will inspire learners and make the official resources more complete.

It’s never too late to become a part of the growing community of Kotlin Multiplatform content creators. Once every three months, the Kotlin team chooses their favorite new content and promotes it by:

Looking for content ideas? Here is a list of the most requested Kotlin Multiplatform topics:

  • Experiments with cutting-edge tools and libraries, for example, Kotlin Multiplatform libraries in Jetpack.
  • Improving iOS developer experience
  • Use cases – what have you shared with Kotlin Multiplatform Mobile?
  • Migrating large projects to Kotlin Multiplatform Mobile.

Don’t hesitate to share your thoughts about any other topics that interest you. We are excited by how much our community has to say, and we’re looking forward to seeing what you create! Don’t forget to add the #kotlinmultiplatform tag if the media platform you are using allows it.

To make sure we don’t miss your articles, videos, sample projects, or content of any other type, please drop us a link at kmm.feedback@kotlinlang.org.

The Kotlin team would like to thank all of the ecosystem’s contributors and content creators. Your input is invaluable, and together we’ll make Kotlin Multiplatform even better!

]]>
Kotlin News: Kotlin 2.0, Interview With John O’Reilly and Nicola Corti, and More https://blog.jetbrains.com/kotlin/2023/03/kotlin-news-feb-mar-2023/ Tue, 21 Mar 2023 13:32:43 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/03/DSGN-15947-Kotlin-email-March-digest-graphics-01.png https://blog.jetbrains.com/?post_type=kotlin&p=333643 The K2 Compiler is going stable in Kotlin 2.0

The main highlights of Kotlin 2.0 include: 

  • Faster K2 Compiler, which is more extensible by design.
  • A new data flow analysis algorithm, which leads to better smart casts.
  • The new version of the Kotlin IDE plugin built on top of the K2 compiler frontend.
  • Fixes for long-standing bugs.

Learn more

Stay up to date with our regular digest, featuring the most important news about the Kotlin ecosystem! Subscribe here.

Reproducible Kotlin Compiler Artifacts

For the Kotlin team, security is always a priority. One of the measures we are taking to protect Kotlin builds from an attack is to make them reproducible. With reproducible builds, you can easily check that any artifacts or dependencies that you want to use haven’t been tampered with.

Artifacts that are officially published on GitHub and Maven Central can now be verified against ones obtained on other machines. This greatly reduces the possibility of attacks targeting build agents. 

Read more

Interview With Top Kotlin Contributors – Highlighting Their Contributions to the Google Dev Library

In this article, Kotlin Google Developer Experts (GDEs) Nicola Corti and John O’Reilly talk about their contribution to the Google Dev Library. 

Nicola contributed Detekt to the Google Dev Library, which is a static code analysis tool for Kotlin projects that helps developers detect and report issues related to security, style, and best practices. 

John created the PeopleInSpace project. It utilizes the Open Notify API to display information about people currently in space, such as their names, nationalities, and spacecraft. The focus of the project is more about demonstrating the use of Kotlin Multiplatform.

Read the interview

Update Regarding Kotlin/Native Targets

As of Kotlin 1.8.0, Kotlin/Native supports 27 targets. However, we can’t support all of them equally well. To prioritize quality over quantity, we’ve decided to split the targets into tiers and deprecate some of them.

We’ve created a dedicated document to be a single source of information for all Kotlin/Native targets which we’ve split into 3 tiers, depending on how well each is supported and has been tested.

Read the document

Apply to Google Summer of Code – Kotlin Projects Available

Kotlin is taking part in Google Summer of Code, a global online program focused on bringing new contributors into open-source software development. GSoC Contributors will work with the Kotlin Foundation on a 12-week programming project under the guidance of mentors. 

Learn more and join

Watch the KotlinConf 2023 Livestream

If you’re not able to attend KotlinConf 2023, don’t worry. We’ll be streaming the event live on April 13 and 14. The conference will feature many exciting talks and sessions. Check out the schedule and see which ones you’d like to watch. Don’t miss the Opening Keynote on April 13, 9:00–10:00 am (CET).

Join the livestream

]]>