Skip to content

CONCEPT Cited by 1 source

Cross-platform client library

A cross-platform client library is a single shared implementation of a capability (media processing, TLS, crypto, state sync, networking) compiled and shipped to multiple end-user platforms — Android, iOS, Mac, Windows, Web, Wearables — typically by a large consumer app that doesn't want per-platform drift.

Why apps do this

  • Consistency. The library's behaviour is identical on every platform — bug-for-bug, feature-for-feature. This is security-critical for parsing / validating untrusted input: divergence is a parser-differential attack surface.
  • Investment amortisation. Write once, run everywhere — avoid duplicated engineering effort on per-platform implementations that must each be kept in sync.
  • Security consolidation. If the library is security-critical (media parsing, crypto), you want only one copy to audit, fuzz, and patch.

What it costs

  • Build-system complexity. Each platform has its own toolchain (Xcode, Gradle, WebAssembly, platform-specific Wearable OSes). The library's chosen source language has to compile down to everything those toolchains consume. Meta calls this out explicitly on the 2026-01-27 wamedia post: "the build system support required for the diverse platforms supported by WhatsApp. WhatsApp made a long-term bet to build that support."
  • Binary-size tax. Non-native choices (Rust's std lib, Kotlin-MP runtime, Swift runtime on Android, etc.) add size. Meta reports "initial binary size increase due to bringing in the Rust standard library" as a named hurdle — concepts/binary-size-bloat adjacency.
  • Platform-idiom friction. Calling the library from each platform's native idiom (Kotlin, Swift, JS/TS, C++) requires FFI / bindings / codegen that lag when the library's interface changes.

Language choices

Historically, C++ has been the lingua franca (compiles on every platform, zero-footprint runtime, first-class interop). WhatsApp's wamedia started here.

As of 2026, Rust is demonstrably viable as the cross-platform client-library language at scale — Meta's wamedia Rust rewrite ships to Android/iOS/Mac/Web/Wearables, which Meta calls "the largest ever deployment of Rust code to a diverse set of end-user platforms and products that we are aware of." Rust's memory-safety wins the security axis; the binary-size + build-system costs are real but payable by a large-enough engineering org.

Seen in

Last updated · 319 distilled / 1,201 read