So here's the concept. I'm trying to write a C# backend for CouchDB (keep reading, this has little or nothing to do with CouchDB).
Here's the basic idea:
1) The DB Driver uploads an arbitrary string to the DB Server.
2) The DB Driver tells the DB server to run the code and produce a view
3) The DB Server loads my C# backend, hands it the input string
4) The DB Server hands the function to the C# backend
5) The DB Server hands the C# backend data to execute the function over
6) The C# Backend executes the code and result the data to the DB Server
7) The DB Server stores, or otherwise sorts and sends the results back to the DB Driver
So the problem I'm having is with the remote code execution. All my models are C# objects. So it'd be really nice to be able to write the code on the front end, and have the code transfered to the back end for execution. Without having to copy DLLs etc. Now currently in CouchDB this query language is JavaScript so it's super simple to just copy the code into a string.
Any options like this in C#? Can I get a string version of a function? Should I create a external server that hosts these DLL assemblies and serves them up to the CouchDB backends? Should I compile them on the front end, and embed the .cs files as a resource? I'm just brainstorming at this point. Any thoughts/ideas/questions are welcome.