4 ms·
Much more than rust, that’s for sure, where you are forced to stick everything in a macro or pray the compiler is smart for compile time programming.
by alphanullmeric 3y ago
Much more than rust, that’s for sure, where you are forced to stick everything in a macro or pray the compiler is smart for compile time programming.
- insanitybit 3y agoNot to derail, because frankly I think it's very weird to even bring Rust up here, but `const fn` is a thing in Rust and is guaranteed to execute at compile time. It is more limited, no question. But you don't have to hope that the compiler will do things, it is guaranteed to do them.
- alphanullmeric 3y agoIt’s not any weirder than promoting rust under discussions about c++, unless you think any mention of rust must be positive. There is pretty much nothing useful, this post included, that can be done with const fn in rust.
- insanitybit 3y ago> It’s not any weirder than promoting rust under discussions about c++ Feels like a straw man? I never promoted Rust, certainly I didn't bring it up unprompted. I corrected someone who brought it up. > unless you think any mention of rust must be positive. Again, feels like a straw man. I said nothing of the sort. > There is pretty much nothing useful, this post included, that can be done with const fn in rust. I feel like you're simultaneously upset that I corrected your post... but also you're challenging my point, in an attempt to pursue discussion? It's confusing because you're wrong but there's also an interesting discussion to be had - although I think this post covers the general issue of "what is a pointer at compile time" quite well.
- alphanullmeric 3y agoI didn’t accuse you of doing it, I said you only find other people bringing up rust weird if it’s not positive. Unless you want to agree that it’s always weird to bring up rust in a discussion about c++? I’m not upset about anything. You said I’m wrong, so show me how you use const fn to make a heap allocated string at compile time as done in this post.
- insanitybit 3y agoI can't understand your first point about bringing Rust up, I'm going to go out on a limb and assume that English may not be your first language. > You said I’m wrong, so show me how you use const fn to make a heap allocated string at compile time as done in this post. You: > where you are forced to stick everything in a macro or pray the compiler is smart for compile time programming. `const fn` exists. You do not need to "pray the compiler is smart" - you can run code at compile time. No need for macros either. As I also said, it is not as powerful as C++. You can not do heap allocations with const fn.
- pharrington 3y ago> I can't understand your first point about bringing Rust up, I'm going to go out on a limb and assume that English may not be your first language. The sentiment you're looking for is "talking past each other" (i'm assuming mods can detach my comment from the thread?)
- insanitybit 3y agoRereading that's perhaps the issue, the first time I read it I literally could not comprehend what they were saying, I thought it was an ill formed sentence. I see now that it's just worded poorly and also a very odd thing to bring up.
- alphanullmeric 3y agoYou thought I accused you of promoting rust. I didn’t. I said that someone who complains when rust is criticized in a conversation about c++ should complain equally when rust is promoted, which should not be a controversial statement if you have any consistency. We are discussing a compile time string. So how can you use const fn to make a compile time string in rust with no macros?
- insanitybit 3y ago> I said that someone who complains when rust is criticized in a conversation about c++ should complain equally when rust is promoted Right, this is a straw man. I've never said anything at all about people criticizing C++ and promoting Rust. You're creating an argument out of thin air and attacking it. > We are discussing a compile time string. Incorrect. Here is what you said: > Much more than rust, that’s for sure, where you are forced to stick everything in a macro or pray the compiler is smart for compile time programming. In no way did you scope it to creating heap allocating strings. Even the post, which ultimately discusses that, discusses other things. For example, you can write a substr function (firstName) using a const fn in Rust. No macros, no "praying" that the compiler will optimize things. It would be very odd to limit the discussion to a `string` since this post focuses on how difficult and complex that is in C++, so using it as a "Rust can't even do this" would be sort of ironic. Anyways, I've engaged in good faith in this discussion for far too long. Your posts are borderline incoherent, frankly, and I think any reader of this thread will have long gotten the message that your initial post was both irrelevant and incorrect.