Kotlin/Native BigDecimal: A drop-in replacement for java.math.BigDecimal | Jan Holesovsky

Kotlin by JetBrains
Kotlin by JetBrains
4.8 هزار بار بازدید - 3 هفته پیش - Recording brought to you by
Recording brought to you by American Express. https://americanexpress.io/kotlin-jobs

When porting an app to iOS using Kotlin/Native, it turned out that I needed a BigDecimal implementation. But there was no drop-in replacement that I could use, so I decided that I would port java.math.BigDecimal from the Android (AOSP) sources to Kotlin/Native.

In this presentation, you will learn some details about how java.math.BigDecimal is implemented, how I've converted it to Kotlin, and about how I've rewritten the JNI code to cinterop to call a 3rd party library (BoringSSL) that is used for the actual big number computation.

The talk will discuss technical difficulties of converting the Java sources to Kotlin (easy task), building BoringSSL for iOS Simulator and device (advanced task), and creating the glue code to call the 3rd party native library via cinterop (hard task).

Kotlin/Native BigDecimal is available under Apache License v2 and the source code is hosted on GitHub:

https://github.com/kendy/Kotlin-Nativ...

It is used in production in HiPER Scientific Calculator that has over 40 million downloads on Android, and achieved 500 thousand downloads on iOS in a year.
3 هفته پیش در تاریخ 1403/04/17 منتشر شده است.
4,806 بـار بازدید شده
... بیشتر