Skip to content

Rename thread_spawn import#387

Merged
abrown merged 1 commit into
WebAssembly:mainfrom
yamt:thread-spawn-wit-abi
Jan 25, 2023
Merged

Rename thread_spawn import#387
abrown merged 1 commit into
WebAssembly:mainfrom
yamt:thread-spawn-wit-abi

Conversation

@yamt

@yamt yamt commented Jan 20, 2023

Copy link
Copy Markdown
Contributor

Following the wit-defined ABI:
WebAssembly/wasi-threads#26

@abrown

abrown commented Jan 20, 2023

Copy link
Copy Markdown
Collaborator

I don't think this is right; IIRC, WIT dashes are converted to underscores.

@yamt

yamt commented Jan 23, 2023

Copy link
Copy Markdown
Contributor Author

I don't think this is right; IIRC, WIT dashes are converted to underscores.

wit-bindgen seems to convert C identifiers. but not import names.

@yamt yamt marked this pull request as ready for review January 23, 2023 03:37
yamt added a commit to yamt/wasm-micro-runtime that referenced this pull request Jan 23, 2023
@sbc100

sbc100 commented Jan 23, 2023

Copy link
Copy Markdown
Member

I don't think this is right; IIRC, WIT dashes are converted to underscores.

wit-bindgen seems to convert C identifiers. but not import names.

If thats true, I hope its not to late to revisit. I would hope we could choose a convention for import/export names that aligns the symbol names normally found in programming languages. As programmers, we not used to seeing hyphens in the middle of identifiers.

@yamt

yamt commented Jan 23, 2023

Copy link
Copy Markdown
Contributor Author

I don't think this is right; IIRC, WIT dashes are converted to underscores.

wit-bindgen seems to convert C identifiers. but not import names.

If thats true, I hope its not to late to revisit. I would hope we could choose a convention for import/export names that aligns the symbol names normally found in programming languages. As programmers, we not used to seeing hyphens in the middle of identifiers.

as preview2 heavily uses names with hyphens, i thought it was the latest trend.
eg.

    (import "wasi-filesystem" "append-via-stream" (func $_ZN22wasi_snapshot_preview18bindings15wasi_filesystem17append_via_stream10wit_import17hd102ec87cb8cdfd2E (;2;) (type 2)))

wrt this specific change, i even have confirmed the intention explicitly: WebAssembly/wasi-threads#26 (comment)
at least it was @loganek 's intention to use hyphen.

@abrown

abrown commented Jan 23, 2023

Copy link
Copy Markdown
Collaborator

wit-bindgen seems to convert C identifiers. but not import names.

Yeah, sorry to confuse things; I was mistaken. Indeed, like @yamt says, the import names will have hyphens. But the C generated from WIT would have the expected underscores. Since this is what users would typically interact with, I think it is fine for the lower level WIT names to use the "almost a convention" hyphens that WIT has transitioned to.

@sbc100

sbc100 commented Jan 23, 2023

Copy link
Copy Markdown
Member

wit-bindgen seems to convert C identifiers. but not import names.

Yeah, sorry to confuse things; I was mistaken. Indeed, like @yamt says, the import names will have hyphens. But the C generated from WIT would have the expected underscores. Since this is what users would typically interact with, I think it is fine for the lower level WIT names to use the "almost a convention" hyphens that WIT has transitioned to.

I guess I missed that transition. Maybe it happened a repo I'm not tracking.

@yamt

yamt commented Jan 23, 2023

Copy link
Copy Markdown
Contributor Author

wit-bindgen seems to convert C identifiers. but not import names.

Yeah, sorry to confuse things; I was mistaken. Indeed, like @yamt says, the import names will have hyphens. But the C generated from WIT would have the expected underscores. Since this is what users would typically interact with, I think it is fine for the lower level WIT names to use the "almost a convention" hyphens that WIT has transitioned to.

I guess I missed that transition. Maybe it happened a repo I'm not tracking.

honestly speaking, i feel the transition a bit awkward and am curious about rationales.
but i guess it isn't something specific to this PR.

@abrown

abrown commented Jan 25, 2023

Copy link
Copy Markdown
Collaborator

i guess it isn't something specific to this PR

Yeah, we should bring up the name convention change in the next WASI meeting. In the meantime, should I merge this?

@sbc100

sbc100 commented Jan 25, 2023

Copy link
Copy Markdown
Member

i guess it isn't something specific to this PR

Yeah, we should bring up the name convention change in the next WASI meeting. In the meantime, should I merge this?

sgtm

@abrown abrown merged commit 8f52757 into WebAssembly:main Jan 25, 2023
yamt added a commit to yamt/wasm-micro-runtime that referenced this pull request Jan 25, 2023
wenyongh pushed a commit to bytecodealliance/wasm-micro-runtime that referenced this pull request Jan 26, 2023
yamt added a commit to yamt/wasi-threads that referenced this pull request Feb 1, 2023
john-sharratt pushed a commit to john-sharratt/wasix-libc that referenced this pull request Mar 6, 2023
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
liujinye-sys pushed a commit to open-vela/apps_interpreters_wamr that referenced this pull request Apr 21, 2026
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