Skip to content

Library functionality: toUpperCase, etc #5

Open

Description

Image for: Description

From wingo/stringrefs#35, if we think about a browser deployment environment, we would like to avoid a situation in which two parts of a running system are implementing toUpperCase on a JavaScript string. If WebAssembly needs this or related string functionality, it should be able to use what's already in the browser.

So what's the story here? A couple options:

  1. Wild west: if you know you're targetting a browser, generate an associated JS wrapper that calls the String.prototype or Intl.prototype functions that you need
  2. Standard library: Regardless if you're targetting WASI or the web, you know there is a standard module you can import that provides the functionality you need. On the web, such a module delegates to String, Intl, and so on.
  3. Core: There is a string.to_upper instruction. Lots more, probably.

I have to say, I see (1) as an OK short-term answer and (2) as a nice end result. I wouldn't do (3) but who knows!

Metadata

Image for: Metadata

Metadata

Image for: 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

    Image for: Issue actions