Skip to content

Support inline packages #313

@tschneidereit

Description

@tschneidereit

@alexcrichton brought up the idea of supporting packages in-line in a file in addition to the package statement. This would help with bundling world definitions into single files as part of things like runtime / language SDKs, which is often very useful.

As a concrete example, wasmtime is considering to include binary representations of the two worlds it implements instead of the deps folder to ease artifact management. That however makes handling these artifacts more difficult in other ways, including simple human inspection.

If we were able to bundle all the wit files into a single one, containing inline packages, that'd be a much better solution.

The syntax for this seems pretty straightforward to me, but I might be missing something:

package wasi:http@0.2.0 {
  world proxy { ... }
  interface incoming-handler { ... }
  interface types { ... }
}

package wasi:random@0.2.0 {
  world imports { ... }
  interface random { ... }
  interface insecure { ... }
  interface insecure-seed { ... }
}
[... other packages as needed]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions