This is a great idea since it would allow to integrate any language with the .NET application. It is how Neovim does it: the main application is Neovim, which is written in C, and it acts as a server for a client application written in whatever other language. The protocol used is MessagePack RPC:
https://github.com/msgpack-rpc/msgpack-rpc/blob/master/spec.mdIt is built on top of the MessagePack serialisation format. In a nutshell, MessagePack is like JSON, but binary. This makes it smaller to transport and faster to pack and unpack, but it loses the nice human-readability of JSON. I think that's a good tradeoff for data that is not meant to be stored and manipulated by a person, but instead passed around between processes.
https://msgpack.org/I have already written a general-purpose MessagePack library for Racket, as well as a language client for Neovim:
https://pkgs.racket-lang.org/package/msgpackhttps://pkgs.racket-lang.org/package/nvim-clientThe MessagePack library is safe to use. The Neovim client is my first time doing something with RPC, so I'm not yet ready to call it stable. The part of the codebase which implements MessagePack RPC is not entangled with the Neovim-specific parts, so once the language client matures it will be easy to take it out and make it into a general-purpose MessagePack RPC library.