Kotlin Heroes 3: A Programming Challenge from JetBrains and Codeforces

Registration for the next Kotlin Heroes coding challenge is open! This will be the third challenge for programmers co-hosted by JetBrains and Codeforces. Register now and save the date, February 27, 13:35 UTC.

kotlin_heroes_banners-22

What is Kotlin Heroes, and why should you participate?

Kotlin Heroes is a collaborative project from JetBrains, the creator of the Kotlin programing language, and Codeforces, the most popular platform for programming contests. Previous Kotlin Heroes challenges have attracted more than 700 competitors per event. The main objective for the participants is to provide correct solutions to a set of problems during a limited period of time. The problem set includes several tasks of varying difficulty, from easy to hard, and will both entice curious beginners and challenge sophisticated users.

Continue reading

Posted in community, Events | Tagged , , | Leave a comment

Accelerate Your Kotlin Multiplatform Evaluation with KaMP Kit

JetBrains and Touchlab partner to drive Kotlin Multiplatform adoption in 2020

At JetBrains, we’re very delighted to partner with our good friends at Touchlab to increase the adoption of Kotlin Multiplatform Mobile technology in 2020 and beyond.

Touchlab has released a toolkit for getting started with Kotlin Multiplatform Mobile technology. It’s a self-contained GitHub project that you can use as a starting point or for evaluating the technology. We had the chance to review it before its general release and can say that we’re excited to share it with the Kotlin Multiplatform community!

The following post, written by Touchlab, provides more details.

JetBrains & Touchlab

When we first looked into Kotlin in 2014 we had no idea that JetBrains would introduce something as innovative as Kotlin Multiplatform Mobile. At Touchlab we believe 2020 is the year of Kotlin Multiplatform.

kc19_tracks_121
Touchlab partner Kevin Galligan presenting at KotlinConf ‘19 in Copenhagen (image courtesy of JetBrains)

Continue reading

Posted in community | Tagged | Leave a comment

KotlinConf 2019 Materials Are Available on the Website

The KotlinConf session recordings have now all been uploaded to the website, along with the slides if there were any. You can search for a particular talk, or you can watch all of them one by one with the KotlinConf playlist on JetBrains TV.

Additionally, all the pictures from the conference are now available! They have been collected into albums and uploaded to the website.

Blog_KC19

Continue reading

Posted in community | Tagged , | 3 Comments

Ktor 1.3 Release

Ktor 1.3 was released recently, and we’re happy to share the details with you in this blog post.

13release-01

Ktor consists of two parts: the server engine and a flexible asynchronous HTTP client. The current release focuses mainly on the HTTP client. Here you can find the complete changelog for this release.

The client is a multiplatform library that supports JVM, JS, Android, and iOS and is now often used in cross-platform mobile applications. Our main goal for the next releases is to make the server engine multiplatform, too.

The other areas we’re going to work on are:

  • Improving integration with the kotlinx.serialization library.
  • Supporting CIO (coroutines-based I/O client engine) on Kotlin/Native to make it a default multiplatform engine used in HttpClient.

If you currently use Ktor, either server or HttpClient, or have tried it at some point before, please take part in the following survey:

Take part in the survey

We’d be really grateful if you could share your experience with us!

Now let’s dive into the details of what Ktor 1.3 release brings.

HttpClient

Introducing HttpStatement

In the previous Ktor versions, you needed to explicitly close the HttpResponse. However, that was often a source of confusion. We’ve found a lot of cases where someone had forgotten to close the HttpResponse, even in simple examples, and got memory leaks because of it. To improve this situation we introduce the incompatible change in Ktor 1.3: HttpResponse no longer implements the Closeable interface. Thus the 1.3.0 Ktor release is not backwards compatible with the previous version Ktor 1.2.X.

HttpResponse is in-memory by default; and there is no need to close it anymore:

If you need to handle streaming or big responses, use the new HttpStatement class. HttpStatement doesn’t perform any network requests until you explicitly call the execute method:

For instance, you can read the data by chunks:

