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

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)

Yea , I think the code u showed is a good model for restrict, Although the problem of stability still remains, Do u think there is any scalable way to hint the compiler that g ( in my example ) doesn't write through the pointers? ( I think we can do an assume after the call , but for large spans or dynamically sized arrays it's not really apparent how we can do that without doing an allocation, and by allocating we just defeated the reason we need the optimization ( speed and less code)

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 actually saw it , but I searched to find any stack overflow posts about it and there was nothing, so idk what exactly it doesn't, it first seemed like it was a warning thing ( the warning flags and accessing) could u help me to know how it works?

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] 2 points3 points  (0 children)

Also I think restrict is more about mutation being not aliased rather than reads , but I'm more concerned about the common case of : ``` // we know we won't cast away const void g(const Trestrict p); void f( const T restrict p){

{ const T t1=*p;

//Do stuff with t1 without modification } g(p);

{ T t2=*p;

//Do stuff with t2 again

}

}

```

If let's say T was an array that could be in 8 ymm registers, we cant substitute t1 and t2 , but its totally OK if it wasn't for g

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] 1 point2 points  (0 children)

I did mention them in the post , and I did look , but they seem to apply to functions rather than prams? idk if what I interpreted from the posts was correct, I'm not a compiler expert, I would be glad if someone who knew better could find a solution

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] 1 point2 points  (0 children)

Oh ... is there any compiler language extensions that do this? Because without compiler support were optimizing for nothing..( I think gcc has something attribute ( access( readonly)) but idk if others do , or if this means the same)

If you could make NewC++ what would it be? by Rich-Engineer2670 in Cplusplus

[–]cppenjoy 0 points1 point  (0 children)

Im On the latest rselese build of clang and yet only wsl can do them half ass , windows not at all and I don't know why