Stream: jco

Topic: Regarding the component apis


view this post on Zulip Souyama (Nov 04 2026 at 08:38):

I am building a node graph based runtime based on webcomponents (leveraging the wit contracts), that's primarily targetting wasmtime and jco runtimes. Also a browser editor that uses the jco runtime, to simulate and whatever.

For first iteration I used the guest - host route for data transports for anything that's not streams / futures. It worked to an extent but had some performance issues, mostly due to boundary crossing (guest -> host -> guest) via Value instead of typed apis or components, and lack of proper apis. Did work around these a bit by utilizing host managed memory apis, streams etc.

Am rearchitechting the entire thing to properly leveage webcomponents and typed apis, while prototyping realized that the ecosystem isn't mature enough yet. Reported issue #2398 through 2400 in jco that were fundamentally blockers. 2398 got fixed so thanks for that. But problems are not just in jco but also in wac, wasm-tools etc. Some things are quite confusing like validation succeds but trying to run after some wierd behaviours and some inconsistent behaviours and apis provided by both runtimes.

view this post on Zulip Souyama (Nov 04 2026 at 08:39):

Or perhaps fork build my own stuff on top and backport the fixes

view this post on Zulip Victor Adossi (Nov 04 2026 at 13:28):

hey @Souyama thanks for building with the ecosystem tools and letting us know what went wrong -- I appreciate the issues filed on Jco!

With regards to the other issues you found, it would be great to have some concrete issues that you found with each library. While I think much of the core team is busy right now (as people always are, but especially with vulnmageddon happening everywhere), I think it would really help if we could turn the particular sharp edges you ran into into issues that we can fix.

view this post on Zulip Victor Adossi (Nov 04 2026 at 13:30):

Right now, the most production ready host is wasmtime, but if you were having issues with wac and wasm-tools that's definitely worth reporting for visibility.

General issues/frustrations can also be useful if we can turn them into some actionable issues that someone can pick up eventually.

view this post on Zulip Souyama (Nov 05 2026 at 06:01):

OK, I see all my reports reported so far are resolved.

There were still some other issues I haven't reported yet. I have forked jco and a bunch of other repos. At this point I think it may be faster to iterate on the exact fixes and features I need on my fork and backport them, or update my work accordingly if anyone else fixes it. Or whatever additionally pops up by running various combinations of inputs generated from my code in fuzzer.

The repo in question going through the rewrite: https://github.com/sansmoraxz/witgraph/tree/composition-redesign

view this post on Zulip Souyama (Nov 05 2026 at 06:03):

My jco fork with the other fixes: https://github.com/sansmoraxz/jco/tree/witgraph-patches

Not reviewed too deeply here, most of these are claude generated. Feel free to cherry pick from here.

view this post on Zulip Souyama (Nov 05 2026 at 06:03):

For the other forked repos too, all on the witgraph-patches branch

view this post on Zulip Victor Adossi (Nov 05 2026 at 13:11):

Souyama said:

OK, I see all my reports reported so far are resolved.

There were still some other issues I haven't reported yet. I have forked jco and a bunch of other repos. At this point I think it may be faster to iterate on the exact fixes and features I need on my fork and backport them, or update my work accordingly if anyone else fixes it. Or whatever additionally pops up by running various combinations of inputs generated from my code in fuzzer.

The repo in question going through the rewrite: https://github.com/sansmoraxz/witgraph/tree/composition-redesign

That sounds great, once you're at a place where everything works as you like, backing out the issues into a coherent list (w/ maybe commits to point/patches) would be great, in this day and age I think it would be easy to extract signal from that.

I'll take a look at your jco changes branch

view this post on Zulip Souyama (Nov 06 2026 at 15:00):

OK I think I am at a good enough place to start backporting (debugger working properly too for both wasmtime and jco).

image.png
gc supported languages behaving wierdly with debugger, will tackle that part in next interation.

I think you have picked most of my jco fixes. Will also backport for wac, wasm-tools and wasmtime.

view this post on Zulip Souyama (Nov 06 2026 at 15:07):

Also there has been no activity in wac repo for 2 months.

https://github.com/bytecodealliance/wac

what is the channel for this?

view this post on Zulip Victor Adossi (Nov 07 2026 at 01:55):

Just wanted to pop back in here and thank you for the patches @Souyama !

Oh and as far as wac goes, II think it's fairly stable now, but it's possible it's behind... technically wasm-compose has been deprecated in favor of wac, but it may receive updates a bit more quickly than wac actually does in reality

view this post on Zulip Victor Adossi (Nov 07 2026 at 01:55):

I think you can use the #wasm channel

view this post on Zulip Victor Adossi (Nov 07 2026 at 13:33):

So one thing that I'm a bit concerned about is https://github.com/bytecodealliance/jco/pull/2424 -- I am a bit surprised that making the function in question async (and return only when the background work is completed) wouldn't work.

Exposing internal async tasks/groups to the outside world is probably not something we want to do from the Jco side, though waiting for "idleness" seems more reasonable.

view this post on Zulip Souyama (Nov 07 2026 at 14:11):

Maybe you can feature gate this. I was riding in the coatails of wasmtime's taskgroup regarding this.

view this post on Zulip Souyama (Nov 07 2026 at 14:11):

Browser host (jco): how witgraph uses lastTaskGroup and whenIdle(groups)

Same use case on wasmtime, through its public task group API

Tests showing why whole-instance idleness isn't enough

view this post on Zulip Souyama (Nov 07 2026 at 14:16):

And the producer node in question:

src: https://github.com/sansmoraxz/witgraph/blob/96a560d8603475ae4e1c9c6530e6f27899812972/test-fixtures/test-components/guests/stream-producer/src/lib.rs
wit: https://github.com/sansmoraxz/witgraph/blob/96a560d8603475ae4e1c9c6530e6f27899812972/test-fixtures/test-components/guests/stream-producer/wit/world.wit

view this post on Zulip Victor Adossi (Nov 09 2026 at 00:55):

Thanks for noting the reasoning here -- will see if jco should adopt something similar. What you've laid out makes sense, I will give this a rethink soon.

view this post on Zulip Victor Adossi (Nov 09 2026 at 00:59):

It may look like hooks rather than exposing the tasks (i.e. letting users do the tracking themselves), but the idea of a DX-friendly option is obviously preferrable

view this post on Zulip Victor Adossi (Nov 09 2026 at 12:32):

OK, I've taken a look -- I remember discussion about this with regards to the wasmtime change and it was really for call tracking -- I think that's what we could to introduce here, somewhat explicitly (until the CM itself has some sort of solution for this)

Tracking for operations specifically rather than an internal task group concept, per say.


Last updated: Nov 19 2026 at 20:05 UTC