Skip to content

[2020 Theme Proposal] IPFS in Rust #54

@Gozala

Description

@Gozala

Theme description

Rust is a high performance language with on garbage collection & type system that provides memory safety guarantees that no other system language offers that make it a great fit for performance critical software and constrained environments like embedded devices. Furthermore, Rust has best support for WASM and working groups collaborate tightly to ensure that uncompromising results.

Core needs & gaps

At the moment there are two primary implementations of IPFS in Go and JS & it is not uncommon to incur incompatibilities or features that take longer to roll out while both implementations catch up. Implementation effort is duplicated & testing is also complicated as everything needs to be verified for interoperability or assumed to have no issues at risk of having those.

As IPFS becomes more mainstream integrating with system software like browsers becomes more relevant and both Go & JS implementations seem like an inadequate solutions for browser vendors to consider. Rust implementation could provide a viable option. Some vendors are already shipping some rust and others can easily embed it as compiled system library without runtime overhead.

In short rust can make IPFS applicable to wider range of use cases & at the same time reduce implementation / maintenance / quality control efforts.

Why focus this year

The longer we wait the more difficult task it becomes due to growing code base and consumer base, not to mention the longer we wait the slimmer the chance of migration become.

Additionally there seems to be an effort to revamp APIs and specs (e.g. new stuff coming in IPLD, JS code base moving to async await, etc...) Rust type system provides a great way to document interface to much greater detail (than go) and ensure that it's true to implementation. Having well defined & documented IPFS (that never gets out of sync with implementation) would really help adoption.

WASM system interface is in active development and so is rust async runtime which is to suggest now might be an only opportunity to inform & influence design of both. Later would imply hoping for the best and living with a consequences.

Milestones & rough roadmap

  • IPLD in Rust
  • IPLD rust replaces IPLD in go through a system library
  • IPLD rust / wasm replaces JS IPLD
  • Rust IPFS
  • WASM IPFS
  • WASM IPFS effectively replacing JS IPFS, or rather JS IPFS becomes a thin wrapper of WASM IPFS
  • Rust IPFS replacing other component of Go IPFS
  • Go IPFS is just a Rust IPFS wrapper for backwards compatibility

Desired / expected impact

How will we measure success? What will working on this problem statement unlock for future years?

  • 📉 JS / Go duplication effort reduced.
  • 📊 Target runtimes Rust implementation unlocks.
  • 📉 System resource usage in comparison to existing implementations.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions