I've seen this question and I'm wondering if there is any technical reason to justify the fact that gcc offers support for Java but not for C#. If I understand, Java is an interpreted language too. If Mono offers a C# compiler and an implementation of the CIL, why wouldn't it be possible to create a gcc c# compiler that would convert C# to IL and then compile it statically ?
GCC is an integrated distribution of compilers for several major programming languages. These languages currently include C, C++, Objective-C, Objective-C++, Java, Fortran, and Ada.
I've seen this question and I'm wondering if there is any technical reason to justify the fact that gcc offers support for Java but not for C#. If I understand, Java is an interpreted language too.
Supported languages As of May 2021, the recent 11.1 release of GCC includes front ends for C ( gcc ), C++ ( g++ ), Objective-C, Fortran ( gfortran ), Ada (GNAT), Go ( gccgo ) and D ( gdc , since 9.1) programming languages, with the OpenMP and OpenACC parallel language extensions being supported since GCC 5.1.
Introduction. GCJ stands for the GNU Compiler for the Java Programming Language. Within GCC, it comprises the Java programming language front-end (gcc/java), a runtime library (libjava) and other helper libraries (boehm-gc, libffi and zlib).
Because you haven't submitted a patch to add C# support.
If a compiler tool chain doesn't support a particular language, it's often because there isn't enough interest for that language in the time being. So, not a technical reason per se - just that they don't want to waste their developers' time on that, for now.
There is no particular technical reason why C# can't theoretically be implemented as a statically compiled language. In practice, however, generics is one of the core strengths of C# but unfortunately, due to the way generics work in this particular language, any efficient implementation of them generally benefits a lot from the presence of a JIT compiler. When you define a generic type in C#, you can efficiently get a piece of machine code for all its concrete types where the type arguments are classes and one piece of machine code for each of the used struct types. However, when you attempt to create a new concrete type across another binary, then your most likely ally in creating the new piece of machine code required for those type arguments is a JIT compiler.
If you're interested in creating statically-linked programs in C# however (and not specifically in gcc), then Mono does offer a tool (called mkbundle, I think) that allows you to create completely standalone binaries from C# code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With