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

add C# language support documentation #156

Merged

Conversation

bacongobbler
Copy link
Contributor

closes #148

@bacongobbler
Copy link
Contributor Author

Note that we're currently debugging an issue upstream for Linux support in Zulip. Once that's resolved, I think this should be safe to merge.

CC @jsturtevant

@kate-goldenring
Copy link
Collaborator

kate-goldenring commented Sep 18, 2024

@bacongobbler thank you for putting this up! Is the c# tooling in a place where it can also create library components that target specific wit worlds? Could we add, whether in this PR or a follow up one, documentation on how to create a component that targets the example world? That is our prevailing example for the language guides. For example: https://github.com/bytecodealliance/component-docs/blob/main/component-model/src/language-support/python.md

@jsturtevant
Copy link

Is the c# tooling in a place where it can also create library components that target specific wit worlds?

It is we do this with https://github.com/bytecodealliance/componentize-dotnet/tree/main/samples/calculator/Adder

@bacongobbler bacongobbler force-pushed the csharp-language-support branch from 08fb309 to b94ceb7 Compare September 19, 2024 20:45
@bacongobbler
Copy link
Contributor Author

bacongobbler commented Sep 19, 2024

Okay. I updated the documentation to show how to create a component that targets the example world as well as a second component that targets the hostapp world. Let me know if you'd like me to change and/or rearrange things.

As I was completing the document, I was looking for a way to execute these two components together and found this document on running components. However when I tried to run it, I saw that wasm-tools compose has been deprecated.

@jsturtevant I saw in your examples that you just created a dummy csproj that composes the two components together. Would you recommend suggesting that to new users, or is there a better approach you'd suggest? EDIT: answered my own question; see next comment

@bacongobbler
Copy link
Contributor Author

bacongobbler commented Sep 19, 2024

I see that the composed example utilizes wasm-tools compose, which I assume isn't sustainable long term because it's been deprecated by the maintainers. Are there other ways within C# that we can compose two modules and execute them via wasmtime similar to the python example? is wasmtime-dotnet stable enough for this purpose?

@bacongobbler
Copy link
Contributor Author

Doesn't seem like it at the moment 😭

bytecodealliance/wasmtime-dotnet#324

@kate-goldenring
Copy link
Collaborator

@bacongobbler does wac plug work? I have a pr #154 switching the docs to use that instead of wasm-tools compose but if you can only use wasm-tools compose for now, that is better than nothing

@jsturtevant
Copy link

yes you can use a dummy project or in the final project can compose them together.

Doesn't seem like it at the moment 😭

bytecodealliance/wasmtime-dotnet#324

this is only if you want to use .net as the host to execute components. As @kate-goldenring mentions Wac is the way forward to compose two components together

As far as including wac in the package so its easy; its been my list for awhile but probably won't get to it till its a forced 😆 bytecodealliance/componentize-dotnet#5

Signed-off-by: Matthew Fisher <[email protected]>
@bacongobbler
Copy link
Contributor Author

Updated to use wac plug

Copy link
Collaborator

@kate-goldenring kate-goldenring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making this so comprehensive @bacongobbler. My comments are mainly nits with the main suggestions being around command component terminology and renaming that component executable.

We should also add reference to this document to language-support.md, introduction.md and SUMMARY.md but that can be done in a subsequent PR too

component-model/src/language-support/csharp.md Outdated Show resolved Hide resolved
component-model/src/language-support/csharp.md Outdated Show resolved Hide resolved
component-model/src/language-support/csharp.md Outdated Show resolved Hide resolved
component-model/src/language-support/csharp.md Outdated Show resolved Hide resolved
component-model/src/language-support/csharp.md Outdated Show resolved Hide resolved
component-model/src/language-support/csharp.md Outdated Show resolved Hide resolved
component-model/src/language-support/csharp.md Outdated Show resolved Hide resolved
Signed-off-by: Matthew Fisher <[email protected]>
Signed-off-by: Matthew Fisher <[email protected]>
Signed-off-by: Matthew Fisher <[email protected]>
Copy link
Collaborator

@kate-goldenring kate-goldenring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you @bacongobbler for putting this together. This will expedite users' c# experience.

@kate-goldenring kate-goldenring merged commit 7c4258a into bytecodealliance:main Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add c# language docs
3 participants