Industry: Software development
JetBrains products used: Kotlin Multiplatform Mobile
Mirego is an end-to-end digital product team. They work with major brand names as well as startups to envision, define, design and develop new digital products and services that fuel their growth.
Could you say a few words about your company?
Mirego was founded in 2007 by managers and developers from Copernic with a simple objective: to build the greatest team, the best workplace and a better world. For the past 12 years, our team has focused on one single thing: creating game-changing digital products that fuel our clients’ digital transformation. Keeping that focus, we’ve built a unique expertise in what we believe truly matters when it comes to creating successful products: product strategy, design and engineering.
Are there any statistics you’d like to share, for example, numbers of users and downloads?
- ~ 20 Kotlin Multiplatform developers
- 8 Open sourced Kotlin Multiplatform libraries at the time of writing
- 7 active Kotlin Multiplatform projects for clients
How is Kotlin Multiplatform used in your product (maybe with respect to its architecture scheme)?
The Mirego team developed multiple higher-level libraries to accelerate multiplatform development. We named this ecosystem Trikot. They are now open sourced and can be found on Github.
When using Trikot, the shared code is imported by the native code. In a sense, it is the native code that forms the application’s outer shell. It then imports Trikot as its inner layer to create an interface between the platform and the shared code at its core. All of the common logic shared by every platform is contained within that core. Trikot handles all the data flows between the native and shared code. This explains why the first module we’ve developed within Trikot is an implementation of Reactive Streams for Kotlin Multiplatform. The native platform expert can then create a platform optimized UI, encryption module, Bluetooth interface, or background task scheduler using the native language and SDK and connect it to the business logic in the application’s core.
Why did your team decide to use Kotlin Multiplatform, and what alternatives did you consider?
In 2018, we started re-evaluating our options for multiplatform development. The emerging solutions at the time were React Native and Flutter. We ended up rejecting them for reasons of performance, maturity, or because they didn’t allow our team to tailor applications to each platform. Most of the solutions also required adding a new programming language to the mix, adding a new programming environment, and thus a level of complexity when interacting directly with the platform.
In September 2019, we released TV5Unis, our first public Kotlin Multiplatform project. The same business logic runs on the web, iOS (iPhone and iPad), tvOS, Android (Device & TV), and Amazon Fire TV. From what we heard from the Kotlin community managers, it was the first TV project to be deployed on the stores.
Since then, Kotlin Multiplatform has been the go-to framework for mobile development at Mirego. By the time of writing, we have released a total of 4 successful and still maintained projects built with Kotlin Multiplatform.
What have been your most significant gains and pains?
- Quality of interoperability between shared code and platforms
- Strong supportive community
- Handover to other teams
- Speed of development
- Native strict immutability between threads
- Coroutines are not production-ready for native development
- Libraries incompatible between minor versions of Kotlin Multiplatform
We are working on a replacement for the current memory management implementation in Kotlin/Native. The new memory manager will allow us to lift the restrictions on object-sharing in Kotlin/Native, and it will provide fully leak-free concurrent programming primitives that are both safe and don’t require any special management or annotations from the developer. Existing code will continue to work and will be supported. Read the whole story in our blog.
Do you have any tips or advice you’d like to share with our readers?
- Use Kotlin Multiplatform as a functional language; it solves most of the native Native strict immutability between threads.
- Join the Kotlin slack – you’ll find most of the support you need there.
Martin Gagnon, Co-Founder & Engineering Lead, Mirego
Kotlin slack: Martin Gagnon
Fastwork is one of the largest professional freelancing platforms in Southeast Asia in terms of both the number of users it has and the number of projects completed.
Autodesk introduced Kotlin Multiplatform Mobile to their PlanGrid app to ship a single source of truth for offline sync logic and data models on 3 mobile platforms: iOS, Android, and Windows.