Skip to content

String builtins merge, passing builtinSetNames and stringConstant#115

Merged
guybedford merged 2 commits intomainfrom
builtins-merge
Mar 4, 2026
Merged

String builtins merge, passing builtinSetNames and stringConstant#115
guybedford merged 2 commits intomainfrom
builtins-merge

Conversation

@guybedford
Copy link
Collaborator

@guybedford guybedford commented Oct 4, 2025

With the spec now merged to the latest, we can explicitly integrate with the JS String Builtins proposal, passing the builtinSetNames and stringConstant parameters to module construction.

This explicitly now passes « "js-string" » for the builtinset.

For the string constant, we had a bikeshed discussion in #118, which led to the conclusion of wasm:js/string-constants, which is specified here as well.

// cc @eqrion

@eqrion
Copy link
Contributor

eqrion commented Oct 8, 2025

@guybedford Overall LGTM. I'm uncertain about the string constants import though.

I think we'd be unhappy if we were always stuck with wasm-js:strings (a verbose name) and also compact-imports is not standardized. I'd also think we'd be unhappy if we were always stuck with a short non-descriptive name like $ and compact-imports was standardized.

My understanding is that not picking a name for string constants now doesn't preclude us from picking one later? So could we continue to defer the question? I know I've not made any progress on compact-imports recently, but I do hope to pick it up soon. I think if that moves to phase 2 we'll have more clarity here.

@guybedford
Copy link
Collaborator Author

guybedford commented Oct 8, 2025

@eqrion thanks for taking a look here.

I wonder if compact imports could be framed as an optimization that would result in a single instance import like ("wasm-js:strings" "*") then being aliased off of, so that if/when we have compact imports, there would only be a single wasm-js string in the binary and that that would be something we could be ok with?

That is, can we make this decision in anticipation of compact imports that "wasm-js:strings" would work? Or would you also be concerned that there might be other factors here? And if so, what sorts of compact imports factors might alter how we'd think about this?

Would be good to discuss this further. Yes we can wait on this decision here, and still be able to decide later. But string constants are also an important piece of the string builtins story that we shouldn't delay on unnecessarily either.

@lukewagner
Copy link
Member

Just my 2c on wasm: vs wasm-js:: although longer, wasm-js is attractive since it makes it clear from both a JS/ESM and wasm perspective that we're talking about "JS built-ins exposed to wasm" and keeps wasm: open for hypothetical pure-wasm builtins as well as non-JS builtins exposed to wasm.

@guybedford
Copy link
Collaborator Author

Will aim to land this next week now that compact imports progress is clear, any further thoughts or comments welcome.

@guybedford guybedford merged commit 7985880 into main Mar 4, 2026
12 checks passed
@guybedford guybedford deleted the builtins-merge branch March 4, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants