Uh oh!
There was an error while loading. Please reload this page.
feat: support first class function via builtin function - #2752
feat: support first class function via builtin function#2752HerrCai0907 wants to merge 1 commit into
Conversation
CountBleck
commented
Sep 28, 2023
Are you sure we shouldn't wait until we use Wasm GC? |
HerrCai0907
commented
Sep 29, 2023
I think we can do it separately. First class is based on object module, it don't and shouldn't rely on wasm GC or __new. It only means we have a Function class and can manage it as normal object. |
Uh oh!
There was an error while loading. Please reload this page.
CountBleck
commented
Sep 29, 2023
By "first class function", do you mean closures? Those might be easier to implement in Wasm GC, since the heap doesn't have to be dealt with manually, and closure objects for child blocks would include the parent closure objects (at least the way I see it). |
We have memory allocation abstraction, and then we have GC object abstraction based on memory allocation. Those thing can be replaced by |
Uh oh!
There was an error while loading. Please reload this page.
CountBleck
commented
Sep 29, 2023
That's actually my point. The Meanwhile, with Wasm GC, we could just make GC structs without touching AS's type system (which would also be simplified). As a result, it would (theoretically) be much more convenient to write, debug, and maintain. |
CountBleck
commented
Sep 29, 2023
Also, the current test should already work: see here. |
HerrCai0907
commented
Sep 29, 2023
Yes. This pr will not support closure. It only wants to support store function instance in heap instead of in data section. I think it will be the first step to support closure. |
CountBleck
commented
Sep 29, 2023
I don't quite understand what you mean. |
CountBleck
commented
Sep 29, 2023
Oh, do you mean creating a new |
485f557 to
6b35f1eCompareHerrCai0907
commented
Oct 9, 2023
This is binaryen bug which fixed in latest binaryen. |
lcswillems
commented
Oct 10, 2023
@HerrCai0907 Great news you are working on this!! 🙏 @CountBleck Is Wasm GC ready? |
CountBleck
commented
Oct 10, 2023
Nope. Keep in mind that I'm a procrastinating 10th grader who has to deal with an annoying amount of English homework :P I'll try to get in more work towards the Wasm GC transition in my spare time, but the progress won't really be visible until I make a PR to Binaryen. |
5705cc3 to
758e86aCompare758e86a to
41cf0f7Compare
This is the first pr to support first class function.
Firstly we need to support allocating function object in heap instead of data area.