Skip to content

c-api: component-model: Values and function calling #10697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

MangoPeachGrape
Copy link
Contributor

@MangoPeachGrape MangoPeachGrape commented Apr 29, 2025

Only contains primitive values and no docs as of now. Trying to gauge if this is the correct way to approach this.

Some things of note:

  • wasmtime_component_valunion_t::boolean instead of ::bool because keyword.
  • wasmtime_component_valunion_t::f32 and WASMTIME_COMPONENT_F32 instead of float32, should this be changed to be consistent?
  • C++20 needed for syntax used when creating wasmtime_component_val_t in the test, so I bumped to 20 only for tests. Is that fine? Could the whole project be bumped to 20?

Also, is there any better way to test all values, other than copying the test for each kind of value?

@MangoPeachGrape MangoPeachGrape requested a review from a team as a code owner April 29, 2025 16:36
@MangoPeachGrape MangoPeachGrape requested review from pchickey and removed request for a team April 29, 2025 16:36
@github-actions github-actions bot added the wasmtime:c-api Issues pertaining to the C API. label Apr 29, 2025
@ac000
Copy link

ac000 commented Apr 29, 2025

Could the whole project be bumped to 20?

My feeling is that is a bit too recent, even GCC 15.1 just released still defaults to -std=gnu++17 for C++. Though admittedly I don't really know which bits of wasmtime that would effect. Like how would that affect building wasmtime on older (but still supported, thinking Debian, RHEL etc) Linux distributions?.

Also, is there any better way to test all values, other than copying the test for each kind of value?

An array of structs of the values perhaps?

@pchickey pchickey requested review from alexcrichton and removed request for pchickey April 30, 2025 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasmtime:c-api Issues pertaining to the C API.
2 participants