Configuring Proxy

The HttpClient adds experimental support for proxy. If you need to send requests under proxy, you can configure its address in the corresponding parameters:

Note that because of the platform restrictions it’s only supported for JVM and Native targets (except WatchOS) and isn’t supported for JavaScript. More details on how to configure it for different platforms can be found here.

Using NSURLSession for iOS engine

The iOS engine now provides a way to configure NSURLSession:

NSURLSession is a default API to interact with HTTP / HTTPS protocols on iOS, so now you can use it to tweak all the iOS-related settings.

Working with JSON improved

The following changes are supported both on HttpClient and server, so far in an experimental state.

Simplified collections serialization in JSON

In the previous Ktor versions, you needed to register auxiliary types for serializing collections. Now this process is simplified: JsonFeature handles collection types without additional configuration. And all the related functions like setMapper, setListMapper, register are now deprecated.

There is no need to register List<User> in JsonFeature anymore:

The same applies when working with JSON on a server, you can specify the collection types with the expected generic arguments when receiving the content:

kotlinx.serialization DSL

Ktor now supports a way to construct a JSON body using the kotlinx.serialization DSL:

To use it on a client, install JsonFeature and add the ktor-client-serialization dependency. On the server, use the SerializationConverter.

Migration Steps

To migrate your Ktor application to the new version, you’ll need to:

  • Update all your usages of HttpResponse: simply remove the close calls, and use HttpStatement when needed.

  • Update the imports. The kotlinx.io dependency has been removed, so you’ll need to replace imports in the following way:
    • import kotlinx.io. -> import io.ktor.utils.io.
    • import kotlinx.coroutines.io. -> import io.ktor.utils.io.

Note that there’s no binary compatibility with 1.2.x, so if you use any external Ktor features you’ll need to recompile them against the latest version. Also, make sure that you’re using 5.4.1+ Gradle metadata version.

Thank you for reading this and don’t forget to take the survey!

Take part in the survey

Posted in Libraries, Releases | Tagged | 5 Comments

Kotlin Census 2019: Call for Respondents

You can read this blog post in other languages:

The new edition of Kotlin Census is here! By the end of 2019, more than 4 million people had used Kotlin. This is a great number of people, and of course, they have a great number of use cases behind them. We care deeply about making sure Kotlin delivers a great experience for everyone who uses it. We want to improve it to help everyone in the community bring their ideas to life with Kotlin. This is why your feedback is so important to us. Please share with the Kotlin team how you’ve used the language over the last year. What did you like about it? What challenged you?

We also invite those who don’t use Kotlin to respond. Please share with us your reasons for not using it. Your responses are just as important to us and very much appreciated.

Census_Blog (1)

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 many new questions about the features and products that appeared in 2019. We’ve also added questions about how smooth your experience with Kotlin and its ecosystem was in 2019.

Answer the Census

One more important thing – answering the Census gives you a chance to win a free ticket to KotlinConf or a special Kotlin T-shirt. We will raffle off the prizes among the respondents after the Census closes.

Posted in Uncategorized | Tagged | 6 Comments

Making Kotlin Ready for Data Science

This year at KotlinConf 2019, Roman Belov gave an overview on Kotlin’s approach to data science. Now that the talk is available for everyone to see, we decided to recap it and share a bit more on the current state of Kotlin tools and libraries for data science.

How does Kotlin fit data science? Following the need to analyze large amounts of data, the last few years has brought a true renaissance to the data science discipline. All this renaissance of data science couldn’t be possible without proper tools. Before, you needed a programming language designed specifically for data science, but today you can already do it with general-purpose languages. Of course this requires general-purpose languages to make the right design decisions, not to mention getting the community to help in. All this made certain languages, such as Python, more popular for data science than others.

With the concept of Kotlin Multiplatform, Kotlin aims to replicate its developer experience and extend its interoperability to other platforms as well. The major qualities of Kotlin by design include conciseness, safety, and interoperability. These fundamental language traits make it a great tool for a wide variety of tasks and platforms. Data science is certainly one of these tasks.

The great news is that the community has already begun adopting Kotlin for data science, and this adoption is happening at a fast pace. The brief report below outlines how ready Kotlin is for data science, including the Kotlin libraries and Kotlin tools for data science.

Jupyter

First and foremost, thanks to their interactivity, Jupyter notebooks are very convenient for transforming, visualizing, and presenting data. With the extensibility and the open-source nature of Jupyter, it has turned into a large ecosystem around data science and was integrated into tons of other solutions related to data. Among them is the Kotlin kernel for Jupyter notebooks. With this kernel, you can write and run Kotlin code in Jupyter notebooks and use third-party data science frameworks written in Java and Kotlin.

An example of a reproducible Kotlin Jupyter notebook can be found in this repo. To quickly play with a Kotlin notebook, you can launch it on Binder (please note the environment will normally take a minute to set up).

Apache Zeppelin

Due to the strong support for Spark and Scala, Apache Zeppelin is very popular among data engineers. Similar to Jupyter, Zeppelin has a plugin API (called Interpreters) to extend its core with support for other tools and languages. Currently, the latest release of Zeppelin (0.8.2) doesn’t come with a bundled Kotlin interpreter. But anyway, it is available in the master branch of Zeppelin. To learn how to deploy Zeppelin with Kotlin support in a Spark cluster, see these instructions.

Apache Spark

Since Spark has a robust Java API, you can already use Kotlin to work with the Spark Java API from both Jupyter and Zeppelin without any problems. However we’re working on improving this integration by adding full support for Kotlin classes with Spark’s Dataset API. Support for Kotlin with Spark’s shell is also in progress.

Libraries

Using Kotlin for data science alone, without libraries, makes little sense. Luckily, thanks to the recent efforts of the community, there’s already a number of nice Kotlin libraries that you can use right away.

Here are some of the most useful libraries:

  • kotlin-statistics is a library that provides a set of extension functions to perform exploratory and production statistics. It supports basic numeric list/sequence/array functions (from sum to skewness), slicing operators (e.g. countBy, simpleRegressionBy, etc), binning operations, discrete PDF sampling, naive bayes classifier, clustering, linear regression, and more.
  • kmath is a library inspired by numpy; this library supports algebraic structures and operations, array-like structures, math expressions, histograms, streaming operations, wrappers around commons-math and koma, and more.
  • krangl is a library inspired by R’s dplyr and Python’s pandas; this library provides functionality for data manipulation using a functional-style API; it allows you to filter, transform, aggregate, and reshape tabular data.
  • lets-plot is a library for declaratively creating plots based on tabular data. This library is inspired by R’s ggplot and The Grammar of Graphics, and is integrated tightly with the Kotlin kernel. It is multi-platform and can be used not just with JVM, but also from JS and Python.
  • kravis is another library inspired by R’s ggplot for visualizing tabular data.

For a more complete list of useful links, please refer to Kotlin data science resources by Thomas Nield.

Lets-Plot for Kotlin

Lets-Plot is an open-source plotting library for statistical data written entirely in Kotlin. Being a multiplatform library, it has an API designed specifically for Kotlin. You can familiarize yourself with how to use this API by reading its user guide.

For interactivity, Lets-Plot is tightly integrated with the Kotlin kernel for Jupyter notebooks. Once you have the Kotlin kernel installed and enabled, add the following line to a Jupyter notebook:

%use lets-plot

Then you will be able to call Lets-Plot API functions from your cells, and see the results immediately beneath the cells as you would normally have by using ggplot with R or Python:

Kotlin bindings for NumPy

NumPy is a popular package for scientific computing with Python. It provides powerful capabilities for multi-dimensional array processing, linear algebra, Fourier transform, random numbers, and other mathematical tasks. Kotlin Bindings for NumPy is a Kotlin library that enables calling NumPy functions from Kotlin code by providing statically typed wrappers for NumPy functions.

Contribution

The entire Kotlin ecosystem is based on the idea of open source and would not be possible without the help of many contributors. Kotlin for data science is only emerging and needs your help now as ever! Here’s how you can pitch in:

  • Talk about your pain points and share your ideas on how to make Kotlin even better-suited for data-science tasks – your tasks.
  • Contribute to the open source data-science-related libraries, and create your own libraries and tools – anything that you think can help Kotlin become a language of choice for data science.

The Kotlin community has a dedicated channel called #datascience in its Slack. We invite you to join this channel to ask questions, find out in what areas help is needed and how you can contribute, and of course share your feedback and your work with the community.

Keep in mind that Kotlin is still in the very early stages of becoming the tool of choice for data scientists. It’s going to be an exciting and challenging journey! It will require building a rich ecosystem of tools and libraries, as well as adjusting the language design to meet the needs of data-related tasks. If you see things not working as you would expect, please share your experience – or get involved and help fix them. Give them a try, especially the Jupyter kernel and libraries, and share your feedback with us.

Resources

Most of the information in this post, and much more, can be found on the official Kotlin website.

KotlinConf 2019 had more inspiring talks about data science, including a Kotlin for Science by Alexander Nozik and another one Gradient Descent with Kotlin by Erik Meijer.

We also recommend watching these talks from the past two KotlinConf conferences: a talk by Holger Brandl (the creator of krangl, Kotlin’s analog of Python’s pandas), and this talk by Thomas Nield (the creator of kotlin-statistics).

That’s it for today (and probably for this year). Wrapping it all up, the community is adopting Kotlin for data science at a good pace, so now it’s your turn.

Let’s Kotlin!

Posted in Data Science, Libraries, Tools | Tagged , , | 1 Comment

What to Expect in Kotlin 1.4 and Beyond

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

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.

Kotlin 1.4 that is going to arrive in spring 2020 will make another step forward for the Kotlin ecosystem.

Focusing on quality

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 below.

Continue reading

Posted in Roadmap | Tagged | 18 Comments

Kotlin 1.3.60 Released

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 more Kotlin/Native platforms/targets.
  • Improving the Kotlin/MPP IDE experience.
  • For Kotlin/JS, adding support for source maps and improving the platform test runner integration.
  • Preview for some already implemented features of Kotlin 1.4.

You can find the complete list of changes in the change log. As always, we’re really grateful to our external contributors.

Let’s dive into the details!

Language changes

An incremental release doesn’t bring any language changes other than minor improvements (like changing confusing error messages) or updates for experimental features (like inline classes). To take a sneak peek at what is coming in Kotlin 1.4, read the corresponding section below.

Continue reading

Posted in Releases | Tagged | 13 Comments

KotlinConf 2019 Live: Join the Broadcast, Attend the Q&A!

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 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”.

stream_banners_1200x628
We 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 #kc19ask hashtag, and then tune into the Closing Panel live stream to get the answers.

There is also another cool opportunity to watch KotlinConf 2019 together with your community. Host a KotlinConf 2019 Global meetup and get support from JetBrains! Learn more about these events in our blog post and submit your own event for support.

What, when, and how

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 scheduled at the conference website (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 @kotlinconf for the latest updates. The closing panel broadcast will begin on December 6, at 4:15 PM GMT.

Join the broadcast on the kotlinconf.com home page at any time. Sign up for reminders 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.

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.

Enjoy KotlinConf 2019!

Posted in community, Events | Tagged , | 2 Comments

KotlinConf 2019 Global: Join In!

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 one more wonderful opportunity for Kotlin lovers: get together for KotlinConf 2019 Global with your local user group!

KC19_Global_badge_Blogpost

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.

Submit your Event

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.

Before you submit an event, please make sure to announce it on your website or any other suitable platform.

Submit an event

KotlinConf 2019 Live Stream

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.

The keynote and session recordings should be available within the next two weeks following the conference. Follow @kotlinсonf for the latest information.

KotlinConf Global Branding

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.

Branding materials

Posted in community, Events | 13 Comments