Messages in this thread | | | Subject | Re: OFTOPIC: C vs C++ (was Re: C++ in kernel) | Date | Sun, 10 Jan 1999 19:56:32 -0400 | From | Horst von Brand <> |
| |
"Robert G. Werner" <rwerner@lx1.microbsys.com> said:
> Would you (and anyone else who would like to make a case) say that > writinng an opperating system in C++ is probably not a "good idea" or > just that trying to convert the Linux kernel would definitely not be a > "good idea"?
Writing an operating system in C++ sounds not too bad, but some of the prerequisites are (obviously) a stable language and a solid compiler. First one isn't there yet, a free first-rate compiler for C++ is not to be had for now. Plus very knowledgeable programmers. You'd need to dig quite a lot into the language's runtime libraries (reimplement memory management and IO, at the very least). Much more so than with C.
Converting Linux to C++ is absurd, IMHO: To _really_ use C++ strengths over C means a complete redesign of the internals. Better start from scratch, stealing design, code and data structure layouts (file systems, for example) and possibly bug work-arounds for broken hardware as you go.
It is a huge amount of work: Just think how long (and how much effort!) it took Linux to get where it is now. Also, think about the reasons somebody who uses Linux/*BSD today might want to use your variant: Pure hack value is one, but I very much doubt it would be enough to attract a sizable following, and without that the bazaar stile development doesn't work.
[...]
> But I have heard that C is much better suited to working closely with > hardware while C++ is great for creating layers of abstraction that can > help programmers concentrate on the algorythms. Of course, I'm very new > to these languages so most of my information is hearsay.
C++ is close enough to C that the "close to the hardware" part is equally possible. OTOH, C++'s "higher level" means that the language might be doing a lot of things behind your back. Efficiency freaks like Linus and the other head hackers won't accept that, but other people might find it quite an acceptable tradeoff for the added features. BTW, C9x will add a lot of C++ish features... YMMV. -- Horst von Brand vonbrand@sleipnir.valparaiso.cl Casilla 9G, Viña del Mar, Chile +56 32 672616
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |