python / python/cpython

Use wasm-gc to handle pointer casts in wasi

Open
#129,040 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OS-wasi type-feature
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

In #128628 I switched the way of handling function pointer casts in emscripten to an approach based on wasm-gc. Unlike the previous approaches this should work on the wasi targets, at least the ones that include wasm-gc. There's some difficulty in that there's no support for the instructions in the clang C front end, nor really in the backend yet. So I'm not sure what is the best way to emit these instructions. We only would need to generate one short function using them though.

@brettcannon WDYT?

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

Review issue #128628 and the existing emscripten approach to function pointer casts, then investigate how wasm-gc instructions could be emitted for WASI targets. The issue notes missing support in the Clang C front end and backend; done means pointer casts work on WASI targets that include wasm-gc.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, wasm
Domain
compilers, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.