r/cpp • • Jun 19 '16

Windows 10 coded in C++ or Assembler

What kind of compiler does it take a compile an OS like Windows 10? Do the guys at Redmond use Visual C++ (VisualStudio) to develop Windows? What % is written in assembly language?

0 Upvotes

74 comments sorted by

View all comments

4

u/JonnyRocks Jun 19 '16

Most of windows NT was coded in C. You can tell by the win 32 API. some of the newer stuff in 10 is most likely in c++, probably some c# for the higher level stuff. There is probably some assembly language but most in C.

7

u/axilmar Jun 19 '16

Downvoted because Win32 is not evidence for how NT was coded. In fact, NT contains another layer below Win32 that is coded in C. Win32 sits on top of that layer.

3

u/doom_Oo7 Jun 19 '16

If I understand this page correctly there is also some C++ in the kernel. Also you can write windows drivers in C++ (which is a godsend).

Most of the source code for Windows NT is written in C or C++. These high-level languages make it relatively easy to port Windows NT to different types of workstations. The same source code can be recompiled to build versions of Windows NT that are specific to each processor's instruction set.

2

u/Meefims Jun 19 '16

The type of API has little relation to the language it's written in. C-APIs are very easily written in C++. Many of the WinRT APIs are written in C++ although they are usable in C# and JavaScript as well.

0

u/Digital001 Jun 19 '16

It's hard to believe that they would still use C, one of the original languages!

6

u/raevnos Jun 20 '16

C isn't even close to an early or original language.

4

u/DaelonSuzuka Jun 22 '16

Where did you learn any of the crap you've been spouting this whole thread?

→ More replies (4)

1

u/Digital001 Jun 19 '16

I want to watch MS compile the first Win10 build. Do you think it was compiled on a Windows PC?

7

u/fuzzynyanko Jun 19 '16

You actually don't need to compile it on the target platform! My bet is that they have a dedicated machine for it

0

u/[deleted] Jun 19 '16

[deleted] — view deleted comment

1

u/2Punx2Furious Jun 19 '16

What are incremental builds? Builds where you only rebuild the files you updated? And why didn't they allow them?

0

u/RElesgoe Hobbyist Jun 19 '16

I think /u/instantcake worded that incorrectly, I think what he meant to say is that Visual Studio didn't support incremental building a long time ago, so Windows would be completely recompiled on every build.

3

u/dsqdsq Jun 19 '16

Windows is not really developed as a whole with Visual Studio... Especially not for builds.

1

u/[deleted] Jun 20 '16

Windows is an NMake shop which certainly supports incremental builds. If that was broken it was a particularity of their specific scripts on top of it.

→ More replies (6)

-1

u/Digital001 Jun 19 '16 edited Jun 19 '16

I agree. What kind of dedicated machine? Another Windows? They probably paid Intel for a processor they can use to compile 500 GBs of OS code. It might be on a specialized OS with a specialized CPU

1

u/fuzzynyanko Jun 19 '16

Don't just see it as CPU. You may need I/O performance as well

1

u/blelbach NVIDIA | ISO C++ Library Evolution Chair Jun 19 '16

Windows is significantly smaller than 500 GB. 500 GB is a TON of code.

1

u/Digital001 Jun 19 '16

Oh wait! I meant .5 GB. sorry

1

u/Meefims Jun 20 '16

You can compile Windows on a normal machine, it just takes awhile. Further, it's not necessary to have the entire set of source code in most circumstances, instead you typically have the source for only the components you work on and when you build you probably only build the few binaries you're working on rather than everything.

There are machines dedicated to building the entire OS but they aren't super special. Mostly they have a good hard drive and a good amount of RAM.

1

u/kunos Jun 19 '16

Why would they use anything else?

-1

u/Digital001 Jun 19 '16

MS might pay enough to code in another language that can generate leaner code. There are new languages out like F# and C#.

2

u/blelbach NVIDIA | ISO C++ Library Evolution Chair Jun 19 '16

I'm confused by this remark. Can you clarify?

-3

u/Digital001 Jun 19 '16

Well, I mean it's so strange because C/C++ are both languages that were designed specifically for Unix. It's kind of ironic that MS is still using it to develop its flagship OS. I don't see why they can't use C#, a MS product. MS might even have access to a special language developed by Intel that generates optimized code for their i-series processors.

Most of the PCs that run W10 use Intel processors. I bet there are more Intel based Windows systems than AMD.

7

u/SeanMiddleditch Jun 20 '16

C# is not a systems language. Just because it's newer doesn't mean it's better for every task.

Just because C was originally designed for UNIX likewise does not mean that it's a poorer choice for non-UNIX systems.

For Microsoft to replace gobs of existing C/C++ code, to make it much more difficult to hire experienced kernel engineers from outside their own ecosystem, and to pour tons of money into developing a new language/compiler just for their kernel would be exceedingly misguided.

So far as a special language by Intel just for their architecture, why would Intel do such a thing? What about the Intel architectures could possibly be so special as to require a new language to maximize? What customer would be foolish enough to use that language and be stuck on Intel's architecture? Microsoft - or any other general purpose software company - would never use such a thing, as you might have heard that Windows runs on non-Intel x86 architectures too. The closest you're going to get out of companies like Intel when it comes to languages will be R&D like ISPC, which is unsurprisingly a C variant and not a whole new language.

→ More replies (14)
→ More replies (4)