Skip to content

WasmFS: Backends to access legacy JS FS backends #18935

Open

Description

@tlively

Developers who use Emscripten's persistent file system backends like IDBFS have users who have data persisted in the formats used by those backends. If those developers want to migrate to WasmFS, they will still need to be able to access that persisted data via WasmFS.

One way to accomplish this would be to implement new WasmFS backends that reimplement the same storage schemes as the old JS backends. This would have the benefits of potentially being able to improve on the performance of the old backends and being able to move more code to C++, but would have the downside of needing to be bug-compatible with the older JS code.

Another way to accomplish this would be to have a small WasmFS backend that calls out to the legacy FS to reuse the legacy code directly. This would make compatibility a non-issue, but would not have any of the performance benefits that new backends might have.

Overall I would expect the second approach to be simpler and more maintainable given that we want to prioritize performance improvements and bug fixes in WasmFS and its new backends rather than in the legacy file system.

The C++ portions of existing WasmFS backends can be found in system/lib/wasmfs/backends/ and their JS counterparts can be found in the library_wasmfs_*.js in src/.

If we completed this backend bridge layer as well as the JS API bridge layer (#15976), that would allow us to enable WasmFS by default without breaking any existing programs.

Activity

  1. converted this from a draft issue on Mar 10, 2023
  2. sbc100 commented on Mar 10, 2023

    @sbc100
    Collaborator

    I think a bridge to the legacy backends makes more sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions