|
|
Subscribe / Log in / New account

C, still?

C, still?

Posted Sep 22, 2017 20:34 UTC (Fri) by vomlehn (guest, #45588)
In reply to: C, still? by ncm
Parent article: Building the kernel with Clang

This greybeard is really tired of this argument. It would nice to have a good object-oriented language for writing kernels. Linux has a fair amount code that is logically object oriented but which is limited to being expressed with some pretty horrible C syntax. However, C++ is not the solution. I don't know of a solution and I don't have the time to take this detour. Apparently nobody else does, either. So, C it is.


to post comments

C, still?

Posted Sep 24, 2017 8:18 UTC (Sun) by ncm (guest, #165) [Link] (2 responses)

There is little of interest in "object-oriented" languages; very little of the benefit of coding in C++ (vs C) arises from object support in the language, and very little from syntactic convenience. If that were all, there would be hardly any point to switching.

It is about putting the type system to work performing logic at compile time, to generate code that is correct by construction. This is not something exotic; it is daily life for a C++ programmer.

C, still?

Posted Sep 24, 2017 21:36 UTC (Sun) by peter-b (guest, #66996) [Link] (1 responses)

> It is about putting the type system to work performing logic at compile time, to generate code that is correct by construction. This is not something exotic; it is daily life for a C++ programmer.

Alas, this paradigm of C++ programming is a relatively modern concept, which relies heavily on language features introduced in C++11 and more recently. Most C++ projects I've worked on in my career use C++ as "C plus classes", and the use of types-as-compile-time-assertions was a controversially innovative suggestion. It must be nice to work in an environment where this sort of "types for compile-time logic" approach is commonplace. :-)

C, still?

Posted Sep 25, 2017 2:26 UTC (Mon) by ncm (guest, #165) [Link]

It really is.

MongoDB's core server engineering organization is very well-run. (And is hiring.) We are using C++14 for the current release, probably C++17 in the next.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds