Hacker News new | past | comments | ask | show | jobs | submit login

Mostly. A good portion of the AK subdirectory should be replaced with standard and/or boost functionality, though:

https://github.com/SerenityOS/serenity/tree/9153666e72effdf5...




Presumably the intent is not to depend on boost, but rather only standardized parts of the language.

Also using something like boost ties you to a specific version of boost due to the wonders of c++ abi - your OS libraries can’t expose anything that explicitly or implicitly includes things that aren’t ABI stable.

(I’m sure kling is already requiring 100% stable abi :) )


Anything that ever ran on Serenity must continue running, otherwise I've failed. :P

There are some parts of the code where I don't want to depend on anything other than the C++ language. Some folks are working on porting parts of this to some very constrained platforms, and bringing in boost or even STL would really gum things up.

But let's also be honest: It's fun making string and vector classes, and designing them to work just the way I like. :)


Fair, but I was replying to this being a good example of modern C++. It's atypical that implementing your own vector and string is even a good idea, let alone exemplary.


The C++ stdlib versions of vectors have different design goals, including a bunch of ABI constraints for very old code (things like the vector<char> specializations). Likewise there are questionable spec behaviors like unordered_map that specifies suboptimal implementation.


Follow on thought - what happens for operator new[]() in kernel space? Does it depend on a malloc (vs. traditional kmalloc)?


It's currently ending up in kmalloc(). The compiler handles the new[]/delete[] element count and I don't ask any questions about how.


On the contrary, the standard vector and string classes are garbage UX-wise (e.g. unlike pretty much every other single dynamic array implementation in existence, vector does not have something like an "index of element" method and instead you are supposed to use std::find and subtract iterators with a special check for when the element wasn't found... like, WTF).


OK, fine. Then use std::string_view, etc., which are cleaner and more efficient usually. There are several reasons why C++ open source is hard to reuse, and not using standard types appropriately is one of them.


This entire project is about implementing already-existing functionality in its own way, with minimal dependencies, for fun.

Its use of the C++ language strives to be modern. There is no attempt to use modern 3rd-party C++ frameworks.


I just wrote that the API is garbage and then you recommend me to use the API? :-P The entire STL/StdC++ has the same design style, it is garbage all the way down.

I'd rather use something like Qt (which is far from great, but better than STL/StdC++). Well, personally i'd rather not use C++ in the first place, but if i'm going to use C++ i'd rather use something else (which frankly, would be my own container and string classes that provide a much better API).




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: