|
|
|
|
|
by Meai
1518 days ago
|
|
>The problem is that C# isn't a language intended for embedding, and you need a lot of effort to bind the two seamlessly. I don't think that it's actually very hard to do it, I've done it easily for Java and I think I remember doing it for c# as well:
https://docs.microsoft.com/en-us/dotnet/core/tutorials/netco... It's honestly just a few lines of C code that you point at some c#/java method and run it. The truth is probably that people want to invent their own languages for their own reasons, e.g to have full control. Personally I've never understood that which is why I know so much about language interop now. Embedding is even easier for various scripting languages. I've also done interop for Dart. I don't like Lua but I've also looked at how easy it is for that. Imo there is no justification for game engines not having a C API so that everyone can code in whatever language they prefer. |
|
Well that's something I've never heard of, seems like a pretty recent API. Though it doesn't explain how to call C++ functions from CLR (not the other way), which is the most tedious and error-prone part. It also doesn't explain how to expose foreign C++ objects to CLR either.