Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tell me again why we need both .NET and Windows? Why can't Windows morph into the CLR?

Tags:

clr

The same way DOS morphed into Windows?

We seem to have ended up supporting and developing for three platforms from Microsoft, and I'm not sure where the boundaries are supposed to lie.

Why can't the benefits of the CLR (such as type safety, memory protection, etc.) be built into Windows itself?

Or into the browser? Why an entirely other virtual machine? (How may levels of virtual machine indirection are we dealing with now? We just added Silverlight - and before that Flash - running inside the Browser running inside maybe a VM install...)

I can see raw Windows for servers, but why couldn't there be a CLR for workstations talking directly to the hardware (or at least not the whole Windows legacy ball and chain)?

(ooppp - I've got two questions here. Let's make this - why can't .net be built into Windows? I understand about backward compatibility - but the safety of what's in .NET could be at least optionally in Windows itself, couldn't it? It would just be yet another of many sets of APIs?)

Factoid - I recall that one of the competitor architectures selling against MS-DOS on the IBM PC was UCSD-pascal runtime - a VM.

like image 416
dkretz Avatar asked Dec 06 '08 04:12

dkretz


4 Answers

And let's not forget that DOS didn't morph into Windows, at least not the Windows we know and love today. DOS was the operating system, Windows 3.1 a GUI shell resting atop said operating system.

When Windows 95 came out, it is true that there was no more boxed product labeled "Microsoft DOS," but Windows 95, architecturally, was DOS 7.0 with a GUI shell resting atop.

This continued through Win98 and WinME (aka Win9X).

The Windows we know today (XP, Vista, 2003, 2008) has its core from the Windows NT project, a totally separate beast. (Although NT was designed to be compatible with 3.1, and later, 9x binaries, and used a near-identical but expanded API.)

DOS no more morphed into the Windows we are familiar with than the original Linux core morphed into KDE.

The two APIs will need to continue to coexist as long as there are products built natively against Windows which are still in a support cycle. Considering that the Windows API still exists in Windows Server 2008 and Windows 7, that means at least 2017. Truthfully, it will probably be longer, because while managed code is a wonderful thing, it is not always the most appropriate/best answer.

Plus ... As a programmer, you ought to know better than anyone: It's never as easy to do something as it might appear from the outside!

like image 74
John Rudy Avatar answered Oct 06 '22 00:10

John Rudy


Windows is multi-million lines of code, most of it in C. This represents an enormous decades-long investment. It is constantly being maintained (fixed) for today's users. It would be completely impossible to stop the world while they rewrite every line in C# for ten years, then debug and optimise for another ten, without totally wrecking their business.

Some of the existing code could in theory be compiled to run on the CLR, but it would gain no benefit from doing so. Compiling a large subset of C to the CLR is possible (using the C++/CLI compiler) but it does not automatically enable garbage collection, for example. You have to redesign from the ground up to get that.

like image 20
Daniel Earwicker Avatar answered Oct 05 '22 23:10

Daniel Earwicker


Well, for one the CLR isn't an operating system. That's a pretty big reason why not ... I mean even the research OS, Singularity, is not just the CLR. I think you should read up on some books about the Windows kernel and general operating system stuff.

like image 28
BobbyShaftoe Avatar answered Oct 06 '22 00:10

BobbyShaftoe


Microsoft are still a few Windows releases away from that.
But they would start with something like Singularity I think.

like image 24
BuddyJoe Avatar answered Oct 05 '22 23:10

BuddyJoe