WebAssembly / WebAssembly/WASI
[http] Request and Response's `new` method is reserved in many languages, inconsistent with sockets.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.8k
- Forks
- 333
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 3
Description
Languages like Java and C++ disallow static methods named new, so methods like new on Request will have to be modified to something like new_. That's fairly ugly, so a better option would be something like create, which isn't a reserved word in any mainstream language that I know of.
new is also inconsistent with tco-socket and udp-socket which already use create: https://github.com/WebAssembly/WASI/blob/39c11a76958d015ace3f1bf68500057a28c7837f/proposals/sockets/wit/types.wit#L195
So it'd be both a translation and consistency win to rename new to create.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading proposals/http/wit/types.wit at the linked Request and Response definitions, then compare the constructor naming with proposals/sockets/wit/types.wit at the linked tco-socket and udp-socket definitions. Done means the HTTP constructors use create rather than new and are consistent with the socket interfaces.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100