A recent posting to the lkml requested help in porting the C++ Click Modular Router kernel module from the 2.4 stable kernel to the 2.6 stable kernel. The request was for ideas on fixing C++ related compilation errors, but the thread quickly turned into a lengthy debate on whether or not C++ had a place in the Linux kernel. The issue has been debated many times before, long ago earning its own entry in the lkml FAQ which offers numerous reasons why the kernel is not written in C++.
During the recent discussion, when it was suggested that perhaps the kernel is written in C simply because "we've always done it that way...", Linux creator Linus Torvalds joined in to explain:
"In fact, in Linux we did try C++ once already, back in 1992. It sucks. Trust me - writing kernel code in C++ is a BLOODY STUPID IDEA.
"The fact is, C++ compilers are not trustworthy. They were even worse in
1992, but some fundamental facts haven't changed: 1) the whole C++ exception handling thing is fundamentally broken. It's _especially_ broken for kernels. 2) any compiler or language that likes to hide things like memory allocations behind your back just isn't a good choice for a kernel. 3) you can write object-oriented code (useful for filesystems etc) in C, _without_ the crap that is C++."
From: Ashish sddf [email blocked] To: linux-kernel Subject: Compiling C++ kernel module + Makefile Date: Fri, 16 Jan 2004 13:09:24 -0800 (PST) Hi, I am trying to port a C++ kernel module from 2.4 to 2.6. (It is MIT Click Modular Router). As I understand the module building has changed in ver 2.6. I have got the Makefile to compile it but it gives me lot of warning - all dependancies problem It appears that the kernel Makefile treats it like a host application and does not pass the necessary processing routines. Does anyone can ideas about how to change the kernel makefile to compile the C++ files the same way as C files ? Any help will be appreciated. Ashish
From: Richard B. Johnson [email blocked] Subject: Re: Compiling C++ kernel module + Makefile Date: Fri, 16 Jan 2004 17:07:05 -0500 (EST) If somebody actually got a module, written in C++, to compile and work on linux-2.4.nn, as you state, it works only by fiat, i.e., was declared to work. There is no C++ runtime support in the kernel for C++. Are you sure this is a module and not an application? Many network processes (daemons) are applications and they don't require any knowledge of kernel internals except what's provided by the normal C/C++ include-files. Cheers, Dick Johnson Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips). Note 96.31% of all statistics are fiction.
From: Bart Samwel [email blocked] Subject: Re: Compiling C++ kernel module + Makefile Date: Sat, 17 Jan 2004 13:59:20 +0100 Rest assured, ;) this is definitely a module. It includes a kernel patch that makes it possible to include a lot of the kernel headers into C++, stuff like changing asm :: to asm : : (note the space, :: is an operator in C++) and renaming "struct namespace" to something containing less C++ keywords. The module also includes rudimentary C++ runtime support code, so that the C++ code will run inside the kernel. I'm afraid that the task of compiling it for 2.6 is going to be pretty tough -- the kernel needs loads of patches to make it work within a C++ extern "C" clause, and it probably completely different patches from those needed by 2.4. Getting the build system to work is the least of the concerns. -- Bart
From: Richard B. Johnson [email blocked] Subject: Re: Compiling C++ kernel module + Makefile Date: Mon, 19 Jan 2004 08:46:54 -0500 (EST) I can't imagine why anybody would even attempt to write a kernel module in C++. Next thing it'll be Visual BASIC, then Java. The kernel is written in C and assembly. The tools are provided. It can only be arrogance because this whole C v.s. C++ thing was hashed-over many times. Somebody apparently wrote something to "prove" that it can be done. I'd suggest that you spend some time converting it to C if you need that "module". The conversion will surely take less time than going through the kernel headers looking for "::". Cheers, Dick Johnson Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips). Note 96.31% of all statistics are fiction.
From: Bart Samwel [email blocked] Subject: Re: Compiling C++ kernel module + Makefile Date: Mon, 19 Jan 2004 18:40:18 +0100 Just to make this clear: I'm not the original poster, so I'm not the one who is to be helped. I just happened to know the module, and I'd thought I'd give you a quick answer because I knew it. :) Now, let me try to add a bit of nuance to your suggested solution. Try porting 100s of C++ files (yes, it's that large) making heavy use of inheritance etc. to C. Then try to make a bit of C code usable as extern "C" in C++. Extern "C" was actually meant to be able to grok most C code, while C++ wasn't meant to be easily portable to C. So, for any moderately large module that uses any C++ features at all, it's probably easier to make small syntactic changes to the kernel than to port the module to C (which would amount to a full rewrite). I'll give you a bit of background about the specific situation. I'm not involved with the project, so I don't know all the details, but I do know the code and have worked on a "competing" system (as far as research systems compete). The choice for C++ for this project is really the most obvious choice, as the model is very OO. The module implements a router model that is configured as "clickable modules", i.e., very small elements with input and output ports and a bit of state that are connected to each other through small interfaces. Their element implementations are arranged hierarchically (as in C++ class hierarchies). I'm not familiar with the exact history of the project, but I expect that they decided to do C++ because the model they try to express is best modeled using C++. This design decision can be debated, because it is perfectly feasible (albeit with a lot more work) to implement an OO model in C. In fact, I have helped to implement a similar framework (the OKE CORRAL) which was written completely in C. But, the fact of the matter is, this useful (but huge) kernel module is there now (and it has been here since the early 2.2 kernels), and it was not written just to "prove" that it could be done, but because C++ seemed at the time to be the best language for the job. The start of this project may very well predate the many times that this was hashed-over on the LKML (disclaimer: I wasn't there, so I don't know). You refer to "what can only be" the arrogance of the writers, yet continue by claiming: > I'd suggest that you spend some time converting it to C if you need > that "module". and > The conversion will surely take less time than going through the > kernel headers looking for "::". Excuse me, but before calling somebody else arrogant, I would suggest that you might want check whether you're not calling the kettle black. It's not a sign of modesty when you assume without a trace of doubt that a module (that happened to have been developed over the course of four years by a team of people at MIT) is just a "\"module\"" and that it will take less time to port it to C than to make the kernel headers parse in a C++ extern "C" clause. In addition, imagine how you would feel if somebody referred to your work as a "\"module\""! The fact that you "can't imagine why anybody would even attempt to write a kernel module in C++" may just as well be due to a lack of imagination on your side, but in your statement I detect no trace of a doubt. And _yes_ you may very well be right about their initial decision being stupid (and you might not be -- I don't know), and _yes_ you are probably right about the whole thing being hashed-over many times (I don't know -- I wasn't there), and _yes_ there are people out there who would do anything just to prove they can do something others think is impossible or just filthy. So, yes, there _may_ be a point to what you're saying. _May_. I'm not saying you're wrong, and I'm not saying you're right. What I'm saying is that simply assuming that any C++ module is nothing more than a few lines of (de)glorified C and accusing the writers of being arrogant just because they wrote a kernel module in C++ is, in my opinion, jumping to conclusions based on technical-preference-turned-prejudice (at least, that's how it seems), and it's not very polite either. Unfortunately, this is how flame wars get started (as can be seen by the slightly agitated tone this message has taken, sorry about that! :) ). Just to make this clear to everyone: I'm not trying to instigate a flame war here about C vs. C++, as I don't really have an opinion on that subject. This posting has to do with my preferences w.r.t. personal style, and nothing with my technical preferences. -- Bart
From: Richard B. Johnson [email blocked] Subject: Re: Compiling C++ kernel module + Makefile Date: Mon, 19 Jan 2004 13:39:43 -0500 (EST) The possibility that something may have been written by some MIT people can't change the fact that C++ is not the tool that should have been used within the kernel. I once worked on a project at Princeton. That doesn't make me know anything about Relativity. Einstein didn't rub off due to some proximity effect. If the "MIT Team", as you so state, had actually inspected some kernel code, and actually understood what a Linux/Unix kernel does, then learned persons could not possibly have selected C++ for this project. If you review the project, you will probably also find that a large percentage of the code should have been implemented in user-mode (a daemon, or several). That's where C++ really shines. However, it wasn't. Which, to me, means that the developers were either clue-less or, once somebody actually figured out how a kernel works, it was way too late to change (an all to common problem). The number of persons who worked on a project does not affect the correctness of the tools nor the architecture chosen. Facts are not democratic. You can't vote them into or out of existence. > Unfortunately, this is how flame wars get started (as can be seen by the > slightly agitated tone this message has taken, sorry about that! :) ). > Just to make this clear to everyone: I'm not trying to instigate a flame > war here about C vs. C++, as I don't really have an opinion on that > subject. This posting has to do with my preferences w.r.t. personal > style, and nothing with my technical preferences. > This is not about preferences. Most software engineers wish that everything could be done using the first language they learned. Once they try to write a state-machine in FORTRAN (my native language), they begin to understand that there are other tools more suited for the job. Unfortunately, especially for students at well-known universities, learning a language often opens the door to a cult. I remember the "Pascal cult", the "forth cult", the "C cult" the "C++ cult", and now the "C# cult". Next year there may be "D" and the cycle will continue. Cheers, Dick Johnson Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips). Note 96.31% of all statistics are fiction.
From: Bart Samwel [email blocked] Subject: Re: Compiling C++ kernel module + Makefile Date: Mon, 19 Jan 2004 21:02:43 +0100 > The possibility that something may have been written by some MIT people > can't change the fact that C++ is not the tool that should have been > used within the kernel. I once worked on a project at Princeton. That > doesn't make me know anything about Relativity. Einstein didn't rub > off due to some proximity effect. No. But the fact that you haven't seen the module means that you can't possibly know whether the module is a "\"module\"" or just a "module" -- there are probably solid technical reasons to dislike C++ in the kernel, but that is no excuse to start calling things "\"module\"" instead of just "module". The fact that you're now attacking this minor point (the fact that these people happen to be MIT people) means that you missed the major point -- you were jumping to conclusions and calling people arrogant without checking the specific background, and without reserve. I usually think it's wise to *either* not check the background *or* keep no reserve, but not both. But that's just me. :) > If the "MIT Team", as you so state, had actually inspected some > kernel code, and actually understood what a Linux/Unix kernel does, > then learned persons could not possibly have selected C++ for this > project. > > If you review the project, you will probably also find that a > large percentage of the code should have been implemented in > user-mode (a daemon, or several). That's where C++ really shines. For most projects, you might be right. For this project, I think you're not. This project implements a new network router design, one that is aimed at achieving the best possible routing performance that can be achieved while maintaining maximum flexibility. The flexibility is achieved by having large amounts of configurable elements available, so that practically any routing task can be composed of the available elements. To achieve enough speed (and lack of latency) to be really viable as a router, they need to be as close to the hardware as possible. See it like this: as soon as pkttables can be moved to userspace with negligible performance loss, this app will be able to move too. > However, it wasn't. Which, to me, means that the developers > were either clue-less or, once somebody actually figured out > how a kernel works, it was way too late to change (an all to common > problem). The router code of the project works both in userspace and in kernel-space. It just works much slower in userspace. If they were able to get the right kind of performance in userspace they probably would. AFAIK these guys were also very early in the adoption of polling, according to the changelog they built polling support in April 2000. This got them a 4-5x speed increase. Not your typical project that you can make a daemon -- unless you're working in a microkernel OS, of course. Definitely not in Linux 2.2. > The number of persons who worked on a project does not affect the > correctness of the tools nor the architecture chosen. Facts are > not democratic. You can't vote them into or out of existence. The main point of that phrase was to indicate that more than four person-years went into this module. It didn't have anything to do with facts regarding correctness nor architecture, only with the fact that you stated without much reserve something that led me to believe that you had not considered that the size of this module may be larger than you imagined. >>Unfortunately, this is how flame wars get started (as can be seen by the >>slightly agitated tone this message has taken, sorry about that! :) ). >>Just to make this clear to everyone: I'm not trying to instigate a flame >>war here about C vs. C++, as I don't really have an opinion on that >>subject. This posting has to do with my preferences w.r.t. personal >>style, and nothing with my technical preferences. > > This is not about preferences. Most software engineers wish that > everything could be done using the first language they learned. Once > they try to write a state-machine in FORTRAN (my native language), they > begin to understand that there are other tools more suited for the > job. Unfortunately, especially for students at well-known universities, > learning a language often opens the door to a cult. I remember > the "Pascal cult", the "forth cult", the "C cult" the "C++ cult", and > now the "C# cult". Next year there may be "D" and the cycle will > continue. Yes, I know how this works. Although I have never programmed in FORTRAN, I have at least 15 other languages on my list (covering all of the well-known paradigms), not counting scripting languages, and I know that there is definitely a thing such as "the right tool for the right job". I do not dispute that. What I care about is your response, which seemed to indicate that you had already grouped the module authors in the "C++ cult" category, without keeping open the possibility that they might not be. You had already called them arrogant without checking any background. I don't care if they _are_ part of the "C++ cult", as you call it, but you had not enough information at this point to derive that. It seems that you're so allergic to the idea of mixing C++ with the kernel that you're blocking all possibility of discussion immediately. Calling somebody "arrogant" before they can even tell you why they did what they did is a perfect way to prevent any reasonable conversation from happening. It's not productive towards solving the problem at hand, and also not towards convincing people of your opinion. -- Bart
From: Richard B. Johnson [email blocked] Subject: Re: Compiling C++ kernel module + Makefile Date: Mon, 19 Jan 2004 15:37:46 -0500 (EST) On Mon, 19 Jan 2004, Bart Samwel wrote: > Richard B. Johnson wrote: > > On Mon, 19 Jan 2004, Bart Samwel wrote: > [... lots of text ...] [Snipped...] I stand by my assertion that anybody who develops kernel modules in C++, including MIT students, is arrogant. Let's see if C++ is in use in the kernel. At one time, some of the tools that came with it were written in C++ (like ksymoops). Script started on Mon Jan 19 15:19:33 2004 $ cd /usr/src/linux-2.4.24 $ find . -name "*.cpp" $ exit exit Script done on Mon Jan 19 15:20:25 2004 Well, perhaps the kernel developers were ignorant. They didn't write anything in C++. Maybe they were just too dumb to learn the language? Maybe there is another reason: The kernel development languages, as previously stated, were defined at the project's inception to be the GNU C 'gcc' compiler's "C" and extensions, and the 'as' (AT&T syntax) assembler. Anybody can search the archives for the discussions about using C++ in the kernel. Any person, or group of persons, who is smart enough to actually write some kernel code in C++, has proved that they are not ignorant. Therefore, they have demonstrated their arrogance. Cheers, Dick Johnson Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips). Note 96.31% of all statistics are fiction.
From: Robin Rosenberg [email blocked] Subject: Re: Compiling C++ kernel module + Makefile Date: Tue, 20 Jan 2004 01:59:22 +0100 måndagen den 19 januari 2004 21.37 skrev Richard B. Johnson: > Let's see if C++ is in use in the kernel. At one time, some > of the tools that came with it were written in C++ (like ksymoops). > > Script started on Mon Jan 19 15:19:33 2004 > $ cd /usr/src/linux-2.4.24 > $ find . -name "*.cpp" > $ exit > exit > Script done on Mon Jan 19 15:20:25 2004 > This is the "We've always used COBOL^H^H^H^H" argument. -- robin
From: Linus Torvalds [email blocked] Subject: Re: Compiling C++ kernel module + Makefile Date: Mon, 19 Jan 2004 22:46:23 -0800 (PST) On Tue, 20 Jan 2004, Robin Rosenberg wrote: > > This is the "We've always used COBOL^H^H^H^H" argument. In fact, in Linux we did try C++ once already, back in 1992. It sucks. Trust me - writing kernel code in C++ is a BLOODY STUPID IDEA. The fact is, C++ compilers are not trustworthy. They were even worse in 1992, but some fundamental facts haven't changed: - the whole C++ exception handling thing is fundamentally broken. It's _especially_ broken for kernels. - any compiler or language that likes to hide things like memory allocations behind your back just isn't a good choice for a kernel. - you can write object-oriented code (useful for filesystems etc) in C, _without_ the crap that is C++. In general, I'd say that anybody who designs his kernel modules for C++ is either (a) looking for problems (b) a C++ bigot that can't see what he is writing is really just C anyway (c) was given an assignment in CS class to do so. Feel free to make up (d). Linus
From: Bart Samwel [email blocked] Subject: Re: Compiling C++ kernel module + Makefile Date: Mon, 19 Jan 2004 22:24:39 +0100 Richard B. Johnson wrote: [...] > I stand by my assertion that anybody who develops kernel > modules in C++, including MIT students, is arrogant. > > Let's see if C++ is in use in the kernel. At one time, some > of the tools that came with it were written in C++ (like ksymoops). > > Script started on Mon Jan 19 15:19:33 2004 > $ cd /usr/src/linux-2.4.24 > $ find . -name "*.cpp" > $ exit > exit > Script done on Mon Jan 19 15:20:25 2004 Just so that you know, the extension .cpp is typically used by Windows C++ programmers, on most other environments the usual extensions are .cc and .C. If you look for *.cc you find scripts/kconfig/qconf.cc, so the kernel toolset is not completely C++-free. Not that all of this matters. > Well, perhaps the kernel developers were ignorant. They didn't > write anything in C++. Maybe they were just too dumb to learn the > language? It seems you you assume I'm an arrogant Bjarne-hugging C++-lover. Where did you get that? It's probably in your mind, where everyone who suggests C++ is a Bjarne-hugging C++-lover. I'M NOT IN THE C++ CULT. I'M NOT SAYING THAT EVERYONE SHOULD PROGRAM IN C++. Hope this came across, you are now officially declared deaf. ;) > Maybe there is another reason: > The kernel development languages, as previously stated, were > defined at the project's inception to be the GNU C 'gcc' > compiler's "C" and extensions, and the 'as' (AT&T syntax) > assembler. Anybody can search the archives for the discussions > about using C++ in the kernel. Yeah, definitely. I fully agree that it's not wise to use C++ *in the base kernel*. The Linux project needs to maintain overall consistency, and one of the means of doing that is using a small, well-defined toolset -- in this case, as and gcc. Any large project needs language and coding standards. But we're not talking about the base kernel here. We're not talking about migrating the kernel to C++, or even modules that are part of the Linux kernel source. We're talking about *independent modules*. The kernel exports a module interface, and any binary driver that correctly hooks into the interface of the running kernel (using the correct calling conventions of the running kernel) and behaves properly (e.g., doesn't do stack unwinds over chunks of kernel functions etc.) can hook into it and do useful work. If somebody has decided that it would be worth it for his project to use C++ (without exceptions, rtti and the whole shebang) then so be it, why should you care? It's just binary code that hooks into the module interface, using the correct calling conventions. It doesn't do dirty stuff -- no exceptions, no RTTI, etcetera. It compiles into plain, module-interface conforming assembler, that can be compiled with -- you guessed it -- 'as', the AT&T syntax assembler. Yes, they're taking a risk. Their risk is that C++ can't import the kernel headers, or that C++ might someday need runtime support that cannot be ported into the kernel. It's *their risk*, not yours. Then why do you have a reason to get religious about this? They're not submitting this stuff for inclusion in the Linux source! > Any person, or group of persons, who is smart enough to > actually write some kernel code in C++, has proved that > they are not ignorant. Therefore, they have demonstrated > their arrogance. This logic is faulty. It is built upon the premise that (ignorant || arrogant). Not listening to warnings of others is not a sign of arrogance per se, it is only a sign of the presence of a different opinion. It assumes that the kernel developers are always right, and that everybody who is smart should listen to them, on penalty of being arrogant. Yes, these C++-loving people may be wrong (or they may not be), but that does not _automatically_ make them arrogant, they may simply have a different opinion -- right or wrong. If they are wrong, they are not arrogant, but simply *stupid*. If they are right, they are not arrogant either -- they may be arrogant *about it*, but that's just a manner of behaviour, and it's up to them if they behave in this way or not. Kernel developers do not prescribe what people can do with the kernel, this is part of the essence of "free". And as a result of that, they do not have the right to declare people arrogant when they do not listen. They have the right to *call* them that, but the only result of that is that all discussion on matters like these are smothered in religious wars. And that's a pity. -- Bart
From: Richard B. Johnson [email blocked] Subject: Re: Compiling C++ kernel module + Makefile Date: Tue, 20 Jan 2004 10:20:53 -0500 (EST) On Mon, 19 Jan 2004, Bart Samwel wrote: > not. Kernel developers do not prescribe what people can do with the > kernel, this is part of the essence of "free". And as a result of that, > they do not have the right to declare people arrogant when they do not > listen. They have the right to *call* them that, but the only result of > that is that all discussion on matters like these are smothered in > religious wars. And that's a pity. It's not, as you say, a religious war. Whether or not one can use the back-end of a hatchet as a hammer does not qualify the hatchet as a hammer. Let me introduce the concept of a "learned person". Such a person might not actually exist. However, for my proposes, a learned person knows everything there is to know about solving the problem at hand. This is a definition. It is not subject to discussion. C++ was designed as an object-oriented language. C and assembler are procedural languages, as have been most all previous programming languages. The coding of operating systems is all about procedures. In fact, one of the reasons for the superiority of Linux is the great attention to the details of the actual execution mechanisms and the actual execution paths. An object-oriented language relies upon the compiler and libraries to work out the execution mechanisms to be used. The programmer is shielded from the actual mechanisms that implement the objects being manipulated. For instance, in C, one can code a loop counter and code the actual mechanisms by which a procedure may terminate. In C++, one may use iterators. Whether or not there is some actual counter is an implementation detail that can be hidden from the programmer. Of course one may also write C-like code when using C++ because there are some things that an object- oriented mechanism can't do by itself. This allows one to write loops with loop-counters in C++. The fact that C++ can be used somewhat like C does not make it a substitute for C anymore than a hatchet is a substitute for a hammer. Because of the object-oriented design of C++, there is considerable overhead necessary to make it function in an environment with many other objects. C has some overhead of its own, too. However, it is quite minimal. Local variable space is allocated simply by subtracting a value from the stack-pointer, for instance. The overhead of a particular language is often demonstrated by writing a simple "Hello World!" program in that language and then displaying the result as the size of the executable. This, of course, is quite unfair. It really shows how smart the linker is. A smart linker will link in only the required code. Linkers are pretty dumb. In the kernel, a linker doesn't have to be smart because the programmers have provided only the code that should be executed. There is no runtime library. Nevertheless, I provide three programs, one written in C, the other in C++ and the third in assembly. A tar.gz file is attached for those interested. -rwxr-xr-x 1 root root 57800 Jan 20 10:16 hello+ -rwxr-xr-x 1 root root 460 Jan 20 10:16 helloa -rwxr-xr-x 1 root root 2948 Jan 20 10:16 helloc The code size, generated from assembly is 460 bytes. The code size, generated from C is 2,948 bytes. The code size, generated from C++ is 57,800 bytes. Clearly, C++ is not the optimum language for writing a "Hello World" program. Because many persons don't know assembly language, it is probably not the best language either, in spite of the fact that the executable file is only 460 bytes in length. Therefore a learned person, given the task of choosing the language in which to write "Hello World!" would likely use 'C'. In spite of the fact that it can be written in C++, I suggest, in fact insist, that a learned person would never write such a program in C++ except for the purpose of demonstrating that it can be done. When writing code for a project, one is not usually presented with a bunch of languages from which one can choose on a whim, or by throwing darts. Instead, there are specific requirements defined by the nature of the work to be done. There is no learned person who would require that a data-base project be written in assembler. It is quite likely that the optimum language would be C++. There might be certain portions of the resulting executable that, in fact, were written in assembler, probably a lot of the runtime library. When writing a data-base program, one absolutely positively must not know what the underlying data-fetching mechanisms are because, once known and used to define (poison) the design, the program may run poorly on a network. This is one of the areas where object-oriented programming really shines. However, when writing code that runs in an Operating System, one is most entirely concerned, in fact consumed with the mechanisms by which the required functionality is obtained. Programmers spend hours, days, even weeks, shaving microseconds off from critical execution paths. This is because any resources used by the Operating System directly affect every task running under that Operating System. A learned person would never allow the code, defined by the designers of a compiler, to make the final decision about the mechanisms necessary to perform the required functions. Instead, the Operating System programmer makes those decisions. That's why a procedural language must be used in coding Operating Systems. The result of such attention to details is the Linux Operating System. Now, if you want to trash your copy of the Operating System with the output spewed from a C++ compiler, then I suggest you keep it real quiet. It is similar to "touching up" a famous painting with spray-paint, of defecating on a wedding cake. Again, writing a Linux kernel module in C++ demonstrates arrogance, absolutely, positively arrogance, and is an affront to the programmers who have dedicated major amounts of their time optimizing code execution in the kernel. Cheers, Dick Johnson Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips). Note 96.31% of all statistics are fiction.
From: Zan Lynx [email blocked] Subject: Re: Compiling C++ kernel module + Makefile Date: Tue, 20 Jan 2004 10:34:39 -0700 On Tue, 2004-01-20 at 08:20, Richard B. Johnson wrote: > Nevertheless, I provide three programs, one written in > C, the other in C++ and the third in assembly. A tar.gz > file is attached for those interested. > > -rwxr-xr-x 1 root root 57800 Jan 20 10:16 hello+ > -rwxr-xr-x 1 root root 460 Jan 20 10:16 helloa > -rwxr-xr-x 1 root root 2948 Jan 20 10:16 helloc > > The code size, generated from assembly is 460 bytes. > The code size, generated from C is 2,948 bytes. > The code size, generated from C++ is 57,800 bytes. > > Clearly, C++ is not the optimum language for writing > a "Hello World" program. I like C++ and hate to see it so unfairly maligned. Here's a much better example: Makefile: helloc: hello.c gcc -Os -s -o helloc hello.c hellocpp: hello.cpp g++ -Os -fno-rtti -fno-exceptions -s -o hellocpp hello.cpp Both programs contain exactly the same code: one main() function using puts("Hello world!"). # ls -l -rwxrwxr-x 1 jbriggs jbriggs 2840 Jan 20 10:02 helloc -rwxrwxr-x 1 jbriggs jbriggs 2948 Jan 20 10:06 hellocpp 108 extra bytes is hardly the end of the world. -- Zan Lynx [email blocked]
From: Richard B. Johnson [email blocked] Subject: Re: Compiling C++ kernel module + Makefile Date: Tue, 20 Jan 2004 13:10:21 -0500 (EST) Well you just fell into the usual trap of using the "C-like" capabilities of C++ to call a 'C' function. If you are going to use 'C' library functions, you don't use an object-oriented language to call them. That is using a hatchet like a hammer. I did not malign C++. I used it as it was designed and let the chips fall where they may. Cheers, Dick Johnson Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips). Note 96.31% of all statistics are fiction.
Nope. Irrelevant.
> I'm sorry but it is. Read it again. Read the context. It was in
> response to someone who basically asked why there was no C++ in
> the kernel.
I went back and read it and read for context. I stand by my statement.
Relevant!
Robin's comment is basically saying "you guys don't use C++ because you've always used C and you hate anything else".
Linus said no, actually his biggest problem with it is with "blah blah". He was offering an explaination as to why he doesn't like C++ for the kernel. What is irrelevant about that?
Re:
http://kerneltrap.org/node/view/745?from=70&comments_per_page=35
Re:
go here
http://kerneltrap.org/node/view/745?from=70&comments_per_page=35
Re:
go here
Metaprogramming!
Anyone that wonders what C++ can really do needs to look at www.boost.org. The future belongs to those that can figure out how to make the compiler do work for you, instead of taking a runtime hit. I don't mean that the compiler designers do things behind your back; with metaprogramming (templates), you can 'script' the compiler to do things exactly as you intend. This allows you to say *exactly* how things are laid out in memory for instance.
Particularly take a look at the multi_index_container in boost. This library does not use RTTI or exceptions; it isn't even all that OOPy, but it could *never* be done in C without lots and lots of macros, and even then it would not be type safe.
I think kernel developers have a LOT to gain by using metaprogramming techniques.
C++ is "Multi-Paradigm"
This Richard B. Johnson talks about C++ as an object oriented language, despite the fact that its inventor is considering it as language which supports multiple programming styles. Mr. Johnson also speaks about the arrogancy of those trying to implement kernel modules in C++.
Now, isn't narrowing the capabilities of C++ to only its object oriented features arrogant?
As was noted above, much of his arguments against C++ are a bit weak. Especially his comment
'Well you just fell into the usual trap of using the "C-like"
capabilities of C++ to call a 'C' function. If you are going
to use 'C' library functions, you don't use an object-oriented
language to call them. That is using a hatchet like a hammer.'
is bogus. That you can call C functions from C++ just shows that there is a great degree of compatibility between the languages. This really has nothing to do with a "trap". Second, there isn't even a way to output a string to the console in C++, where you use object oriented syntax with regard to the string. So his example (presumably) is even showing a lack of knowledge of C++.
Design problem
Actually the fact, that C++ is _faking_ compatibility to C is really one of the worst design errors made in designing C++. The fact we haven't an efficient open OO language (because SUN refuses to give us a complete, binary-compiling language with a Java->Native design or at least the permission to compile their class collection to binary for GCJ) is the fact that leaves C++ a worthwhile language for app programming. It's ugly, yet powerful, but is overcomplex, and continues to show its design errors, which lead to subtle and hard-to-track bugs you need all those "Effective C++" tricks to track them for.
And it is not completely C compatible (and either you are compatible or not, and not "nearly there"), it does poorly for shared libraries, and whatever, I don't like it as an OO language (because it mostly add s complexity instead of reducing it) and as a structured programming language (either we do C and let the linker do the binding, or not) it is not worthwhile either. The multi-paradigm stuff from Bjarne is just another way of saying "Wasn't really sure, sounded nice, let's leave proper design to others and make a fun, feature-creapy language for no valid reason". Doesn't work in Perl or Python either: Having some functional constructs doesn't give you a functional language. But those are scripting languages, they may be allowed some playful fancies, especially when having no design at all, like Perl.
I really like Java, because it gets jobs done more easily, I like C because it hands a straight and direct tool to those doing efficient coding as in the kernel and in system libraries, and I hate C++ because it pretends to be a "be all end all" and does all of its jobs poorly.
Having said all that, it would still have been nice if there had been some useful answer for the guy asking, as an act of sympathy. :) He stated his point quite well, and obviously has little other choice than getting it to compile or scrap years of work.
Oliver Korpilla
Re: Design Problem
Actually the fact, that C++ is _faking_ compatibility to C is really one of the worst design errors made in designing C++.
It is true that C and C++ are not completely compatible. But "faking" still isn't the right term. Most of the incompatibility happend with C99 which came after the first C++ standard, so for these aspects you can't blame C++. Second, there really is some compatibility, the fact that you can call C functions from C++ is tremendously helpful for some applications. And the syntactic similarity makes it at least possible to gradually use advanced features of C++ for programmers who have a background in C.
You state that C++ is overcomplex, but you don't have to use all these complex features.
You state that C++ leads to subtle bugs but later on state that you like C, this sounds somewhat contradictory to me, because C++ offers features that reduce the likeliness of bugs slipping in. One of the examples is RAII, which was mentioned in a comment before. Another example is the availability of standard containers, so you don't need to code lists or dynamic array like containers yourself. I am pretty sure there exist non-standard C libraries for that, but generic ones are without templates likely to have deficiencies with regard to type safety, and their syntax is presumeably tedious.
And please note that rarely anyone of the designers of C++ claim that C++ is the "be all end all".
Without using the complex fea
Without using the complex features, there is hardly a point in using C++. C++ could be a great OO language, if, and only if, _all_ the finetuning features close to the hardware or C concepts would be optional, and not required of you. Why not make Garbage Collection the default, and let the user shut it off (or extend it)? And the inheritance model is clearly not very good, it was the one other designers learned from how not to do it (Java, Python, etc.).
Standard containers are nice, but what help are they to a _KERNEL_ coder? Come on, I like good class libraries really very much, and think the STL being the only thing that is great about C++, but it is simply nowhere useful in _KERNEL_ coding. Write your apps in it, may be fine. But not a kernel module. Should have never started that way.
And I see the "be all end all" statement more implicit, because of the nature of C++ language design.
Having said all that, I believe there are applications for C++, but they are not in kernel coding, and not in all of the "mainstream" app coding. The inability of C++ to provide us with productivity-enhancing constructs is actually the reason why a copy-cat language like C# (should've called it Java++) will be a winner on the market.
-------------------------------------------
As seen on the Tree Channel.
Re: Without the complex fea
Okay, all of the arguments you and I have written are pretty much debatable, and I have no Problems that you personally came to other conclusions regarding the viability of C++ as a general purpose programming language. But then, I still want to state my objection to some statements you made, because I think they do not reflect the experience of most people working with C++.
First, I personally see a point in using C++ without its complex features. Take for example a std c++ vector (and the other containers alike, althoug a std map is of course a bit more complex than vector). Just using a vector instead of hand coding a dynamic array saves you from a tedious and repetitive task, which possibley lets errors slip in. Or the std string which really simplifies matters of memory management for string operations.
I agree that std containers could pose problems in kernel space, but I think the discussion drifted away from the original topic of C++ in kernel, to critique of C++ in general.
I do not think GC as a default in C++ would be good decision, because GC does not solve the problem of ressource management in general, so applications for it a more specific in nature. With other words, if GC could be helpful to a project, its designers will recognise that soon, and likely employ it.
Then, you state that the inheritance model of C++ is "clearly not very good". I do not understand what you mean, and I would be very grateful if you explain in what way you mean it, because I think inheritance in C++ is simple enough to be of practical usefulness (But I agree that inheritance involving class templates is a more complicated matter, for example with regard to name lookup), and I can not see why inheritance in Java would be "better".
At the end of your post you write of "The inability of C++ to provide us with productivity-enhancing constructs". Now this is some kind of statement that remembers purely of marketing babble. I have never seen that anyone could provide any facts why Java provides "productivity enhancements" over C++, and I heavily doubt that there are some. There is one thing tho, with java there is a big library and framework distributed so that developers do not need to look somewhre else. I think this is one reason that views on java and C++ are distorted.
C++ inheritance model
I'm not the poster you replied to, but I can give you a number of reasons why the C++ inheritance model sucks.
1. You have to specify "virtual" in order to make something use dynamic dispatch. This violates the open/closed principle: you often cannot extend a base class without modifying it.
2. Multiple inheritance is provided, but no method is provided to disambiguate the methods of the inherited classes. There is no support for renaming or other trickery, which makes multiple inheritance very useful in languages like Eiffel.
3. Virtual inheritance. Why do you have to specify it where the inheritance takes place? Why is there no way to not merge the base classes further down in the hierarchy if you so please?
Basically, the inheritance model requires far too often that you go back and make changes to classes that you derive from. These classes should be closed for modification and open for extension, but instead they're only open for extension if they were specifically designed with reuse in mind. From the point of view of efficiency, the design choices are understandable because C++ has always had to fight the impression that "C++ is slow". However, from the point of view of language usability the model is definitely atrocious.
Bart Samwel
Re: C++ inheritance model
Thanks for your post and that of Oliver Korpilla below! Usually these discussions die away over the days without really helping anyone to understand the positions of others better. At least that is the impression I gained. This is a welcome variety.
I will reply in order of your arrangement.
1. This is a valid critique. But it matters most if your focus is on "real" object oriented code where many classes serve as base classes. But C++ classes are often "concrete" in nature, i.e. they offer one specific functionality that supposedly can not be extended by base classes in a meaningful manner. One example would be a class that models the data of a SQL database record. It will not make sense to derive classes of it, because if the layout of the database changes, you will have to adapt base classes anyway. Another example are iterators for container classes. It is (highly) unlikely that you will ever redefine functions of iterators in a derived class.
So making virtual funtions the default, will let you write less code at one place, while you have to write more code at other places.
2. Hm, I think there is a method. Just place something like
"using name_of_base_class :: name_of_method ;" in your derived class. I can't comment on the mentioned renaming though, because I do not know Eiffel enough.
3. I think there exist efficiency reasons: If a base class is inherited virtual, you no more know the exact memory layout of the complete object at compile time, so the runtime calculations to resolve the sub-object are more complex.
As for the second point you mention, although I guess there won't be substantial performance penalties over "plain" virtual inheritance, I can not think of a reason why one would need this funtionality. I wonder if there are languages which allow this? Please feel free to show an example, if you know one. That would help me realise.
As for your last paragraph; in C++ to reuse code it often is the best way to make objects member of some class in order to reuse the functionality they provide. This is different from other languages, I know, but when you get used to it, it really makes sense. So I kind of think that your assertion that in C++ "classes ... are only open for extension if they were specifically designed with reuse in mind" is incorrect: You can pretty much reuse every class as a member, only if you want to inherit from a class, it has to be designed for this purpose. And that, I think is a major benefit! (Disclaimer: At least in C++ it is benefit, I can not comment very much on other languages.)
Volker Lukas
Oops! I have to self-reply be
Oops! I have to self-reply because i misread one thing!
So I kind of think that your assertion that in C++ "classes ... are only open for extension if they were specifically designed with reuse in mind" is incorrect: You can pretty much reuse every class as a member, only if you want to inherit from a class, it has to be designed for this purpose.
I misread that you wrote "open for extension". Of course with extension through subclassing I agree with your statement.
Re: C++ inheritance model
Quickie response:
1. I could imagine a "final class" construct that makes every method in that class final and to remove the possibility of inheriting from a class. Another possibility would be to increase the difference between "struct" and "class", where "struct" had "final" as the default and "class" had "virtual" as the default.
2. What about repeated inheritance?
3. Efficiency is definitely the reason for this. Unfortunately, that doesn't make it nice. :) The other thing has to do with choice; you want to place your inheritance choices in the derived classes, not in the base classes. This is exactly the reverse situation from when you need a virtual base class somewhere up in the hierarchy that currently isn't virtual: you need a nonvirtual base class somewhere up in the hierarchy that is currently virtual.
As for your last comment: sure, you can reuse anything using has-a relationships. This goes for all OO languages, so IMHO this isn't an advantage of C++. The fact that you have to plan for reuse in inheritance relationships is also nothing special, I must admit -- you have to keep this in mind when You're designing the class anyway. The only thing that bothers me is that the "virtual" stays in even if my program doesn't contain any derived classes that override the method. I guess I'm just a sucker for whole-program analysis. :)
Bart Samwel
Re: C++ inheritance model
Point 2: One would have to resort to another intermediate class to derive from I think. Fortunately non-virtual repeated inheritance is a rare case to encounter.
Last paragraph: Yes, what you write is true. But at least it is a benefit in C++ that members do not necessarily waste space needed for dynamic binding purposes. So while it is true that has-a and is-a relationships exist in all OO languages, the emphasis is different.
Good points. :) 1st) Sill
Good points. :)
1st)
Silly as it may sound first, C++ is really not a very efficient OO language. According to c't, a German IT magazine covering hardware topics mostly, C++ did better than Java, C# and Delphi when using procedural programming utilizing objects from the standard library, but when actually creating and destroying a lot of objects C++ lost to Java and C# during the lifetime of the benchmark programs. Possible reasons for this behaviour could only be speculated about, but named where highly optimized runtime systems/VMs and the complex object / inheritance model of C++. At least the 1st phrase could be taken as: Knowing more about your objects (as e.g. the Java VM does) allows you to optimize more. So C++ may actually be no longer the king of the hill for OO perfomance, possibly (!) voiding a longstanding argument for C++ use.
2nd)
The thing about productivity could be characterized as marketing babble, as you say, but what sounds more likely: A programmer having to deal with segmentation faults, the intricacies of multiple inheritance, memory management etc. is possibly writing less code that is solving the problem the program is to be about. It simply smells like premature optimization. Nobody can convince me for example that a C++ coder and a Java coder of similar skill will be equally productive when writing a server program (ignoring the extensive Java libs for that area for the moment).
3rd)
The Java inheritance model: One implementation inheritance, many interface inheritances, simply is clever and suits the inheritance structure fine. It forces you to use it, but it is a very sensible one. It's a simply one. It avoids unnecessary complexity that IMHO is simply not very useful.
4th)
We should at least maintain some reference to the kernel, and agree to the fact: The C++ libraries would do poorly in the kernel, and are one of the main reasons why C++ can be used more productively than C. If you boil down C++ usefulness to kernel to compiler features GCC may actually do an equally good job for C: Remember, the kernel uses those nifty extensions.
I would have actually thought of inheritance, namespacing and overloading as much more useful than that and wonder why nobody mentioned that? ;)
----------------------------------------------
As seen on the Tree Channel
Re: Good Points
Thank you for replying.
I will reply in order:
1. I know the article of that magazine. Unfortunately, this article was (better: is) highly misleading. The authors could be, notwithstanding all due respect to their person, attributed as dilettantish C++ coders. They made a lot of stylistic and efficiency wise problematic decisions in their C++ code, and consequently their article was heavily debunked in public. See for example:
http://www.heise.de/ct/foren/go.shtml?read=1&msg_id=4318247&forum_id=2
and
http://www.heise.de/ct/foren/go.shtml?read=1&msg_id=4478638&forum_id=2
(everything in german language)
The authours actually did not even compare "real" C++ to java and C#, because they used a lot of non-standard C++ code, where standard equivalents were available.
Your statement that with knowledge about existing objects a VM can optimize code at runtime is correct. But this sounds a bit theoretical to me, I wonder if it matters in practice. And: You can use C++ with a VM as well, so the same kind of optimisations are possible with C++ as well.
2. For the segmentation faults etc...: I think this has something to do with HOW you learn C++. You can of course start with all the complex features like --- templates + multiple inheritance and casting between sibling classes while overloading global operator new and stuff... (contrived example that is) --- but I guess it is more advantageous to start with just using the standard containers, coding some functions, learning to organise a programming task with classes and inheritance. Than you can gradually learn more about templates, other features, and technical details about C++.
For the server programming, and the programmers of similar skill: I tend to agree with you that on a lower niveau a java programmer might be more productive than a C++ programmer. But hey, why not learn and become a better programmer? And if you learn to use C++ well, then, I think, the head start of the java programmer will vanish, and, eventually, reversed (again leaving the java framework aside).
3. As simple as you have outlined the case for java, I must say that the one for C++ is a pure extension: In addition to java, you have "full" multiple (implementation) inheritance at your disposal. Why should this be counter productive? Please note that multiple implementation inheritance has quite a resemblance to aggregation (it enables some kind of mixin style programming). If you take this perspective, its not really a complicated matter either.
4. With this point I agree very much. With regard to the kernel, it really is questionable whether C++ make much sense.
Volker Lukas
object-oriented syntax of console output
actually, consider,
cout << "Hello World! ";
and
int i = 1; cout << "Hello World! " << i;
wouldn't you say that this was object-oriented syntax in that << is an overloaded operator that allows polymorhism?
abdulhaq
Re: object-oriented syntax of console output
actually, consider, cout
Hm, I wrote "with regard to the string". This meant the common object-oriented idiom (so to speak) of sending the message "print yourself to console" to the string object. That is in C++ calling a member function of some string object. And this is obviously not possible in C++.
It's Free Software
I'd say this to the router people:
If the arrogant, anti-C++ people on one mailing list aren't interested in helping you, and wnat to work themselves in a frenzy of namecalling and offense-taking, who cares? Linux is free software. Do what you want and just ignore the bozos.
In fact, if you maintained on your own a patch that keeps kernel modules written in C++ working, other module developers might join you.
Objective C?
I don't know the language, but it could be a good alternative for C++...
Objective C is pretty cool, b
Objective C is pretty cool, but it'd be WAY worse than C++ for kernel stuff. Basically C++ is mostly focused on implementing OO features that can be resolved at compile-time. ObjC is focused on being a more "true" OO paradigm (like Smalltalk, etc) but it does more runtime binding/etc. For instnace, type checking of classes is done at run-time. Not the kind of stuff you'd want within 10 feet of a kernel.
If you google for "objective c" there's many good FAQs - it's an interesting language!
objective c in kernels
I think an OO language is ok for a kernel. I tried full blown c++ in a kernel. A small toy kernel and its ok. I based it from Chorus. I had to hack the runtime a little. Imagine writing a driver by subclassing another class.I have grown to dislike c++ though.
Im into objective-c now and i think that with a runtime optimized for kernel space is ideal. IMHO.
C, C++
My understanding of the two primary languages here (C and C++) is that C has been the following, especially if you come from an ASM background:
C allows you to see the clock cycles in every declaration and statement. Obviously it is higher level than ASM but you can still gauge the actual code with an ASM flavor with the added gain of portability, etc.
C++ on the other hand, while being touted as not making you pay for something you don't need, does not really shine under these circumstances. C++ strength is in its abstraction mechanisms to create a "more expressive" code (up for debate I know) and less "how many clock cycles will this statement create" view for any given statement.
As for Objective C, I honestly admit that I'm not as versed with, compared to C or C++, because the basic premise is the same as using C++ as a "better C" which I refer back to the above.
I use both languages heavily (C systems programming/C++ user applications) and this has been my own empiricle stance for quiet some time and largely how I base a decision on which language to use for a given problem domain. I throw this out there because it is not a point I see made that often for what it is.
What's wrong with this site
If I try and change the comment view settings I get taken back to the front page. WTF?
The same thing happens when I
The same thing happens when I reply to a comment. It's a little annoying, imo.
kerneltrap is broken
If you are anonymous, you are SOL. It plain doesn't work. Sometimes you can get it to work by changing the settings on the previous article, but not always. I think the problems go away if you create an account, but you may have to go back to the default layout (which, if you're like me, won't fit in your browser window) to change a setting, then go back to the layout that sucks less. It is screwey to say the least.
Even better is the "17 new comments" message when you do have an account: look at page 1, see 5 comments, go to page 2, see no new comments.
Wow
I'm amazed at how much can be typed for one subject. I program a lot and type a little.
Repeat
This comes up about every 6 months and the same discussion ensues. I discovered that code speaks louder than words on lkml. If someone codes together something in c++ that does something better than c it would be far more effective than any rhetoric.
Experiences with C++ in kernel
If someone codes together something in c++ that does something better than c it would be far more effective than any rhetoric.
The developers of the OpenBFS filesystem for OpenBeOS have positive experiences with C++ in kernel. They state their code is easier to maintain. See http://www.bug-br.org.br/openbfs/index.phtml?section=development
It could be partly our tools
I can imagine that a kernel built from the ground up to comprehend C++ and all its features would be doable. You'd end up with a layered OS, though -- a lower, primitive kernel that provides a run-time environment for handling the heap, vtables, exceptions, etc. and the higher level "kernel logic" layer written in C++.
The old LISP machines worked approximately this way, apparently. The whole OS was written in LISP overtop a heavily microcoded CPU that provided an "object floor." Because objects were first-class entities at the instruction set level, writing the OS in such a high-level environment is natural. Garbage collection and exceptions aren't a big deal to the kernel in that environment.
The main arguments I've seen against C++ in the kernel all boil down to one common theme: "too much hidden action that may not be appropriate for a kernel." As long as the system is designed from the ground up so that all the hidden action is "kernel friendly" and "well defined," I can see it working, and perhaps even working quite well. I also tend to think that getting that right may be hard enough that most projects would rather avoid doing it.
The reason I mention in the subject line that it could be partly our tools is that we really rely on whatever G++ outputs. If there is something in GCC's C++ runtime that is unacceptible in the kernel (eg. G++'s exception handling strategy or whatever), that could hold us back. There seems to be a mental barrier between the compiler guys and the kernel guys. The kernel guys don't want to write a language runtime environment. So, they use a language with a minimal runtime environment.
In the end, it's hard to retrofit a language with large runtime-environment demands onto an infrastructure which assumes that the only runtime services the language requires are a stack and maybe some stock library calls for math functions and memcopies.
Dick Johnson, upgrade your C++ compiler
$ cat hello.cpp
#include <iostream> int main() { std::cout << "Hello World\n"; return 0; }$ g++ -O2 hello.cpp -o hello+
$ strip hello+
$ ls -l hello+
-rwxr-xr-x 1 glaurent glaurent 3816 Jan 22 11:24 hello+
(this is with g++ 3.2.2)
Microsoft say the same years before ...
I remember the Batle "Borland C++ X MS C Develop Way"
in that time MS with arrogance, say that the better way
is using C. The time goes and C++ Wins.
In the case of the kernel, the comments
"AH soon classic" its perfect.
C++ == bad?
So is C++ bad?
No! No more than perl, fortran, or java are "bad". They are just tools. I can't say that C++ is bad any more than I can say that a hacksaw is bad. I wouldn't usually use a hacksaw for creating a wooden table, but that doesn't mean a hacksaw is "bad". If I wanted to make a table with certian metal parts I may need a hacksaw.
I don't know enough about this module to judge wether or not C++ was the right tool for the job or not(I would guess not). However I would reserve judgement on calling them either stupid or arrogant, untill I could walk in their shoes for a while.
Just a thought.
Richard B. Johnson is an arrogant jerk
That says it all. He basically is what he accuses the writer(s) of this particular module. As if somehow by writing this module in C++ has somehow harmed him.
C++ kernel runtime environment
Interestingly, Apple provides a C++ runtime environment for the Mac OS X kernel. However, it omits support for templates, multiple inheritance and exceptions.
high performance C++ kernel
Look at the L4 microkernel (http://l4ka.org/projects/pistachio) for an example of C++ offering high performance in low level project.
Anyone who has enough experience in this area knows that whether C or C++ is used is irrelevant, the issues lie with how each language meets the various constraints and requirements of the project in question. All of these technical issues being discussed are moot really, and I do not know why the topic needs to be engaged.
Agreed
http://www.faqs.org/docs/artu/
em?
If we use C++,
we can also use Ada,etc.& I prefer Ada...
hah...
That's right. Ada is always
That's right. Ada is always a great idea. If we use Ada instead of C/C++ we're receiving a great power. A power to really prove our software to be better than Microsoft's or Apple's one. I can't trust men freely. I can't trust new mottos about safety freely. But if something is written in Ada it's usually a thruthworthy piece of software.
Cyclone can also be quite good here. But Cyclone is experimental while Ada is to have 3rd ISO standard soon, Ada 2005. I'd like to choose Linux instead of Mac OS X if only it was rewritten in Ada.