Hacker News new | ask | show | jobs
by gk1256 1613 days ago
I like the UI, but I'm disappointed to find that the author is using orthodox C++ instead Modern C++
3 comments

I guess they don't want to kill their compile times.
For the kernel, or for the user-mode applications? C++ features aren't very useful for kernels. Presumably the author is more familiar with C and "C with classes" C++ and someone can rewrite the user-mode apps in modern C++ later.
Both. SerenityOS, includeOS, Managarm used Modern C++ for Kernel. For example, Managarm used coroutines and Templates also RAII stuff like lock_guard in it's kernel.
It is foolish to assert that "C++ features aren't very useful for kernels". C++ features are useful for programs, particularly big programs. Kernels are big programs.
What do you mean by "orthodox C++"?
"Although the operating system is written in C++, most C++ features are avoided."

From https://gitlab.com/nakst/essence/-/blob/master/help/Contribu...

Yes, this is kind of stupid.

Certain people have been doing this sort of thing forever. It was never a good idea. Whenever you probe why they thought it was a good idea, all the reasons (where they are expressible at all) turn out to depend on falsehoods. Most usually, though, it amounts to laziness about learning anything new.

You can see effective use of Modern C++ in SerenityOS, to excellent effect.

Usually orthodox c++ looks something like: https://gist.github.com/bkaradzic/2e39896bc7d8c34e042b

this is from bgfx

> UPDATE As of January 14th 2019, Orthodox C++ committee approved use of C++14.

So it is basically Modern C++, just a few years later.

It's 2022, so perhaps the committee will approve features from C++17.

Now, all things considered, having used bgfx in various languages, I think the Orthodox C++ approach leads to quite clean code.

It reminds me of Carmack's subset of C++. In other words, it doesn't suck.