News for hackers. Stuff that matters.
Re:Parsing can become accidentally quadratic because of sscanf by pjc50 on Monday March 01, 2021 @10:56AM (#26303989)
> variable-length data structures are much more treacherous than fixed-length data structures

A fixed-length structure is only fixed until you need to add a field to it. I understand the appeal, but good solutions seem to be very rare here. ASN.1 was possibly the first attempt but turned into a total nightmare. Protobuf seems to be doing a reasonable job, but only as a wire format and not a persistence format.

Text always "works", even if inadequately. And it can be handled with your normal diff and editing tools.

Re:Parsing can become accidentally quadratic because of sscanf by astrobe_ on Monday March 01, 2021 @01:29PM (#26306183)
> Text always work

Windows vs Linux end-of-line markers often screws-up things. UTF often screws-up things. Tab-vs-space sometimes screws-up things. Text is related to Postel's principle, which is often questioned because it leads to sloppy implementations on one side and complex implementations on the other side, and other bug-is-now-a-feature niceties.

I designed a couple of small internal protocols, and have been maintaining them for at least a decade. Maintenance time is nearly 0 because I never had to add a field to them. Even though the software using them evolved a lot and in unexpected ways.

Yes, they stood the test of time because they solved the problem we had, and those problems didn't evolve much. Not every protocol or format needs to be hyper-extendable and scalable.

> even if inadequately

So it works poorly but it works, so it can be shipped. That's why you buy a new smartphone every two year and don't see much improvement in response time or battery life.

Re:Parsing can become accidentally quadratic because of sscanf by gpm on Monday March 01, 2021 @11:02AM (#26304063)
We've been using protobuf as a persistence format without issue?
Re:Parsing can become accidentally quadratic because of sscanf by nitrogen on Monday March 01, 2021 @11:08AM (#26304159)
A self-describing format like MessagePack can be easier to build readers for in other applications, or if the schema is lost or changed.
Re:Parsing can become accidentally quadratic because of sscanf by gpm on Monday March 01, 2021 @11:52AM (#26304794)
If we've lost access to the schema, then we've lost access to our entire source repository, so we probably don't need to read our data anymore?

I guess I could see that being an interesting property in software that wants to deal with incompatible forks, or software that for whatever reason wants other people to read their data but is unwilling to ship a schema with it, but just for persistence on backend servers it doesn't seem like a very interesting property or worth the extra space requirements.

Re:Parsing can become accidentally quadratic because of sscanf by imtringued on Tuesday March 02, 2021 @06:38AM (#26314202)
CBOR is the gold standard for schema free data.
Re:Parsing can become accidentally quadratic because of sscanf by pjc50 on Monday March 01, 2021 @03:59PM (#26308327)
You have. Far more apps out there are using JSON or XML, including (as we've seen GTA).
Re:Parsing can become accidentally quadratic because of sscanf by gpm on Monday March 01, 2021 @07:07PM (#26310269)
Ah, you were just talking about popularity not fitness? Fair enough.