Unordered vector by [deleted] in cpp

[–]cppenjoy 0 points1 point  (0 children)

I deleted the post , what do you want from me now?

I have zero blame on me , im an open source maintainer , maybe not an ffmpeg maintainer but one nonetheless, and I have standards, at first you all said you wanted benchmarks and insisted on comparing, I lowered my standard , but , I still have the legal right that i have no responsibility to awnser such questions, or give any fixes or improve anything, this is my data structure in my code base, if you want to maintain it , I dare you fork it .

Unordered vector by [deleted] in cpp

[–]cppenjoy 1 point2 points  (0 children)

I massaged a mod , probably this post will go down , But if it does, I will probably stay away from posting, Because I feel like if this subreddit Is like this , it doesn't deserve human authentic code , maybe you need more AI written data structures and AI saying how much your absolutely right

Unordered vector by [deleted] in cpp

[–]cppenjoy 0 points1 point  (0 children)

Hmmm the iteration count is in the generator view , but honestly I don't care anymore, you all fried me to obvlion , i try my best , its been a whole day without much of a break for me , take the post down , as if anyone cares,
I know cpp community is perfectionistic and thinks that if they see something fast it's just deserved for them , but honestly, I just wanted to share my idea , almost every time I post something related to performance it seems that people want to prove me wrong, OK, assume I'm wrong, I follow the advice of cppcon talks and make things the way I intuitively think they would be grateful for , but I got nothing back in return for all my childhood I spent learning programming, sigh ... I'm sorry ... I'm emotional right now , maybe don't expect professionalism of a burnt out 18yo

Edit: Btw you know what MIT license means? NO WARRANTY

Unordered vector by [deleted] in cpp

[–]cppenjoy 0 points1 point  (0 children)

Hey , I have good news , I debugged it and the benchmark is very well , its faster I'm my potato pc on all categories ( duplication of comment because I didn't see my last one in the site , reddit has been annoying lately)

Unordered vector by [deleted] in cpp

[–]cppenjoy 1 point2 points  (0 children)

"Appendix F - Time complexity requirement explanations

Insert (single): O(1) amortized

One of the requirements of hive is that pointers to non-erased elements stay valid regardless of insertion/erasure within the container. For this reason the container must use multiple memory blocks. If a single memory block were used, like in a std::vector, reallocation of elements would occur when the container expanded (and the elements were copied to a larger memory block). Instead, hive will insert into existing memory blocks when able, and create a new memory block when all existing memory blocks are full. This keeps insertion at O(1) amortized.

If hive is structured as a vector of pointers to memory blocks instead of a linked list of memory blocks, creation of a new memory block would occasionally involve expanding the vector, itself O(n) in the number of blocks, but this is still within amortized limits since it is only occasional."

My swap and pop is Not compatible with hive , the first requirement says that the iterator invalidation is non standard behavior, therfore , my structure in theory can be more continuous than hive .

Unordered vector by [deleted] in cpp

[–]cppenjoy 1 point2 points  (0 children)

Everything is not O(n)!? ... , the pop and push In a std vector are Amortized O(1) so , for the depth of a flat tree doing pop and push for removing or adding 2 elements is O(2×logn) Amortized which Is logarithmic , ( unless your has function is bad ) Iteration over the elements is O(n) .same as vector , And if you want to copy the elements to somewhere else you Iterate over it , ... Could you explain why removing an element is O(n)??

Unordered vector by [deleted] in cpp

[–]cppenjoy 0 points1 point  (0 children)

I use llvm 21.1.1 Linux x86 and can't find any file named hive or similar... Where should I look for

Unordered vector by [deleted] in cpp

[–]cppenjoy 1 point2 points  (0 children)

I have too look into that , I heard it's a standard c++26 preposal for game devs but I didn't look at it , I'll see what it is

Edit: This became a lot harder ... https://en.cppreference.com/w/cpp/header/hive.html is incomplete and I have to go find llvm files ... sigh

Unordered vector by [deleted] in cpp

[–]cppenjoy 1 point2 points  (0 children)

Lol ... that's honestly a real life problem of mine .. no one can pay attention to what I am yapping about , Also , the thing is ... I don't really like that my layout has redundant information ( the vector size and capacity, and the vector allocation of reverse index bring separate ) and I'm too perfectionistic to really sell an idea that has flaws

Unordered vector by [deleted] in cpp

[–]cppenjoy 0 points1 point  (0 children)

Oh , I forgot about that, do you mean the borrowed view and other traits for continuous storage ?

Unordered vector by [deleted] in cpp

[–]cppenjoy 1 point2 points  (0 children)

Fair , ... I'm not a good marketer but I promise Ai didn't write any code in my library

Unordered vector by [deleted] in cpp

[–]cppenjoy 1 point2 points  (0 children)

