10 ms·
Which programming language is used for making Windows 10?
- OnlyRepliesToBS 7y agoholy shit, that's a lot of telemetry
- snazz 7y ago500 GB strikes me as quite small. The entire Git repository (it sounds like Microsoft uses Git internally) must be a whole heck of a lot larger than this if there are over 60,000 commits every few weeks. Still, it’s a mammoth project, which makes it all the more impressive that it works (most of the time).
- baragiola 7y agoI think he said the actual "Windows source code", not the git repo containing all of its changes
- gmuslera 7y agoIf the reported size was from that fs command (assuming that is similar to linux's du) and that he did it in his git clone version, then it includes all the git files, including file versions (that with 60k changes every 2 weeks should be pretty huge), and branches (different editions, targetted to different markets, etc, that may not have trivial changes). I don't think he copied the structure without the git files to make the count, nor deleted/moved elsewhere the .git directory for that. Neither that is just source code there, (versioned) bitmaps, third party drivers blobs and more probably it's there too.
- JosephRedfern 7y agoI'd say that it's very likely that a repository of such size would be "shallow cloned", i.e. with `--depth n`. This would substantially cut down on the size of a large repository with hundreds of thousands of changes.
- Someone 7y agoThat’s quite a few assumptions, at least one of which likely isn’t correct; at Microsoft, the .git directory doesn’t contain ”all the git files, including file versions […] and branche” https://devblogs.microsoft.com/devops/optimizing-git-beyond-gvfs/ https://devblogs.microsoft.com/devops/optimizing-git-beyond-...: ”GVFS allows our developers to simply not download most of those 3.5 million files during a clone, and instead simply page in the (comparatively) small portion of the source tree that a developer is working with.” Having said that, the linked https://docs.microsoft.com/en-us/azure/devops/learn/git/gvfs-design-history https://docs.microsoft.com/en-us/azure/devops/learn/git/gvfs... claims Windows gives a size about half that 500GB for the Windows source code: ”the Windows repo, which has over 3 million files in the working directory, totalling 270GB of source files. That’s 270GB in the working directory, at the tip of master. To clone this repo, you would have to download a packfile that is about 100GB in size, which would take hours. And once you’ve succeeded in cloning it, local git operations like checkout (3 hours), status (8 minutes), and commit (30 minutes) would still take way too long to run”.
- antiuniverse 7y agoKeep in mind that to manage the insane scale, Microsoft internally hides git behind a custom virtual file system: https://vfsforgit.org/ https://vfsforgit.org/ https://github.com/Microsoft/VFSForGit https://github.com/Microsoft/VFSForGit
- seba_dos1 7y agoWhoa, they actually changed its name from GVFS (which clashed with GNOME)? I didn't expect that. Cool!
- sweden 7y agoThis post is kind of dramatic. Windows is much more than a simple kernel: it is a collection of drivers, tools, a desktop envinroment, a network stack, user base applications (like Paint), etc, etc. If you compare it to the entire Ubuntu project, you will se a project of similar dimensions.
- laumars 7y agoI don't know about Ubuntu specifically but some distro's do ship sources with their installation media and it usually fits on 1 DVD. When I say "sources" I am talking about kernel, user land and desktop applications too. However that would be compressed tarballs and doesn't include git history - the latter being where I suspect most of the disk space is being used in that screen shot.
- megous 7y agoYou're off by a magnitude. https://cdimage.debian.org/mirror/cdimage/archive/9.7.0/source/iso-dvd/ https://cdimage.debian.org/mirror/cdimage/archive/9.7.0/sour... Source code compresses quite well, so uncompressed, this may be somewhere between 200-250 GiB.
- agumonkey 7y agofair point about compressed bytes, but what about structure ? even ubuntu never felt that intimidating but maybe it's because I just didn't count folders
- laumars 7y agoMy benchmark was SuSE, which was 1 DVD's worth. However your post now has me wondering if that didn't contain the complete sources either - just sources for server components. That said, those 12 DVDs likely cover way more than the Windows sources would. eg multiple different image editors, LibreOffice (would Windows sources include the sources for MS Office as well?) several different databases (MariaDB, PostgreSQL, Redis, etc). So even that might not be a fair comparison either? Unfortunately without access to that source directory all of this is all just going to be speculation anyway. I did also make the point about compression too by the way :)
- dboreham 7y agoThere was Prolog in the network stack configuration system. At least there was way back when.
- agumonkey 7y agoI read that too. Not sure early NT or even DOS days
- jim_lawless 7y ago"The Microsoft NT 4.0 kernel network driver contained a small Prolog interpreter to help puzzle out network interface cards" Using Prolog in Windows NT Network Configuration http://web.archive.org/web/20040603192757/research.microsoft.com/research/dtg/davidhov/pap.htm http://web.archive.org/web/20040603192757/research.microsoft...
- vcanales 7y ago> You can spend a year (seriously) just drilling down the source tree, more than a half million folders containing the code for every component making up the OS workstation and server products and all their editions, tools, and associated developement kits, and see what’s in there, read the file names and try to figure out what does what. This makes me really want to know how they manage to document everything to make such a huge project easy to work with.
- Scrantonicity 7y agoUsually when you're working on the scale of operating systems, you have people focusing on particular areas e.g. kernel teams, networking teams, graphics teams etc and you also have their corresponding test teams. So no one person usually even has understanding of the entire source code.
- jkuria 7y agoNot even Dave Cutler? I thought he single-handedly wrote the first version of the kernel. At least that is the legend: https://en.wikipedia.org/wiki/Dave_Cutler https://en.wikipedia.org/wiki/Dave_Cutler Lots of great stories about him. One is recounted here: https://capitalandgrowth.org/articles/930/xbox-co-founder-my-life-in-games-seattle-hacker-ne.html https://capitalandgrowth.org/articles/930/xbox-co-founder-my...
- greenyoda 7y agoThe kernel is a pretty small part of the operating system. Development of Windows NT started in 1989[1], when RAM sizes of PCs were measured in MB, not GB, so there wasn't room for a lot of bloat. (NT 3.1 could run on a machine with 12 MB of RAM.[2]) Also, it wasn't the first kernel Cutler wrote. While Cutler is undoubtedly a brilliant programmer, I doubt he could keep the details of all the other parts of the system (graphics, etc.) in his head at once. Other well known kernels were also written by very small teams. The first Unix kernel was written by two people and the first Linux kernel was written by one person. [1] https://en.wikipedia.org/wiki/Windows_NT#Development https://en.wikipedia.org/wiki/Windows_NT#Development [2] https://en.wikipedia.org/wiki/Windows_NT#Hardware_requirements https://en.wikipedia.org/wiki/Windows_NT#Hardware_requiremen...
- TravHatesMe 7y agoA project of such scale and longevity always seems to pique my interest. I bet there are some interesting historical artifacts in that codebase. Why is old code so fascinating? Decades ago someone as insignificant as you wrote this code. I find it especially interesting to come across comments in code, which allow developers to express themselves outside the confines of the language. I feel like a historian in this context, analyzing this person's thoughts and state of mind. Perhaps the author included elements of emotion or humour. Who was this person? An insignificant developer, as I am -- did they ever become something of themselves? I think the developer's story is rarely told, but it's a story worth telling!
- rochak 7y agoYou managed to put in words the things I feel when I am working in this field.
- aerovistae 7y agoI do actually think code archaeology may one day be a sub discipline of the field, perhaps in another hundred years.
- KineticLensman 7y agoIn Vinge's "A Deepness in the Sky" [0] one of the characters is a Programmer-at-Arms, and one of his roles is essentially software archaeology - not for the fun of it, but to keep the deeply layered software of a starship functional. [0] https://en.wikipedia.org/wiki/A_Deepness_in_the_Sky https://en.wikipedia.org/wiki/A_Deepness_in_the_Sky
- shpx 7y agoSoftware archeology in a mature programming environment http://akkartik.name/post/deepness http://akkartik.name/post/deepness
- conover 7y agoThis is a fantastic book. Software is written and rewritten over thousands of years, layer upon layer, powering interstellar vessels and their “automation”. It makes you wonder what Windows will look like 100 years from now, if it’s still around. Will it be easier to just write another layer on top or dig down into the original source and modify?
- agumonkey 7y agoremember the MinWin project ? https://en.wikipedia.org/wiki/MinWin https://en.wikipedia.org/wiki/MinWin I wonder if it helped shrinking the code base too
- jdsully 7y agoMinwin was about moving code around. By necessity it required even more code to support the indirection and compatibility of programs expecting code in specific DLLs.
- octosphere 7y agohttps://www.wired.com/2014/03/msdos-source-code/ https://www.wired.com/2014/03/msdos-source-code/
- monochromatic 7y agoThat’s a little surprising. I would have figured that outside the kernel/drivers, it’d be all C++.
- solarkraft 7y agoI'd have expected much more to be in C#.
- fffrantz 7y agoSecond this. Though Microsoft has been really busy getting their C++ sorted out lately. Funnily enough, C# performance has also seen some dramatic performance increase.
- maxxxxx 7y agoFrom what I know for a long the OS division who writes Windows has been at war with the developer division who writes .NET and refused to use .NET. I think it has gotten a bit better recently.
- pjmlp 7y agoI thought so, but not so much. https://kennykerr.ca/2019/01/25/the-state-of-cpp-on-windows/ https://kennykerr.ca/2019/01/25/the-state-of-cpp-on-windows/
- shaklee3 7y agoThere's no reason to write OS components in a language that will inherently give you a performance hit before you do any real work.
- pjmlp 7y agoSure, unsafe all the way. As note, Midori did power part of Bing during its existence. And Microsoft security is now advising to move new development into a mix of C#, Rust and constrained C++ (Core Guidelines).
- solarkraft 7y agoDoes anyone happen to know how the Windows shell (CShell?) is built? Winforms? WPF? UWP?
- ComputerGuru 7y agoNone of the above. It's GDI and the widgets are most similar to those available via MFC (this talking about the classic she'll, so Metro/UWP aside).
- maxxxxx 7y agoIt always infuriated me that MS usually wasn't using the tools they gave to developers for their own stuff. I think it has got a little better in the last years. Now they seem to be using UWP to some degree. But before that they didn't use Winforms or MFC. WPF only for VS 2010 and up.
- userbinator 7y agoIf you've ever used any other applications written in pure Win32 you would know why --- the efficiency difference is enormous. They did start using more managed code in the system starting with Vista, which resulted in all the complaints about it being slow and bloated. I suspect there's been even more of it added since then, because the Win10 explorer.exe on a recent quad-core i7 system with an SSD still manages to respond more slowly to actions like opening a folder than XP's on a 15-year-old PC with a regular HDD...
- maxxxxx 7y ago"If you've ever used any other applications written in pure Win32 you would know why" I have written pure Win32 and I know that...
- machinecoffee 7y agoMFC I'm not so sure about, but ATL or even better WTL would probably do the job.
- missjellyfish 7y agoThe real question is: is it compiled with the same msvc compiler that ships in the SDK? If so, they don’t even use C99. C89 all the way. That especially means no variable declaration anywhere in the function body.
- userbinator 7y agoIt's probably the DDK compiler, although I'm not sure of the difference these days. In C89 you can declare variables in the middle of the function, as long as they're at the beginning of a { block }. The beginning of a function is somewhat of a special-case of this.
- ComputerGuru 7y agoWhile MSVC doesn't have full C99 support, MSVC supported most of the features that shipped in C99 that make it much less painful to develop in C quite a number of years before C99 support formally landed in other compilers. MS will probably never support full C99 because the demand isn't there, but it's certainly not ANSI C you are expected to write.
- coldcat 7y agoMSVC support C11 because it a prerequisite for C++17. The limits are you need to compile in C++, so the very few changes/incompatibilities between C and C++ always bend to the C++ choices. The preprocessor isn't what people used to have in C99 so some macro still not portable.
- ComputerGuru 7y agoTo the best of my knowledge (i.e. not updated since C++14), C++ is no longer a strict superset of C as of C99, and there are C99 features that are not available in C++, so I'm not sure that's the case. But plenty of overlap, for sure. Here's a community wiki answer on SO: https://stackoverflow.com/posts/47526708/revisions https://stackoverflow.com/posts/47526708/revisions Extracted portion of relevance: > The following C99 features are not supported by C++: > > * restricted pointers > * variable length arrays > * flexible array members > * static and type qualifiers in parameter array declarators > * compound literals > * designated initializers
- ralphc 7y agoBack in the late '80s, my company had a program that included getting the Windows 3.0 source code. Looking through the code I had found the line "goto wearefucked;" and accompanying label further down. When we got the source for Windows 3.1 the first thing I did was check that file, but to my disappointment the label had been changed.
- IWeldMelons 7y agoYeah, well if you ever traced a Win95/98 app and stepped into the OS code, one of the internal system API's was called BOZOLIVESHERE. https://devblogs.microsoft.com/oldnewthing/20031015-00/?p=42163 https://devblogs.microsoft.com/oldnewthing/20031015-00/?p=42...
- eclipseo76 7y agoI'm actually surprised they use GIT internally. I would have thought they have their own custom VCS. It says a lot about the success of GIT.
- hguant 7y agoMicrosoft created VFS for Git, specifically because the windows kernel code was too large for git to handle without being intolerably slow (git status taking hours to complete for example). https://github.com/Microsoft/VFSForGit https://github.com/Microsoft/VFSForGit
- simplyinfinity 7y agoThey used to have their own VCS, but moved away fairly recently, 1-2-3 years ago
- VirtualAirwaves 7y agoI think it was more like 7 or 8 years ago.
- hestefisk 7y agoIt was based on their own fork of Perforce.
- ardy42 7y ago> They used to have their own VCS, but moved away fairly recently, 1-2-3 years ago TFS? https://en.wikipedia.org/wiki/Team_Foundation_Server https://en.wikipedia.org/wiki/Team_Foundation_Server
- simplyinfinity 7y agono, as a sister comment of this mentioned, i think it was based on perforce, they didn't use TFS for this internal project AFAIK
- Theodores 7y agoGit, as developed by that Linux guy? Let's rewind to 2001, courtesy of The Register: Microsoft CEO and incontinent over-stater of facts Steve Ballmer said that "Linux is a cancer that attaches itself in an intellectual property sense to everything it touches," during a commercial spot masquerading as a interview with the Chicago Sun-Times on June 1, 2001. I am personally pleased they have thrown in the towel with Internet Explorer/Edge to just use the same browser as everyone else. Okay, bad for diversity, good for getting your web page to render. Next they will be emulating Windows in Linux. Not a bad idea. A few years ago I was curious as to why programs worked quicklier in Virtualbox running Windows on Ubuntu than when I booted the machine into Windows 7 mode and tried to run them natively. Plus why bother with installing driver disks and having a subsystem when the Virtualbox provided defaults were doing a better job? Then there is the file system. The Windows one might do special Windows things like animating folders flying through the air but it is always slower given the same hardware and same task. And normally you just want to copy files or rsync them. Plus there is that matter of anti-virus. That is never a problem on Linux but you need that on Windows, another little watchdog program to double check every byte for you. Can't see how that helps. The unix/linux/ChromeOS idea of considering everything to be hostile with file permissions has always worked. So I look forward to a future where Windows is just a set of UX guidelines and any 'Windows program' is secretly run in some proprietary blob that is running in some white-labelled Virtualbox clone. Maybe they end up doing that thing Apple did to move off the legacy code base where it recompiles itself.
- Bizarro 7y agoAnybody interested in the history of NT should read Showstopper!: The Breakneck Race to Create Windows NT and the Next Generation at Microsoft It focuses on Dave Cutler, the father of NT
- pickle-wizard 7y agoI read that book a few years ago. I've read several books about various computers projects and I usually leave with a wish that I could have worked on that project. After reading Showstopper, my main thought was, thank $deity I didn't work on that project. I think it is because in the book Dave Cutler comes off as an asshole.
- superasn 7y agoMakes me wonder if there exists an OS that is truly written from scratch designed for only modern hardware and devoid of all backward compatibility and bloat (like the JS frameworks ditching support for msie). It would be certainty a very interested side project I guess.
- nderjung 7y agoThis is an interesting consideration. If you think about IoT devices, oftentimes you can find yourself designing software for a bespoke hardware system with limited resources and no room for considering backward compatibility. Paravirtualized VMs too need not necessarily require full POSIX ABIs since syscalls are more expensive and the underlying hypervisor can take care of any compatibility with the underlying hardware system.
- ajflores1604 7y agoIsn't Google's Fuchsia OS an attempt at this? I feel like I read that somewhere, might be completely wrong though.
- yiyus 7y agoYou cannot design for modern hardware and avoid bloat at the same time.
- icebraining 7y agoWell, TempleOS (by the late Terry Davis) was designed from scratch to support only multicore x86-64 CPUs: https://en.wikipedia.org/wiki/TempleOS https://en.wikipedia.org/wiki/TempleOS
- stephen_g 7y agoThe problem with modern hardware is that they themselves are full of backwards compatibility. And while such a system could certainly be done (as somebody said, Fuscia is probably a fairly good example of one), it will only take a few years as hardware changes and it's going to have backwards compatibility "bloat" as well!
- darkhorn 7y ago
- 8456523 7y ago> You can spend a year (seriously) just drilling down the source tree, more than a half million folders I would be more inclined to switch to Windows if its source tree were smaller. My guess is that a big reason I prefer MacOS over Windows is that Apple has been much more willing to drop support for legacy hardware and old applications to keep the source code more manageable.
- MagicPropmaker 7y agoOh come on. Be honest. I can tell just from the tone of this post that you'd _never_ switch to Windows.
- 8456523 7y agoThat's not true. It is difficult for humans to estimate how they spend their time, but my guess is that I've spent at least 35 hours recently exploring Windows 10: Changing various settings, installing software, asking Windows-specific questions of Google Search. And I'm writing this on Windows. (Except for the Windows-specific questions, I'm not counting web use in the estimated 35 hours because of course the web mostly works the same way across the desktop OSes.) I think computer users vary drastically in how much they value predictability in the software-based systems (or "environments") they use, and that I value predictability much more than the average user does. I realize that it is unreasonable to hope never to be surprised at the response the system makes to an action of mine. But my response to being surprised is to try to understand how I could correctly predict similar responses in the future. For example, I might try to understand the reasoning of the designer of the part of the system in question. Or I might search for ways that I might have misinterpreted the situation. And I don't like it when I never reach an understanding of the surprising response. Its source code's having half a million folders is a sign that Windows will never stop surprising me, which, all other things being equal, makes me less hopeful that spending time getting to know Windows will pay off for me. Life of course will never stop surprising me. But to have any hope of getting anywhere in life or achieving any goal whatsoever, my brain must be sufficiently reliable and predictable. I see my computer as an extension of my brain that helps my brain be more reliable in the ways that will help me to succeed. If you see your computer or the web site you are interacting with as a potential friend with agency of its own, then I can see where you might be offended by my original comment. I see computers and web sites as tools. Levers, if you will.
- athaca 7y ago(serious) how do I become a kernel engineer coming from a background of javascript and swift?
- ajxs 7y agoThere are a few basic tutorials here: https://wiki.osdev.org/Expanded_Main_Page https://wiki.osdev.org/Expanded_Main_Page that can definitely give you some insight into how kernel development works. It's an incredibly disciplined and broad field, but very interesting too.
- saagarjha 7y agoLearn C and how operating systems work.
- tus87 7y ago> Windows 10 is the same (evolved) code base as the code base of Windows 8.x, 7, Vista, XP, 2000, and NT Err....it's been NT all along.
- colejohnson66 7y agoThey’re referencing way back when (before 2000) when it was just NT with a version number
- deleted 7y ago[deleted]