.net hdk

I am currently making good progress on the .NET HDK and I am about to reach out to the community for some help with this… I have found a way to compile .NET code to WASM and I am also using the Wasmer lib to call into the HC Core API in the Conductor WASM. I am very happy they decided to switch to this because I found some .NET bindings for this here:

Issue is, although this lets me call into WASM functions from .NET and also allows WASM functions to invoke .NET methods, there doesn’t seem to be a way for it to compile to WASM?

But I am planning on either using Mono:

Or CoreRT to do this:

CoreRT looks the best way to go, but I will be experimenting with both…

Quick question, I presume currently there are two WASM files HC uses? The core API that runs in the conductor and then the Rust HDK that calls into the other Core API WASM file and also runs inside the conductor?

How would I get the conductor to use my .NET HDK WASM file rather than the Rust HDK WASM file?

Any help would be greatly appreciated.




I saw your question when watching the DevCamp session just now.

I’m curious about this as well - am vaguely interested in writing a Haskell HDK because that’s my best language, but I don’t know if I’ll have bandwidth to tackle it in the near future. Still, would like to follow along if you’re tackling this, and share notes if I do end up looking at it.

There’s another related thread here, but it doesn’t have too much info.

My understanding (which is not very solid, since I’m still early in learning about Holochain’s architecture) is that hApp zomes interoperate through an API, and so the best path might be to compile your .net code to a zome, and then “link” (not totally sure if that’s the right metaphor) that to the other zomes in your hApp.

there’s probably a specification of a WASM ABI describing how the zomes talk to each other (but I don’t know where). given that, then I would imagine one could write a “shell” Rust zome, which mostly just ferries commands in/out of the “main” .net/whatever zome.

1 Like

Yes, great idea! :slight_smile:

So now all we need to find out is where this WASM ABI is? Any ideas how we can find out?

@lucksus, any ideas? Would be really appreciated thanks bro… :slight_smile:

I assume you’ve already seen these links?

I would imagine that after implementing the HDK, one would use some sort of Foreign Function Interface to allow the zomes to speak to each other within a given DNA.

perhaps my term “WASM ABI” was slightly misleading in focusing too low level. not sure.

1 Like

Great thanks for the links, I did see them a long time ago, nice to see they have been updated with more useful info, especially the hc core functions that are exported, that was one of the things I was after thanks… :slight_smile:

After your idea of using a Rust shell/wrapper around the .net code I did some research into .net to rust interoperability and was happy to see others had successfully managed to do this. You can easily call Rust from .net using .net’s interop services as long as the Rust code is compiled into a standard DLL.

You can also get Rust to call into .NET by using CoreRT (as linked above) to compile it to a single native DLL for the target platform (Windows, Linux or Mac). So this looks like the best way to go… :slight_smile:

So I am guessing the Rust shell/wrapper would look like just another zome or crate that can be imported into the Rust hApp code (lib.rs) instead of the default import of the Rust HDK?

Then the standard lib.rs calls would stay the same as they are?

All you would need to change is the import at the top to switch from the Rust HDK to the .NET HDK?

Then when the conductor packages the hApp it would compile it all to WASM and hopefully still work? lol

The only snag is the only blog I found of calling .NET code from Rust using CoreRT was that the whole .NET runtime of course needs to be compiled into the single dll and it was around 16MB! Ouch.

Hmmmmm… maybe this is not the best approach then? So maybe my first approach of using CoreRT to compile the .NET code to WASM is best?

If so… then my original questions still need answering on my original post above… really hope someone can help…

What we need are Rust, .NET & HC experts! :slight_smile: Any here? Any on the core team?

@hedayat @lucksus @artbrock @zippy
@martin @pauldaoust

Any feedback really appreciated thanks… :slight_smile:


I was thinking maybe we could still use the rust shell idea but compile the .net code into WASM and get rust to call into the compiled wasm I guess same way the conductor does using Wasmer?

Is there example code for this somewhere?

I guess in the source somewhere?

But still need to know where I can find the core api wasm file so i can use the .net bindings for Wasmer to call into…

Thanks :blush:

The .net hdk is part of a larger project for the OASIS api and Our World and could really do with some help with… thanks :blush::pray::heart:



I’m currently upgrading HoloNET the .net client allowing hc to talk to .net and unity… :blush:

Anyone? :blush: any help would be really appreciated thanks…

Another issue I am having is with CoreRT, maybe someone can help me with the issue?

I posted this a few weeks back but got no response yet on StackOverflow:

Any help would be really appreciated thanks.


@pauldaoust @guillemcordoba @philipbeadle @hedayat @pqcdev

Be great to get some help with the Web Assembly questions I had above such as what format the Web Assembly has to be compiled to etc? And how to interface with the conductor, etc and my other questions above… would be really appreciated thanks. :slight_smile:

I am guessing things have now changed with RSM as well?

1 Like