
Facilitates type-safe arithmetic operations for physical quantities using SI units, enabling logical modeling of quantities and customizable unit extensions with easy extensibility for custom formulas.
Manage physical units. Inspired by kotlin.time.Duration. Alchemist allow type safe arithmetic between different physical quantities defined in the International System of Units.
val time: Duration = 10.seconds
val length: Length = 10.kilometers
val velocity: Velocity = length / time
val acceleration: Acceleration = velocity / time
val mass: Mass = 10.kilograms
val force: Force = acceleration * mass
val energy: Energy = force * length
val power: Power = energy / time
val area: Area = length * length
val volume: Volume = length * length * length[versions]
alchemist = "0.2.0"
[libraries]
alchemist = { module = "io.github.kevincianfarini.alchemist:alchemist", version.ref = "alchemist" }Long value.power = energy / time.Power or Rankine degrees for Temperature.energyₖ = ½ * mass * velocity².energyₖ = ½ * mass * velocity².| Platform | Compiled | Tested in CI |
|---|---|---|
| androidNativeArm32 | ✅ | ❌ |
| androidNativeArm64 | ✅ | ❌ |
| androidNativeX64 | ✅ | ❌ |
| androidNativeX86 | ✅ | ❌ |
| iosArm64 | ✅ | ❌ |
| iosSimulatorArm64 | ✅ | ✅ |
| iosX64 | ✅ | ✅ |
| js | ✅ | ✅ |
| jvm | ✅ | ✅ |
| linuxArm64 | ✅ | ❌ (Prohibited by Tier 2 support.) |
| linuxX64 | ✅ | ✅ |
| macosArm64 | ✅ | ✅ |
| macosX64 | ✅ | ✅ |
| mingwX64 | ✅ | ✅ |
| tvosArm64 | ✅ | ❌ |
| tvosSimulatorArm64 | ✅ | ✅ |
| tvosX64 | ✅ | ✅ |
| wasmJs | ✅ | ✅ |
| wasmWasi | ✅ | |
| watchosArm32 | ✅ | ❌ |
| watchosArm64 | ✅ | ❌ |
| watchosDeviceArm64 | ✅ | ❌ |
| watchosSimuatorArm64 | ✅ | ✅ |
| watchosX64 | ✅ | ✅ |
Manage physical units. Inspired by kotlin.time.Duration. Alchemist allow type safe arithmetic between different physical quantities defined in the International System of Units.
val time: Duration = 10.seconds
val length: Length = 10.kilometers
val velocity: Velocity = length / time
val acceleration: Acceleration = velocity / time
val mass: Mass = 10.kilograms
val force: Force = acceleration * mass
val energy: Energy = force * length
val power: Power = energy / time
val area: Area = length * length
val volume: Volume = length * length * length[versions]
alchemist = "0.2.0"
[libraries]
alchemist = { module = "io.github.kevincianfarini.alchemist:alchemist", version.ref = "alchemist" }Long value.power = energy / time.Power or Rankine degrees for Temperature.energyₖ = ½ * mass * velocity².energyₖ = ½ * mass * velocity².| Platform | Compiled | Tested in CI |
|---|---|---|
| androidNativeArm32 | ✅ | ❌ |
| androidNativeArm64 | ✅ | ❌ |
| androidNativeX64 | ✅ | ❌ |
| androidNativeX86 | ✅ | ❌ |
| iosArm64 | ✅ | ❌ |
| iosSimulatorArm64 | ✅ | ✅ |
| iosX64 | ✅ | ✅ |
| js | ✅ | ✅ |
| jvm | ✅ | ✅ |
| linuxArm64 | ✅ | ❌ (Prohibited by Tier 2 support.) |
| linuxX64 | ✅ | ✅ |
| macosArm64 | ✅ | ✅ |
| macosX64 | ✅ | ✅ |
| mingwX64 | ✅ | ✅ |
| tvosArm64 | ✅ | ❌ |
| tvosSimulatorArm64 | ✅ | ✅ |
| tvosX64 | ✅ | ✅ |
| wasmJs | ✅ | ✅ |
| wasmWasi | ✅ | |
| watchosArm32 | ✅ | ❌ |
| watchosArm64 | ✅ | ❌ |
| watchosDeviceArm64 | ✅ | ❌ |
| watchosSimuatorArm64 | ✅ | ✅ |
| watchosX64 | ✅ | ✅ |