Say, for example, I want a byte buffer that is backed by
ByteBuffer on the JVM and
Uint8Array in JS. Can this be done seamlessly without the caller knowing what environment he is in? I know how I would do this in ScalaJS. In my lib, I am trying to avoid having shared JVM/JS code all take a big
Platform abstraction and have huge impls for JVM/JS and make the caller know about it.
I want the caller to not care and I want to choose a proper platform impl (even for native). It is not feasible for me to write my own in Kotlin wrapping a byte array because of efficiencies in the platform-specific versions. Any examples of this?