Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> A kernel without drivers is useless.

So... that means that the kernel is not written in C then? I'm confused.

> It is not irrelevant. Code compiled by a C++ compiler is C++, regardless how C fans try to bend it. Having this discussion since 1993.

Except they don't compile it with a C++ compiler, it simply can be compiled with one.

However, what would you call this, C or C++?

  #include <stdio.h>

  int main(int argc, char **argv)
  {
    char line[256];
    fgets(line, sizeof(line), stdin)
    puts(line);
    return 0;
  }
> What other OS, non UNIX based with the same maturity as the list above, can you point out being done in C?

Windows. Already did that. This discussion is now feeling circular.



> So... that means that the kernel is not written in C then? I'm confused.

It depends how important you consider the kernel, written in C, requires the drivers, written in C++, to perform any useful task.

> Except they don't compile it with a C++ compiler, it simply can be compiled with one.

Right now maybe not. Just wait when MSVC++ no longer does C.

> However, what would you call this, C or C++?

Actually,

It is C code according to ANSI C.

It is C++ code according to ANSI C++.

It is Objective-C code according to Objective-C language specification.


So... I guess I am confused. Here is how this has gone:

You: The only widely used, mature OS which is written in C is *NIX.

Me: No. The Windows and OSX kernels are written in C.

You: Yes, but OSX drivers are C++ and Windows is moving toward being able to be compiled by a C++ compiler.

Me: Right... but they are still written in C.

You: Yes, but that doesn't matter, you're wrong.

Me: ?

The discussion was centered around these kernels being written in C. They are, you have even conceded to that, yet you continue to argue (what point I don't even know) because OSX drivers are in C++ and Windows may some day in the theoretical future be compiled by a C++ compiler? I don't get it.


So you don't get that a kernel without drivers cannot even boot. Drivers that are an integral part of the kernel, thus making an C/C++ hybrid, not pure C.

As for Windows, given the ongoing transition, and some of the chapters of Windows Internals book series, how can you prove that everything is still compiled with the C compiler and not C++ one?

You are right, it is silly to keep this discussion.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: