Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



I 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.


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.

> 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.


> 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?)


Rereading 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.


You 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?


> 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.


I said “it’s not any weirder than promoting rust under discussions about c++”. That’s not claiming you said something about promoting rust, that’s asserting that if you have any consistency then you should find that weird as well.

The title of the post asks how constexpr c++ strings are. I answered with “more than rust’s”. The existence of const fn has yet to prove me incorrect.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: