restate icon indicating copy to clipboard operation
restate copied to clipboard

sdk-dotnet

Open Ibrahimogod opened this issue 1 year ago • 13 comments

Are you planning to support .NET with some sdks

Ibrahimogod avatar Jun 30 '24 04:06 Ibrahimogod

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.

tillrohrmann avatar Jun 30 '24 16:06 tillrohrmann

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

Ibrahimogod avatar Jun 30 '24 16:06 Ibrahimogod

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.

tillrohrmann avatar Jun 30 '24 16:06 tillrohrmann

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

Ibrahimogod avatar Jul 01 '24 04:07 Ibrahimogod

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.

tillrohrmann avatar Jul 01 '24 15:07 tillrohrmann

I am keen to help out with a .NET SDK

jeremylcarter avatar Aug 24 '24 02:08 jeremylcarter

@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

slinkydeveloper avatar Aug 24 '24 16:08 slinkydeveloper

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?

jeremylcarter avatar Aug 24 '24 23:08 jeremylcarter

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.

slinkydeveloper avatar Aug 25 '24 12:08 slinkydeveloper

@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?

joebowbeer avatar Sep 11 '24 06:09 joebowbeer

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

slinkydeveloper avatar Sep 11 '24 07:09 slinkydeveloper

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

jeremylcarter avatar Sep 26 '24 00:09 jeremylcarter

Any progress on this?

stevefan1999-personal avatar Nov 03 '25 04:11 stevefan1999-personal