Live data from Hacker News

Why German Strings Are Everywhere?

cedardb.com

41–50 of 58 posts

Re: Why German Strings Are Everywhere?

#43

Interesting to see a deepdive about string formats. I hadn't thought very deeply about it before. I do agree with the string imutable argument. Mutable and imutable strings have different usecases and design tradeoffs. They perhaps shouldn't be the same type at all. The transient string is particularly brilliant. Ive worked with some low level networking code in c, and being able to create a string containing the "pa…

> The transient string is particularly brilliant. Ive worked with some low level networking code in c, and being able to create a string containing the "payload" by pointing directly to an offset in the raw circular packet buffer is very clean. (the alternative is juggling offsets, or doing excessive memcpy) It's not anything special? That's just `string_view` (C++17). Java also used to do that as an optimisation (bu…

> It's not anything special? That's just `string_view` (C++17)

Just because something already exists in some language doesn't make it less clever. It's not very widespread, and it's very powerful when applicable.

This format can handle "string views" with the same logic as "normal strings" without relying on interfaces or inheritance overhead.

it's clever.

Re: Why German Strings Are Everywhere?

#44
post #27
post #13

Earlier quoted context omitted.

It also makes it grammatically incorrect. If it were actually a question it should be, “Why are German strings everywhere?”

The other form seems to be an Indian English colloquialism.

Do you mean "Why German strings are everywhere?" as an interrogative form?

I doubt that's specific to India. I had a teacher in high school who was Greek and who characteristically asked us "what it could be?", meaning "what could it be?".

Questions in Mandarin Chinese use the same sentence structure as their related statements. I imagine this is really common across languages.

Re: Why German Strings Are Everywhere?

#45
post #5

Earlier quoted context omitted.

I knew the C++ strings were optimized so. I do not like calling them "German". First time I see them called so (I know it, you can search yourself, as SSO -short string opt.), and looks as some kind of nationalist pride thing to me. Is certainly not a unique or new idea, many scheme/lisps implementations do that for strings AND numbers. Downvotes coming from other connationals :) love you! I know… never say anything…

Doesn't seem nationalist to me because the name seems to have been coined by the people at Cedar, not TU Munich.

Cedar is a german company, in case you did not know. That makes it specially nationalist.

Re: Why German Strings Are Everywhere?

#47
post #5

In case anyone wonders why they are called German strings: the article mentions the "research predecessor" of Cedar, Umbra. Umbra is a project of TU (technical university) Munich, Germany.

I knew the C++ strings were optimized so. I do not like calling them "German". First time I see them called so (I know it, you can search yourself, as SSO -short string opt.), and looks as some kind of nationalist pride thing to me. Is certainly not a unique or new idea, many scheme/lisps implementations do that for strings AND numbers. Downvotes coming from other connationals :) love you! I know… never say anything…

According to TFA, the name was coined by Andy Pavlo, who did his undergrad in New York, Doctorate in Rhode Island, and now teaches in Pittsburgh. I see no indication that he is German.

[edit]

Lecture slide with the term is also linked from TFA: https://15721.courses.cs.cmu.edu/spring2024/slides/05-execut...

Re: Why German Strings Are Everywhere?

#49

In case anyone wonders why they are called German strings: the article mentions the "research predecessor" of Cedar, Umbra. Umbra is a project of TU (technical university) Munich, Germany.

They maybe should be better called *Kemper Strings" then?

Probably. Or just SSO, as it is basically a very well known name already.

Re: Why German Strings Are Everywhere?

#50

Earlier quoted context omitted.

> The transient string is particularly brilliant. Ive worked with some low level networking code in c, and being able to create a string containing the "payload" by pointing directly to an offset in the raw circular packet buffer is very clean. (the alternative is juggling offsets, or doing excessive memcpy) It's not anything special? That's just `string_view` (C++17). Java also used to do that as an optimisation (bu…

> It's not anything special? That's just `string_view` (C++17) Just because something already exists in some language doesn't make it less clever. It's not very widespread, and it's very powerful when applicable. This format can handle "string views" with the same logic as "normal strings" without relying on interfaces or inheritance overhead. it's clever.

> It's not very widespread

It is tho?

> and it's very powerful when applicable.

I don't believe I stated or even hinted otherwise?

> This format can handle "string views" with the same logic as "normal strings" without relying on interfaces or inheritance overhead.

"owned" and "borrowed" strings have different lifecycles and if you can't differentiate them easily it's very easy to misuse a borrowed string into an UAF (or as Java did into a memory leak). That is bad.

And because callees usually know whether they need a borrowed string, and they're essentially free, the utility of making them implicit is close to nil.

Which is why people have generally stopped doing that, and kept borrowed strings as a separate type. Without relying on interfaces or inheritance.

> it's clever.

The wrong type thereof. It's clever in the same way java 1.4's shared substring were clever, with worse consequences.

Post reply on HN