WebAssembly / WebAssembly/multibyte-array-access

Support for all primitive array types (i16, u8, f32, etc.)

Open
#3 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
4
Forks
1
Avg merge
16h 35m
Merged PRs (30d)
1

Description

I have a feeling that limiting this proposal to only work on i8 arrays (i.e. (array i8) and (array (mut i8))) would not really bring any benefits with regard to ease of implementation, and would only preclude other potential use-cases. Given that the current version of this proposal already assumes that i8 arrays are likely to be backed by some packed memory buffer through which performant multi-byte accesses are possible, I don't think it's a stretch to further assume that all array types with any primitive or packed numeric type will be backed by untyped memory buffers which can also support multibyte array accesses.

For example, the JS String Builtins proposal works with the (array (mut i16)) type to represent UTF-16 characters in strings. By limiting this proposal to just i8 arrays, it would still not be possible to speed up certain string operations with SIMD, which could otherwise enable faster parsing, string lookups, regular expressions, etc. Remember that in the current GC proposal, there is no way to cast between different array types.

@brendandahl let me know what you think about this.

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 reading the current multibyte-array-access proposal and the linked JS String Builtins proposal, focusing on how primitive and packed numeric array types are represented. The issue names no files or tests; done would be a resolved proposal decision on whether and how all primitive array types are supported.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.