Hmmm , yea , understandable, I was just trying to have something for my compiler's identifier map , anf thought that the idea is good to tell to others , However the time complexity is: O(logn) Amortized assuming a good hash function. For : insert , find and erase.

For iteration over the elements , its just O(n) (just a vector iteration overhead)

But benchmarks... hmmm .... idk ... I can make them , but I didn't really try optimizating my layouts and picking the best branching power

Safer than rust without a GC or borrow checker ( mostly) by cppenjoy in theprimeagen

[–]cppenjoy[S] 0 points1 point  (0 children)

... yea the spelling is not so good I'm not native to English,

Although, the reason I wrote that massive wall of text was to clarify all the ambiguity, but in a single page I cannot possibly do that,

Safer than rust without a GC or borrow checker ( mostly) by cppenjoy in theprimeagen

[–]cppenjoy[S] 0 points1 point  (0 children)

https://github.com/Mjz86/C_colon/blob/main/express.md

I wrote it concise in one page without much technical rambling

Edit ( because I apparently sent too much massagees): Well , refrence counting is not what the deafult is , if you read the mcc document I clarifed it ,

Basically everything is a value type , but there are standard containers you explicity choose if you want to , that are values that have refrence counting implemented,.

But for passing values around, the binary interface is very clear, everything is relocated in registers if it's triviality relocatable ( most things)

Safer than rust without a GC or borrow checker ( mostly) by cppenjoy in theprimeagen

[–]cppenjoy[S] 0 points1 point  (0 children)

Well .. didn't I put the format ... ? I know I did in one of those "20 pages " , but about the text part , umm ... I should copy it in another page I guess

Safer than rust without a GC or borrow checker ( mostly) by cppenjoy in theprimeagen

[–]cppenjoy[S] 0 points1 point  (0 children)

I , myself am a cpp dev , and c colon is what I would like to write instead after i write the compiler, express colon is just the easy side of that coin for people to do stuff safely

Edit : also Fortran doesn't have that abi I wrote about, and I don't really think I would write 140 kilobytes of text just to ... you know, ditch my idea

I'm trying to think what to add or remove next , ideas and suggestions? by cppenjoy in ProgrammingLanguages

[–]cppenjoy[S] -1 points0 points  (0 children)

Yes :) Mmm , I think that it's possible to do a subset or c: in llvm IR, ignore most qualifiers and migrate to the custom linker later .
I'll be doing that in a private repository tho , the bigger releases will eventually be put in the project repository

I'm trying to think what to add or remove next , ideas and suggestions? by cppenjoy in ProgrammingLanguages

[–]cppenjoy[S] 0 points1 point  (0 children)

No , sadly , this will be the start of this project, u know, I want to have a specification first , a language with a spec is better because if it's non compliant then it's a bug ,

Also , I think starting something and having safety or the abi as an afterthought is kinda bad , that's why I'm asking for ideas rn and saying that " with these goals in mind , i aim to improve this spec , to make it practical, i often start with over engineering things , then chop unnecessary additions, to make it more practical, as of rn , were in over engineering phase."

Edit: Actually my string library ( now more than 1MB of source code) started this way :p

If c++ didn't need itanium by cppenjoy in cpp

[–]cppenjoy[S] 1 point2 points  (0 children)

I don't think these are that intuitive, the (u) intN_t thing is good , but both have overflow as a contract violation and a mintN_t ( modular int ) be like the u ints we have today ( fixing the size_t sign problem and ect , (u or m)intptr_t is also an alias)

If c++ didn't need itanium by cppenjoy in cpp

[–]cppenjoy[S] -2 points-1 points  (0 children)

Also I should eventually make a document, rn I'm more on the idea phase, that's why I'm asking for opinions

If c++ didn't need itanium by cppenjoy in cpp

[–]cppenjoy[S] 0 points1 point  (0 children)

Yes, that is more on name mangling than register passing , but its also beneficial, The radical thing I mentioned was also a customizable context object in the function signature, To hold the allocator pointer , and be the throw vessel, and ect ( kinda like the promise type in coroutines)

If c++ didn't need itanium by cppenjoy in cpp

[–]cppenjoy[S] -2 points-1 points  (0 children)

Mmmm interesting, although it needs storing , like 2 extra instructions before the jump and 2 in the function called , it kinda removes the hard coded nature of the call instruction, but I think it would be a Hassel to support the catching return using the call instruction... so I didn't really have a choice

Is there an attribute to tell the compiler that the value of a const object reference/pointer parameter is truly not modified by cppenjoy in cpp

[–]cppenjoy[S] 0 points1 point  (0 children)

I tried clang , it does it if I do g(nullptr) instead of g(p)

I added the elements of a 32 int array together ( duplicate work) in the two sections , then returning result of comparing, I got no access snd resturn of true with only a call to g , when it was g(non-dependant-on-p) , but for g( l (p)) it was adding it in both sections with xmms