C#

Asked by YR M0ddEr on 2012-04-05

Would it be possible to use C# to write Ares features instead of rusty C++?
If not, would some work on Syringe to make it possible interest anyone?
In this situation(extending old RA2), it is smarter and easier to use C#.

Question information

Language:
English Edit question
Status:
Solved
For:
Ares Edit question
Assignee:
No assignee Edit question
Solved by:
YR M0ddEr
Solved:
2012-04-06
Last query:
2012-04-06
Last reply:
2012-04-05
Renegade (renegade) said : #1

You are mixing up two different things, I think: Syringe, as far as I know, only needs a DLL and points to hook its functions into. If I understand the system correctly, it shouldn't matter what language the code was in *before* it was compiled.
Ares, on the other hand, relies on YR++, which generally consists of a bunch of C++ headers. While I wouldn't rule out that it's theoretically possible to generate object files from both C++ and C# code bases and then munge them together in the end, I don't think it'd be a good way either way, because you're creating artificial interaction barriers when writing code, require additional knowledge and tools from all contributors, and invite buckets of bugs that arise from the interaction of the different language segments.

I also don't know in how far funky things like vtable layouts play into this: Maybe it's just plain not possible because C# compiles differently. *shrugs*

Lastly, I feel the need to point out that C# does not equal .NET and vice versa. Even if working with C# were possible, I'm pretty sure we wouldn't want hundreds of megabytes of .NET-frameworks as requirements for Ares.
So if anything, it'd be naked C# anyway.

tl;dr: Syringe maybe, Ares probably not.

AlexB (alexander-b) said : #2

It would be possible to support .Net by creating COM wrapper classes for each object type (classes, coclasses, explicit layout, marshalling, ...), but the price to do this would be higher than the possible gain. It would be slow because of some tremendous overhead and an additional layer of code. Every class definition would have to be maintained in YR++ and a hypothetical YR.net. The cost outweights the benefit, even if COM support would mean every .net language, VB classic and every language that can handle COM interfaces could then be used to extend YR (at the cost of an updated Syringe, definitions for each language and maybe requirement of the .net framework).

YR M0ddEr (yr-m0dder) said : #3

Thanks for the answers.