Skip to content
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

feat: Implement typed function references proposal #1123

Closed
Tracked by #1122
hydai opened this issue Jan 30, 2022 · 7 comments
Closed
Tracked by #1122

feat: Implement typed function references proposal #1123

hydai opened this issue Jan 30, 2022 · 7 comments
Labels
enhancement New feature or request LFX Mentorship Tasks for LFX Mentorship participants

Comments

@hydai
Copy link
Member

hydai commented Jan 30, 2022

Introduction

This is one of the requirements for GC proposal.

Typed function references proposal adds function references that are typed and can be called directly. Unlike funcref and the existing call_indirect instruction, typed function references need not be stored into a table to be called (though they can). A typed function reference can be formed from any function index.

Motivation

  • Enable efficient indirect function calls without runtime checks
  • Represent first-class function pointers without the need for tables
  • Easier and more efficient exchange of function references between modules and with host environment
  • Optionally, support for safe closures
  • Separate independently useful features from GC proposal

Details

To finish this ticket,

  1. Get familiar with Wasm Spec.
  2. Dig into Typed function references Spec.
  3. Add the new type definitions and instructions in WasmEdge.
  4. Provide an option for WasmEdge CLI to enable/disable this proposal.
  5. Add unit tests to cover all these functions.

Minimum qualifications

To apply this LFX mentorship, there are some minimum qualifications:

  1. Experience with C++ programming language.
  2. Finish the challenge LFX Mentorship 2022 Spring Challenge - Proposal #1221

Appendix

  1. GC Proposal: https://github.com/WebAssembly/gc
  2. Typed function references Proposal: https://github.com/WebAssembly/function-references
@hydai hydai changed the title typed function references (not yet) feat: Implement typed function references proposal Jan 30, 2022
@hydai hydai added enhancement New feature or request LFX Mentorship Tasks for LFX Mentorship participants labels Jan 30, 2022
@anonymousr007
Copy link

Hello @hydai, I am interested in this project.

@anonymousr007
Copy link

Can you please elaborate a little bit more? I am new in wasm-edge but experienced in c++ programming.

@hydai
Copy link
Member Author

hydai commented Feb 11, 2022

Can you please elaborate a little bit more? I am new in wasm-edge but experienced in c++ programming.

Hi @anonymousr007,

I am not sure how much do you know about the WebAssembly(a.k.a. wasm). In this ticket, you will need to figure out the difference between the current wasm spec and the new spec defined in this proposal. Then, you have to implement the WasmEdge internal loader, parser, define more data structure, and finish the execution engine to fit this proposal.

Also, we take the code coverage seriously, so you will need to create the unit test for all your code.

Reference:

  1. The Current Wasm Spec: https://github.com/WebAssembly/spec
  2. If you want to know how it looks like, please refer to the previous lfx mentorship for proposal: [Proposal] WASI-crypto Proposal #408. This is under reviewing.

@hydai
Copy link
Member Author

hydai commented Feb 11, 2022

Hi @anonymousr007,

I just updated the Minimum qualifications. If you are interested in this issue, please finish the challenge. It will help you to get familiar with the WasmEdge data structure and how to interact with the WasmEdge.

@Ruchip16
Copy link

@hydai I am also interested in this like I am very much experienced in C++ programming but new to wasm, but with proper guidance and research I would love to go deep in it, let me know if there is any scope of me working on the issue, thanks

@hydai
Copy link
Member Author

hydai commented Feb 23, 2024

@q82419 Can we close this?

@q82419
Copy link
Collaborator

q82419 commented Mar 19, 2024

Typed function reference proposal are merged.

@q82419 q82419 closed this as completed Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request LFX Mentorship Tasks for LFX Mentorship participants
Projects
None yet
Development

No branches or pull requests

4 participants