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

sdk-dotnet #1677

Open
Ibrahimogod opened this issue Jun 30, 2024 · 12 comments
Open

sdk-dotnet #1677

Ibrahimogod opened this issue Jun 30, 2024 · 12 comments

Comments

@Ibrahimogod
Copy link

Are you planning to support .NET with some sdks

@tillrohrmann
Copy link
Contributor

Hi @Ibrahimogod, at the moment Restate supports TS, Java and Kotlin. We are planning to expand the set of supported languages very soon. Your interest in the .Net SDK is noted and will be factored into the planning. Once work on the .Net SDK starts and I can share a reliable timeline with you, I'll let you know.

@Ibrahimogod
Copy link
Author

Hi @Ibrahimogod, at the moment Restate supports TS, Java and Kotlin. We are planning to expand the set of supported languages very soon. Your interest in the .Net SDK is noted and will be factored into the planning. Once work on the .Net SDK starts and I can share a reliable timeline with you, I'll let you know.

I would like to contribute, I have some good .net background, but I don't really know where to begin, if you have any references I would appreciate it if you share with me

@tillrohrmann
Copy link
Contributor

Help with implementing new SDKs is always great to have :-)

We have a semi-formal specification of the service protocol which you can find here. One part that is still missing is the discovery part.

Apart from the formal specification, the best source for information is the TS SDK implementation or the Java SDK if you like this language more. I can also give you more concrete pointers into one of these SDKs, if you let me know which one you prefer.

@Ibrahimogod
Copy link
Author

Help with implementing new SDKs is always great to have :-)

We have a semi-formal specification of the service protocol which you can find here. One part that is still missing is the discovery part.

Apart from the formal specification, the best source for information is the TS SDK implementation or the Java SDK if you like this language more. I can also give you more concrete pointers into one of these SDKs, if you let me know which one you prefer.

I think I'll understand typescript more than java

@tillrohrmann
Copy link
Contributor

tillrohrmann commented Jul 1, 2024

The main part of the business logic of a SDK lives in the internal state machine. The state machine is called from the node enpoint via the GenericHandler.

The invocation is started by StateMachine::invoke. Through a couple of wrappers (ServiceComponents), the actual service code is called with a Context argument which gives access to Restate API calls. These API calls translate to calls on the StateMachine which persist information through the Restate server and continue once the Restate server has responded.

I hope this helps navigating the code base a bit. If you have further questions, then let me know @Ibrahimogod.

@jeremylcarter
Copy link

I am keen to help out with a .NET SDK

@slinkydeveloper
Copy link
Contributor

@jeremylcarter @Ibrahimogod

For who's keen to give a try to build a .NET SDK, we built for Python and Rust SDKs a common core module, available here https://github.com/restatedev/sdk-shared-core. This module handles most of the complexity of the protocol between SDKs and Restate runtime. It is built in Rust but in principle you can generate a binding for any you would like to use. This is an example of how we use PyO3 to generate a Rust -> Python binding: https://github.com/restatedev/sdk-python/blob/main/src/lib.rs
This core module handles the state machine business logic, but not the network layer (which at the end of the day, it's a simple HTTP/2 server), and not the APIs on top, which ofc needs to be built on a language basis. Perhaps you can start by simply trying to generate the Rust -> C# bindings using something like https://github.com/Cysharp/csbindgen and then build the http server on top of it to connect to Restate.

If you look in this particular file https://github.com/restatedev/sdk-python/blob/main/python/restate/server_context.py you can see how the Python SDK integrates its "context" API with the Rust core. You can check the similar counterpart in Rust: https://github.com/restatedev/sdk-rust/blob/main/src/endpoint/context.rs

If you wanna know more, feel free to reach me out on Discord too (I'm @slinkydeveloper there too), I'll be happy to provide support to get started with a .NET SDK

@jeremylcarter
Copy link

So the typescript and java SDKs don't use this sdk-shared-core? Are you transitioning to try to use the shared core for all SDKs?

@slinkydeveloper
Copy link
Contributor

slinkydeveloper commented Aug 25, 2024

So the typescript and java SDKs don't use this sdk-shared-core? Are you transitioning to try to use the shared core for all SDKs?

This is the idea, but we have no concrete plan/timelines for that atm given what we have works and it's tested. But going forward, this is definitely something we're considering for ease of maintenance.

@joebowbeer
Copy link

@tillrohrmann wrote:

at the moment Restate supports TS, Java and Kotlin

I also see this statement at the top of your README, and I'm thankful that TS is among your bellwethers

Then at the bottom of the README there is a longer list of SDKs. Is this the expanded list of supported languages you mentioned?

@slinkydeveloper
Copy link
Contributor

@joebowbeer Yep between june and now we added Rust, Python and Golang 😄 look on the side bar here https://docs.restate.dev/

@jeremylcarter
Copy link

I'm starting work on this in my spare time. If I make any progress, ill update this ticket.

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

No branches or pull requests

5 participants