Date: Sat, 11 Jan 2025 20:27:56 +0100
On 7. Jan 2025, at 15:32, Henry Miller <hank_at_[hidden] <mailto:hank_at_[hidden]>> wrote:
>
> TLDR: if you are willing to work full time on this you can at best get it for C++32, but C++38 is more realistic.
I do understand that a library-based borrow checker is way off for now. With the current compile-time capabilities it would be really hard to write a borrow checker. Instead I’d rather see the 3 sub-proposals in the standard in a shorter time frame.
Though, you made me think how the general idea of a borrow checker could be achieved (just maybe not with a nice syntax). In general, consteval functions are thought of as pure functions which makes it impossible to implement a borrow checker. Or so I thought. Turns out there is an approach to stateful meta programming (https://b.atch.se/posts/constexpr-counter/ <https://b.atch.se/posts/constexpr-counter/>). But the standard committee wants to get rid of the behavior used here.
>
> That means writing the library you want so we can see how it works, possibly modifying a compiler (clang is most commonly used for this) to provide a working example.
I really hope to get around that. I find it quite hard to figure out how to use clang.
>
> TLDR: if you are willing to work full time on this you can at best get it for C++32, but C++38 is more realistic.
I do understand that a library-based borrow checker is way off for now. With the current compile-time capabilities it would be really hard to write a borrow checker. Instead I’d rather see the 3 sub-proposals in the standard in a shorter time frame.
Though, you made me think how the general idea of a borrow checker could be achieved (just maybe not with a nice syntax). In general, consteval functions are thought of as pure functions which makes it impossible to implement a borrow checker. Or so I thought. Turns out there is an approach to stateful meta programming (https://b.atch.se/posts/constexpr-counter/ <https://b.atch.se/posts/constexpr-counter/>). But the standard committee wants to get rid of the behavior used here.
>
> That means writing the library you want so we can see how it works, possibly modifying a compiler (clang is most commonly used for this) to provide a working example.
I really hope to get around that. I find it quite hard to figure out how to use clang.
Received on 2025-01-11 19:27:59