WebAssembly / WebAssembly/binaryen

Improve scheme to generating internal names

Open
#2,504 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first bug help wanted
Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
1d 19h
Merged PRs (30d)
69

Description

Today binaryen will use the name section to come up with internal names for things.

However in the absence of the name section it will always call things non-meaningful things such as $1 or or $fimport1.

In wasm-objdump we fall back to taking names from the import and/or export string, so if an non-named function is imported as "foo" then we use "foo" for its name. This would, of for example, make the output of wasm-dis more readable (IMHO).

Contributor guide

Open the contributing guide

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 tracing how wasm-objdump derives names from import and export strings when the name section is absent, then compare that behavior with the naming used by wasm-dis. The change is done when unnamed items receive meaningful names from their import or export strings instead of generic names such as $1 or $fimport1.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
compilers
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.