Open richlander opened 11 months ago
cc @yowl @silesmo
Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.
Author: | richlander |
---|---|
Assignees: | - |
Labels: | `arch-wasm`, `untriaged`, `needs-area-label` |
Milestone: | - |
Enable building single file wasm files by default
Hopefully, it still allow me to do
Also, a question about WIT importing. the WIT file spec does not seem to leave any room for object's 'instance' reference. The 'interface' in WIT were mapped into statics funtions in C#. My understanding is that not all wasm supported language are OOP. Still, it's not so great if I'm a lib wrote by an oop language but I cannot expose an oop method to a consumer lib that was also wrote by n oop language. Not sure if the .NET team will try to do some extra things around that.
Not sure if the .NET team will try to do some extra things around that.
This scenario is probably handled in the component model MVP with WIT resource
s . e.g.
resource blob {
constructor(init: list<u8>);
write: func(bytes: list<u8>);
read: func(n: u32) -> list<u8>;
merge: static func(lhs: borrow<blob>, rhs: borrow<blob>) -> blob;
}
wit-bindgen
for c# does not currently support resources, hopefully this month we will have something.
This is super exciting! I'm not a contributor here but I work at Fermyon and we have a serverless webassembly project called Spin. We've built an SDK around Steve Sanderson's Wasi SDK previously and I have tried to update it for dotnet 8 with some success but I have a couple of suggestions/questions.
It would be nice to be able to use a library project that doesn't require a main function and have the output wasm be a wasi preview 2 component. I think this would be implied by Enable building single file wasm files by default
but I just wanted to make sure.
Will Enable minimal APIs (for handling Web requests).
be targeting the wasi-http spec (specifically wasi:http/incoming-handler
)?
It would be nice to be able to use a library project that doesn't require a main function
This is should be supported now by the NAOT compiler option, I'm not sure where the mono interpreter is with that. However the SDK from Steve needs updating I believe.
Regards HTTP, there is https://github.com/dotnet/runtimelab/issues/2468 where some conversation has taken place, but nothing more as far as I know. Could be there is work internal to Microsoft as I'm just an outside contributor.
Hi @jpflueger! We're well aware of your work on Spin. It would be good to talk about moving the two projects forward in some coordinated way. This includes how spiderlightning fits into the picture.
library project that doesn't require a main function
Yes. That's a good goal / scenario.
minimal APIs
I haven't talked to the Web team, but implementing that on top of wasi-http
makes sense to me.
We have the same need at nor2 for wasi-http for our runtime n2. So that's definitely a goal to be able to support @jpflueger.
Speaking of dotnet run, will dotnet test also available for wasi? Or what is Microsoft's plan for best practice of unit testing on wasi?
Async between WASI components authored in different language runtimes looks particularly gnarly to implement, at least that was the impression given at the Bytecode Alliance plumbers summit a few weeks ago.
I would gladly accept an interim release minus async support if it enables experimental WASI preview-2 development on .Net 9 a few months earlier.
@flibbertigibbet-uk the complications around async composition between components shouldn't really impact the toolchain here, which should be able to target the entirety of WASI preview2 without issues.
WASI Developer Experience Goals
WebAssembly System Interface is an exciting technology. Lots of work has already gone into enabling C# with WASI. dotnet/runtime #65895 defines a set of low-level requirements for providing a working implementation. We can up-level that into a set of developer experience goals.
The following are proposed changes in various categories. Please propose your own.
Related (interview about WASI and C#): https://www.youtube.com/watch?v=fnAjxzMPPqk
Building
runtimeconfig.template
file.PublishAot
.Running
dotnet run
(otherwisedotnet run
isn't generally useful).dotnet run
"helpful" output.Programmability
HttpClient
as-is (particularly forhttps
endpoints).More detailed work breakdown https://github.com/dotnet/runtime/issues/65895