PariKt is a Kotlin Multiplatform library for evaluating PARI/GP commands from Kotlin.
PariKt is based on PariDroid.
It supports JVM, Android (minSdk 21), JavaScript, WebAssembly, and Kotlin/Native for Linux x64, Windows x64, macOS, iOS, tvOS, and watchOS. Apple tests ran on Intel and Apple Silicon Macs and in Apple simulators. See the Apple target guide for coverage.
Choose an installation method, then evaluate a GP command from a coroutine or suspending function:
import com.elianfabian.parikt.PariKt
suspend fun factorExample() {
PariKt.init()
try {
println(PariKt.eval("factor(123456)"))
} finally {
PariKt.close()
}
}- Gradle source installation and a standalone consumer example
- Maven coordinates and engine-tools setup
Select the PARI engine independently of the PariKt library version. Put the default in your
project’s root parikt.properties and use module-local files to override it:
pari.version=2.19.0The build fetches and compiles engines on demand and reuses compatible cached outputs.
- Platform setup, build commands, and sample apps
- Project structure and verification scripts
- Tested Kotlin versions
- Maven Central release process
PariKt is licensed under GPL-3.0-or-later, the license of the PariDroid bridge it incorporates. PARI/GP is GPL-2.0-or-later, which permits use under GPLv3.