Singularity OS: Well, I got just excited about nothing.

So, skimming headlines, Singularity OS sounds like M$ decided to release an open source OS. NOT TRUE.

This is the project white paper and here’s an Ars Technica breakdown

Turns out

  • It is not planned for application ie, you’ll never use it on your desktop
  • It’s released under MS Shared Source, ie, you’ll never see it on any device outside a CS lab
  • It’s not really that revolutionary/cool

Basically, the bright idea is to use managed code (C#), use a microkernel structure, and run almost all code in safemode. My concerns is that this all creates a non-scalable, slow as molases system.

I haven’t seen any speed comparisons between C++/C#, but heres the numbers from Gentoo’s Language Shootout:

binary-trees CPU Time secs Memory Use KB GZip Bytes
C# Mono 8.15 14,512 594
GNU C++ 4.38 6,996 525
mandelbrot CPU Time secs Memory Use KB GZip Bytes
C# Mono 7.11 4,604 4681
GNU C++ 3.01 896 1081
reverse-complement CPU Time secs Memory Use KB GZip Bytes
C# Mono 2.17 27,184 711
GNU C++ 0.55 13,288 794

All the others were in C++ favor. A caviot, Mono C# is not the same as M$C#, but its probably comparable. This all makes sense. It costs cycles to manage code, and usually requires extra layers of indirection. Real programmers use C# to code video games, but that’s precisesly why Gaming systems require harcore CPU’s.

Not I’m no kernel hacker, but I’m fiarly sure the whole idea of a microkernel is that it creates adressing and thread transparnecy, and all the ususal services become user mode processes. The white paper says this is the only part not running is safemode, probably because that would be hella-slow even in proof of concept sense of the word. There’s probably something about malware getting less access to stack info, but now I’m overstepping my knowledge.

So in metaphor, if you want national stability, you can either have free people and an adaptive legal system with adequate representation and plurality, or a police state that squashes any irregularity before it starts. The problem with the former is that they have annoying hiccups and are a bit fickle with political fashion. The problem with the latter is that their errors tend to be system wide and irrevocable, and they tend to grind to a halt on their own friction. If even the IO processes have to run managed code in safe mode, which do you think I’m comparing to Singularity OS?

Advertisements

4 responses to “Singularity OS: Well, I got just excited about nothing.

  1. >Real programmers use C# to code video games

    I think you meant real programmers use C++ to code video games, not C#–precisely for the reasons you mention in the previous article about PS3s. Gamers demand as much performance as possible and C++ is by far the most effective way to deliver that performance to our audience. I’d imagine that goes for OS development and high performance scientific computing as well.

    FWIW, I’m an ex physics student who ended up skipping out just before grad school to code video games. I love the challenges and inherent competition involved in getting the most out of these awesome boxes, but sometimes I get nostalgic for what I might have missed had I stuck with physics, so keep writing and I’ll keep reading 🙂

  2. Absolutely Game Coder, i could have stated that more clearly. I wanted to avoid sounding like I was flaming managed code en masse, and came off a bit too simplistic, but you are right: C++ packs more punch line for line. Whether this is means better value per unit of developer time is another issue. I’d be interested in seeing a survey of how much managed code ends up in final products, if you’ve come across that…..

  3. We love managed code for as much as we can get away with–which is almost everything outside of the actual game runtime. At our specific company we estimate that managed code makes us about 3x more productive when writing tools and editors and other non-performance critical code. I wish we could write more of the runtime in managed code, but C++ is still the best tool for the job for the vast majority of runtime game code. There will be a slow drift to higher level languages in games because of its inherent benefits, but it won’t replace the majority of game code for a long, long time (if ever).

    By the way, I’d love to see a blog post about some of the software tools (and/or programming tools) used by physicists out there in the real world as they try to predict and model new phenomena or analyze experimental data. If I ever get sick of coding up games, I’d love to get involved in working on those sorts of tools / simulations.

  4. That makes a lot of sense.

    As a professional who no doubt works on teams, you’d probably be repulsed by most of the code we write. Since most of our code is for a temporary specific purpose and will only be used by an isolated, small number of people and never reused, its usually written pretty fast and dirty.

    Now that the F77 generation is approaching retirement, the High Energy experiments have longer lifetimes, and the collaborations are getting larger, there is more of a movement to structure & manage analysis and operational code the way a commercial organization would do it. I even know a freelance guy who is working part time for an ILC group as a sort of code coach, who periodically flies out here to teach physicists stuff we should have learned in school, like, how to document and create class structures with flexibility.

    As far as high Energy Physics goes ROOT (root.cern.ch) is the standard framework these days. It’s really just C++ with a labyrinth of libraries bundled with an unreliable interpreter. I’ll try to think about what aspects of our analysis software here would be interesting, but I risk discussing minutiae, or just ranting. In the meantime, thanks for your comments. I look forward to your thoughts on future posts.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s