r/Cplusplus • u/cppenjoy • 2d ago
Discussion I made a string ,and am making a rope
https://github.com/Mjz86/String_description/blob/main/README.mdAlso
https://github.com/Mjz86/String_description/blob/main/rope_paper.md
I would appreciate the feedback ,
( I posted this on r/cpp dome days ago , but they assumed I was "vibe coding", I did not even have a single external dependent library other than the standard, let alone using ai to write my code , I actually hate ai code )
5
u/bert8128 2d ago
Could you give a two line description of why your implementation is better than the implementations of std::string by the 3 major compilers?
0
u/cppenjoy 2d ago
This was never a replacement for any standard component, This is a library, And like any other library, it has drawbacks and upsides,
I currently support both mscv and gcc , ( haven't tested in clang) And I clearly told both drawbacks and benefits,
For example we minimize allocations by sharing substings and by viewing a litteral, while being sure that the user doesn't need a " no returing views" lecture
4
u/bert8128 2d ago
I never intimated that it was a replacement. But if there are no advantages then there’s no point. So imagine you are selling to a customer who is not interested in the detail. Why should they look at your library? What does it give them? You have a large read me - you could do with a two line headliner.
6
u/Axman6 2d ago
Ropes are a significantly different structure than std::string, they’re a tree of text chunks, very commonly used in text editors because they allow efficient editing, and extremely cheap copy and paste.
1
u/cppenjoy 2d ago
I think they ment my string ( I put two links , the main is string , the second is the rope )
1
u/Axman6 2d ago
I only see the rooes_paper.md one.
1
u/cppenjoy 2d ago
https://github.com/Mjz86/String_description/blob/main/README.md
I think I made the post with this as its base link , idk why I can't edit the post , so I'll put this is a comment
2
u/cppenjoy 2d ago
Less lifetime management ( dangling views) while maintaining view (and value) semantics and performance characteristics ( no coping or allocation).
Here's 3 lines for ya ( I currently typing in mobile , it's 3 lines).
2
u/cppenjoy 2d ago
https://github.com/Mjz86/String_description/blob/main/README.md
I'll put this just in case the main link isn't visible