anonymouse said:
Is it possible to have C# run in an unmanaged environemnt if somebody should
decide to implemnent it this way?
Its possible to code C# projects without any dependancy on the libraries at
all that ship with it and use other libraries? or is there a must have of
any of them. I could reaplce System.dll with my own, System.Windows.. blah
with my own etc..
After all these libraries are non standardised, only the language is.
The language would not work very well outside of a similar runtime. Its
designed to run within a garbage collected runtime, as there is no explicit
manner to destroy objects; a runtime that supports serialization,
attributes, a unified type system...You couldn't use it like C or C++, you'd
end up writing up a whole runtime and you'd be no better off. Standard C#
keywords have reliances on the runtime to provide a type, they themselves
are nothing but shortcuts to runtime classes. int in itself is not a 4 byte
stack object, it is an alias of System.Int32, which implements a 4 byte
stack object. There is a subtle difference, the language doesn't implicitly
create such things, like C\C++ would do.
Some language features expect framework constructs as well. Foreach works
with IEnumerable\IEnumerator combos, as well as IDisposable. So does the
using construct, as well as other things I've probably not thought of off
hand.
There is no reason you couldn't write another runtime if you felt like it,
but I would question why.
To work without a runtime would require changing the language, standard or
not, its not designed to operate outside of a framework.