I have the urge to look into other languages, and the one I keep considering again and again is C#. I don't know much about it, and was curious as to how it has been designed. Does C#
make use of a Runtime Environment like many other contemporary languages? Or is C#
more like the two traditional C languages — C and C++ — in the sense that the programmer (or IDE) must provide a compiler, debugger, and libraries to build & debug executables?
Asked
Active
Viewed 131 times
0

JΛYDΞV
- 8,532
- 3
- 51
- 77
-
Does this wiki help on [CLR](https://en.wikipedia.org/wiki/Common_Language_Runtime)? – Icepickle Aug 29 '20 at 21:55
-
3What do you mean by "environment"? C# is a programming language which usually runs on top of [CLR](https://en.wikipedia.org/wiki/Common_Language_Runtime) virtual machine. – Guru Stron Aug 29 '20 at 21:56
-
3NodeJS isn't an "environment" either. – Daniel Mann Aug 29 '20 at 21:57
-
1It is not an environment (and not really sure what do you mean by "environment"). It is a general purpose language in C series. – Cetin Basoz Aug 29 '20 at 21:57
-
3*“What I did find out is that c# has an environment class with a lot of methods, and access to ENV. variables. I figured if c# has a native class to access and manipulate its environment, it must be the environment”* – this use of the word “environment” is unrelated to how you seem to be using it, so don’t worry about that stuff (the conclusion there is not correct). – Ry- Aug 29 '20 at 21:57
-
I mean like what environment is C# ran in, NodeJS is js ran in the NodeJS environment, which is esientially an Inturpreter written in C++ using Chromes V-8 Engine, PhP is ran in a Linux os that uses the PHP processor. What interprets or compiles the language, and where is it interpreted or compiled? The better terminology would be, What is the runtime environment when the C# documents are be processed and served – JΛYDΞV Aug 29 '20 at 22:18
-
@DanielMann You are wrong good sir, Node.js is by definition a JavaScript runtime Environment. – JΛYDΞV Aug 29 '20 at 22:20
-
Java has the JRE, or Java Runtime Environment. what does C# have? – JΛYDΞV Aug 29 '20 at 22:20
-
2It compiles down to [CIL](https://en.wikipedia.org/wiki/Common_Intermediate_Language) and runs on top of [CLR](https://learn.microsoft.com/en-us/dotnet/standard/clr?redirectedfrom=MSDN) – Icepickle Aug 29 '20 at 22:23
-
"NodeJS is js ran in the NodeJS environment"...no, JavaScript is run in the NodeJS environment. NodeJS isn't a language, JavaScript is. NodeJS is a runtime. – ADyson Aug 29 '20 at 22:25
-
C# is part of the .NET Framework. It isn't an interpreted language like JavaScript. Nor does it compile directly to a native binary though either. So it doesn't run directly in the same way. It has to be compiled as Icepickle mentioned. It then requires the .NET runtime to be installed on the machine for the compiled CLR code to execute. – ADyson Aug 29 '20 at 22:26
-
1There's a nice simple explanation on this page: https://dotnet.microsoft.com/learn/dotnet/what-is-dotnet-framework - scroll down to the "Architecture of .NET Framework" section, read the text and look at the diagram. – ADyson Aug 29 '20 at 22:29
-
@Icepickle thats what I was looking for, thanks bud. – JΛYDΞV Aug 29 '20 at 22:29
-
So in conclusion: JavaScript is a language, and NodeJS is a runtime environment. Java is a language, and JRE is a runtime environment. C# is a language, and the CLR is a runtime environment. – ADyson Aug 29 '20 at 22:32
-
@ADyson okay so you have to install the .NET framework, which comes with the CLR. Now I get. I knew there had to be something more that went along with C# for to work, I just had hard time explaining what I was missing. Thank u again bud. – JΛYDΞV Aug 29 '20 at 22:35
1 Answers
2
C# is a language that runs on the .NET platform.
.NET used to be windows only, but .NET Core (soon to be .NET 5) is cross platform.
C# does not compile down to native code; rather it compiles down to bytecode that is run on the CLR -- the Common Language Runtime. This is akin to Java's JVM.
There are slight backwards compatibility issues between .NET Core and .NET 4.8; but that's another story.

George Stocker
- 57,289
- 29
- 176
- 237
-
1Well, [mono](https://www.mono-project.com/) did a good job for a while to :) – Icepickle Aug 29 '20 at 22:34