I have a system, written in C# which is designed to be given a dll that contains a class implementing a certain interface, and then instantiate that class and invoke certain interface methods and use the responses.
The context is to build an AI Competition where people submit their AIs as C# dlls. And it all works perfectly. Yay!
Now I'd like to start supporting other languages, by the same approach.
Fundamentally users should upload a single file (and the metadata about what kind of file that is), and I then invoke the contents of that file accordingly.
For C#, that's "upload a dll" and "use C# System.Reflection
to instantiate it to get a C# object implementing the interface, then just call the relevant methods".
I'm interested in knowing what other languages I can viably support? I could interact with anything that can compile down to an .exe and interact over the command line, or I could set up a Web API based interaction.
But what options are there for things that more directly resembling instantiating an object and interacting directly with that object?
- It seems that Java can do this via IKVM
- If I had a text file, or zip of files, that contained JS code, then could I invoke that in a C# environment somehow? (Note that this is running on a server - it's not a web page, so I can't trivially inject that JS into a webpage)
- Scala? (Note that I know nothing whatsoever about Scala, other than that it is a Functional Language)
- NodeJS? (Again, all I know is that Node is server-side JavaScript)
- Others?
I'm very happy for answers to be a links to other SO questions that have solved this problem in specific languages - though I would like you to ensure that it is solving it in my particular context, of the user uploading a file (possibly a zip?) and me invoking that directly in a server-side C# enviroment.