Originally posted by OneTimeShot
View Post
Announcement
Collapse
No announcement yet.
Red Hat Developer Posts Patches As A Baby Step To Converting Linux Kernel To C++
Collapse
X
-
Originally posted by carewolf View Post
All major projects use the same subset. The only weird ones are Boost and STL because it is written by programming wankers who like features that are banned everywhere else.
There is no mutually agreed on subset of C++.
- Likes 1
Comment
-
Originally posted by slacka View Post
I guess you have never heard of the C++ Core Guidelines? There are even checkers for clang and MS Visual Studio.
LOL. No: I'm dumb. I've coded in C++ for 15 years. Every C++ programmer I have ever met has automatically assumed that they are better than me and that what they do is "the real C++". Spoiler: what they actually did mostly contradicted each other.
At least Java programmers have the good grace to say: "yeah - it's a dumb, slow, easy-to-learn language. It gets the job done, though."
Comment
-
Originally posted by pal666 View Postwe are talking about kernel and kernel does not provide any kind of stable c function abi
i guess they are looked down mostly by people who don't understand what are they talking about. btw, tell us how macros add a type of abstraction that's looked down upon by kernel devs
Macros generate code to avoid duplication, i.e. it places a blob of code where you place a macro in order to avoid having to put that same thing everywhere. Complicated macros that do things like type manipulation or structure generation is generally looked down upon in the kernel because it's not immediately clear what those things are doing. It's easy to introduce bugs or use it in a way that causes an issue that is actually hard to find.
There are exceptions, one of those being container_of which confuses a lot of developers (despite being useful especially outside of the kernel). You can consider things like the list_for_each macro but ultimately, that just avoids code duplication still while making it easier for the developer to use the linked list.
The fact that you equate macros to templates is kinda ridiculous by the way. They aren't the same thing and they aren't used the same way.
- Likes 1
Comment
-
Originally posted by computerquip View PostC tends to be easier to maintain and compilers can generally generate better assembly than hand writing it.
The point is that the skills required to make decent hand-optimized assembly and also the time required are plain off the charts.
- Likes 1
Comment
-
Originally posted by OneTimeShot View Post
Yay - a C++ programmer. And you're disagreeing and arguing with other C++ programmers about technical decisions... Thanks for proving my point
I agree on your main point though.
- Likes 1
Comment
-
Originally posted by computerquip View Post
Sure, because even in kernel code, such as in Haiku, you still don't see templates. I guess no one knows what they're talking about.
There are templates in Haiku. Go clone github.com:haiku/haiku.git and see:- kernel/TeamThreadTables.h
- kernel/arch/arm/arch_debug.cpp
- kernel/arch/m68k/arch_int.cpp
- kernel/arch/ppc/arch_int.cpp
- kernel/arch/x86/64/descriptors.cpp
- kernel/arch/x86/arch_debug.cpp
- kernel/debug/core_dump.cpp
- kernel/debug/tracing.cpp
- kernel/device_manager/FileDevice.cpp
- kernel/disk_device_manager/ddm_userland_interface.cpp
- kernel/elf.cpp
- kernel/scheduler/RunQueue.h
- kernel/scheduler/scheduler_profiler.cpp
- kernel/scheduler/scheduler_profiler.h
- kernel/slab/slab_private.h
- kernel/team.cpp
- kernel/vm/vm.cpp
- Likes 1
Comment
-
Originally posted by Zan Lynx View Post
I had to check on that because I was confused. And of course I was right. :-)
There are templates in Haiku. Go clone github.com:haiku/haiku.git and see:- kernel/TeamThreadTables.h
- kernel/arch/arm/arch_debug.cpp
- kernel/arch/m68k/arch_int.cpp
- kernel/arch/ppc/arch_int.cpp
- kernel/arch/x86/64/descriptors.cpp
- kernel/arch/x86/arch_debug.cpp
- kernel/debug/core_dump.cpp
- kernel/debug/tracing.cpp
- kernel/device_manager/FileDevice.cpp
- kernel/disk_device_manager/ddm_userland_interface.cpp
- kernel/elf.cpp
- kernel/scheduler/RunQueue.h
- kernel/scheduler/scheduler_profiler.cpp
- kernel/scheduler/scheduler_profiler.h
- kernel/slab/slab_private.h
- kernel/team.cpp
- kernel/vm/vm.cpp
Comment
-
Originally posted by Zan Lynx View Post
I'm not sure where you got that idea, but I can assure you it isn't true.
There is no mutually agreed on subset of C++.
- Likes 2
Comment
Comment