Linux Development Support On Kotlin Native

Nick Apperley
5 min readJul 26, 2020

Many different platforms are supported by Kotlin Native however most of the focus goes to mobile platforms. This heavy focus has caused a lack of focus on Linux platforms which should be receiving the same amount of support as the mobile platforms. The message being presented in the What to Expect in Kotlin 1.4 and Beyond article doesn’t match reality:

Our vision is for Kotlin to be a reliable companion for all your endeavours, a default language choice for your tasks. To accomplish this, we’re going to make it shine on all platforms.

With the way things are going with Linux platform support Kotlin isn’t going to shine there, unless the Kotlin Native team significantly increase focus on the Linux platforms. Already most of Kotlin Native’s eggs are in the mobile platform basket. If Kotlin Native fails on the mobile development side then Kotlin Native’s adoption will falter, and Kotlin Native’s future will be in limbo. Instead of having this precarious situation Kotlin Native should have most of its eggs split evenly between mobile, and Linux platforms. There is safety in numbers with having the eggs spread out into multiple baskets.

Current Issues

Most official Kotlin Native blog posts have been focused on mobile development, which gives the impression that Kotlin Native is only for mobile development. This isn’t true however the Kotlin Native team haven’t been helping matters with their recent efforts. A recent example of this is the Kotlin/Native Memory Management Roadmap article where the catalyst for changing the memory management is on the mobile development side. It remains to be seen if this has a detrimental effect on other areas of software development with Kotlin Native.

Most Kotlin Native videos concentrate on mobile development, which once again enforces the ”Kotlin Native is only for mobile development” impression. This detracts attention from the support that is needed for Linux and other platforms that are available as Kotlin Native targets. One wonders why Kotlin/Native hasn’t been renamed to Kotlin/Mobile. On a serious note Kotlin Native does have support for other platforms however they don’t get the attention they deserve. So far the Kotlin Native team haven’t done a video covering Linux development with Kotlin Native. The Kotlin Native team need to be doing more Kotlin Native webinars/videos that cover different software development areas other than mobile.

Whenever there is a issue on the Linux development side with Kotlin Native it often takes a backseat in favour of mobile development. One classic case is the missing Linux ARM support for the KotlinX Coroutines library. If there was a significant focus on Linux platforms with Kotlin Native then this issue would be much more likely be addressed instead of being shelved.

Importance Of Linux Development

Although Linux isn’t widespread on desktops it is widespread on many different types of devices. It is very likely that you are using Linux everyday but don’t realize it. On the cloud side a majority of servers run Linux, over 850,000 Android Smartphones are sold daily which run Linux, and over 700,000 TV’s/Settop boxes are sold daily running Linux (How Linux is Built). Linux is the leading OS for IoT edge/gateway devices (at 76%) according to the latest Eclipse IoT survey.

One should not underestimate the business importance of the IoT markets. According to some IoT statistics the number of active IoT devices reached 26.66 billion. Every second there are 127 new IoT devices connected to the web. It is estimated that 31 billion IoT devices will be installed during 2020. Below are some IoT revenue statistics:

  • Global IoT spending in 2016 reached $737 billion
  • Estimated global IoT revenue by 2026 will likely reach $1.1 trillion (presumably higher than revenue from mobile applications)
  • Estimated Industrial IoT revenue will likely reach $124 billion by 2021
  • Estimated Healthcare IoT revenue will likely reach $14 billion by 2024

Even with a small chunk of the IoT markets there is a lot of money involved. Linux has a significant presence in these markets, which would be foolish to ignore considering the business opportunities with Linux development in these markets.

Linux development provides many software development opportunities, and access to an enormous number of devices that run Linux, which many people/businesses use around the world. As a platform Linux is very versatile, and isn’t constrained to a small range of devices. The barrier to entry for Linux development is very low with the main requirement being a PC or Mac, which uses a multi-core CPU, and has at least 8 GB of RAM. Linux software can be easily ported to different CPU architectures with little modification. Not all Linux development is system level (involving the Linux kernel). There are plenty of opportunities to get involved in high level Linux development.

Improvements

Many improvements can be made to improve Linux development support on Kotlin Native. One of the big ones is to provide a range of memory models that aren’t constrained to mobile platforms, and work well on Linux and other platforms. Another big improvement is to have a Kotlin Native Linux Development survey, where the Kotlin Native team use the feedback to improve Linux platform support, and gain a better understanding of the needs of Linux developers using/or planning to use Kotlin Native. Other improvements that can be made include the following:

  • The Kotlin Native team host a webinar covering Linux development with Kotlin Native
  • In the official Kotlin Native blog cover improvements made to Linux platform support
  • Provide a dedicated sub section on the official Kotlin website for Linux development in the Kotlin Native section
  • Include documentation on setting up a Docker container to run a Kotlin Native program on a Linux distribution
  • Provide tooling to remotely deploy/manage Kotlin Native programs running on Linux targets
  • More Kotlin libraries developed by JetBrains to provide support for one or more Linux platforms
  • Provide a tool for locating/identifying possible memory leaks in a Kotlin Native program running on a Linux target
  • Add a wizard in IntelliJ/CLion to quickly get started with creating a new Kotlin Native project that targets one or more Linux platforms
  • Fix longstanding C interop issues with the bundled Linux libraries
  • Have a system to easily dynamically/statically link C libraries that is Linux distribution agnostic (aka not tied to a single Linux distribution)
  • Some members of the Kotlin Native team do presentations at some Linux conferences (Linux Conf Au, FOSDEM, OSCON etc)

Conclusion

It remains to be seen if Linux development support significantly improves with Kotlin Native. The Kotlin Native team have many opportunities to improve support for Linux development where, ”the proof will be in the pudding”. Do the Kotlin Native team know what the needs of Linux developers are? One wonders if the Kotlin Native team take Linux development seriously, or is it just a checkbox to be ticked in a list?

--

--