First of all, a wide range of languages on the .NET platform definitely contains languages that generate code with different performance, so not all languages are equally effective. All of them are compiled into the same intermediate language (IL), but the generated code may be different, some languages may rely on Reflection or dynamic language execution (DLR), etc.
However, it is true that BCL (and other libraries used by languages) will have the same performance no matter what language you call them in, which means that if you use some library that does expensive calculations or rendering without performing complex calculations yourself It really doesn't matter which language you use to call it.
I think the best way to think about a problem is not to think about languages, but about the various programming functions and styles available in these languages. Some of them are listed below:
Insecure code . You can use unsafe code in C ++ / CLI, as well as in C #. This is probably the most efficient way to write certain operations, but you are losing some security guarantees.
Statically typed, imperative . This is a common C # and VB.Net programming style, but you can also use the imperative style from F #. It is noteworthy that many functions of tail recursion are compiled into a statically typed, imperative IL code, so this also applies to some F # functions
Statically typed, functional . This is used by most F # programs. The generated code is very different from what the imperative category uses, but it is still statically typed, so there is no significant performance penalty. Comparing imperative and functionality is somewhat complicated, since the optimal implementation in both versions looks completely different.
Dynamically typed . Languages such as IronPython and IronRuby use dynamic language execution, which implements calls to dynamic methods, etc. This is somewhat slower than statically typed code (but DLR is optimized in many ways). Note that code written using C # 4.0 dynamic also falls into this category.
There are many other languages that may not fall into any of these categories, however I believe that the above list covers most common cases (and definitely covers all Microsoft languages).
source share