Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Consider splitting out typed function pointers #60

Closed
aykevl opened this issue Jan 30, 2019 · 4 comments
Closed

Consider splitting out typed function pointers #60

aykevl opened this issue Jan 30, 2019 · 4 comments

Comments

@aykevl
Copy link

aykevl commented Jan 30, 2019

Reading through the overview, I saw that there is a proposal for typed function pointers.

Is there anything that typed function pointers provide that is not already covered by anyfunc? I have a feeling that the part of the spec that describes typed function pointers is leaning a bit too much towards supporting the full Java type system. While I think that typed function pointers can be very useful for performance reasons, I don't see how they are related to GC except for making the type system even more complex. Falling back to anyfunc (with a small performance hit) and simply requiring the language to perform its own language-dependent downcasts if needed seems like a simpler solution right now.

Possibly related: #32

@titzer
Copy link
Contributor

titzer commented Jan 30, 2019

AFAICT, there are no downcasts from anyfunc at the moment. What would they downcast to, if there are no typed function pointers? Or do you propose to write any anyfunc into a table and then do a call_indirect on it? That is pretty slow.

@rossberg
Copy link
Member

I actually just proposed splitting out typed function references from the GC proposal at last weeks CG meeting. See this branch for a tentative sketch of such a standalone proposal.

@aykevl
Copy link
Author

aykevl commented Jan 30, 2019

Or do you propose to write any anyfunc into a table and then do a call_indirect on it? That is pretty slow.

That's what I would propose, yes. Yes, it will be slow. But similar to interior pointers in #59, I don't think this should be part of a MVP. (And if this is part of the MVP, why not interior pointers?)

I actually just proposed splitting out typed function references from the GC proposal at last weeks CG meeting.

Great! And good to hear there is ongoing work!

@binji
Copy link
Member

binji commented May 27, 2020

Typed function references has been moved to its own repo, here: https://github.com/webassembly/function-references. Closing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants