WebAssembly / WebAssembly/component-model

Static and dynamic libraries

Open
#359 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
1.4k
Forks
130
Avg merge
2d 1h
Merged PRs (30d)
15

Description

Is there a specification to mark whether a component model should be (as a suggestion) a static library or a dynamic library?

Assume lib.wasm is a library, app.wasm is an application, and depends on lib.wasm.

  • Static library means the product is only one file [app-final.wasm]
  • Dynamic library means the product is two files [app-final.wasm, lib.wasm]
    • Unless the user forces static linking of this library (similar to --static-link lib.wasm)

Motivation

Although dynamic linking hell is a very bad problem, I think limited dynamic linking helps reduce the overall size of the final executable file

I developed a command line tool legion.wasm, which automatically looks for legion-plugin.wasm when encountering unknown instructions.

The plugin needs to use some definitions of the original application, which makes the plugin even larger.

Therefore, I hope there is some convention to specify that some dependencies should be compiled as a shared library as a whole, This can effectively reduce the overall size.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the component model specification and the issue's existing discussion about static and dynamic library behavior. Determine whether the model needs a convention for dependency linking and how forced static linking would be represented. Done means the behavior and any required specification changes are agreed and documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.