Re: My experiences with Rust
- In reply to: Poul-Henning Kamp: "Re: My experiences with Rust"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 25 Aug 2025 13:29:15 UTC
Am 22.08.25 um 19:45 schrieb Poul-Henning Kamp: > -------- > David Chisnall writes: > >>> Aka: the guy who added kern.geom.confxml in 2002 >> >> XML is not great for generating or parsing, > > I'll have you know that XML was *THE HOT THING* in 2002 :-> > > Also I disagree wrt to "generating", because that's just a matter > of sbuf_printf() calls, but parsing ? Yeah, bugger that. > Yeah, and when the structure isn't right you're gonna spend seconds on end chewing on a very verbose JSON/XML/... table what used to be "piece of cake" in CSV (replace C by tab/semicolon or whatnot). For structured repeatable data, these formats tend to get highly redundant for nontrivial amounts of data. At a different place, we're parsing 250 MB XML stuff, a dozen times before our simulation of a real-world system starts. I haven't looked more deeply (session scheduled though), it might have to do with arrays being unrolled into XML or something (I might know more a week from now), but even without we're likely looking at 30 or 40 MB XML to describe something that will end up in a maybe 64 kB binary blob. Talking about Rust, that supply chain security consideration, complexity for writing JSON and the need for formatting stuff... makes me wonder if there's more to it than forcing type ownership to be considered more thoroughly than in many other non-garbage-collecting languages. Regarding formatting in C, we have <inttypes.h> and the formatting/scanning macros PRI* and SCN* <https://en.cppreference.com/w/c/types/integer.html#Types>, and in the base system we should have or see to it that we have C++20's <format> and C++23's <print>. And possibly module support to get compile times down. -- Matthias Andree FreeBSD ports committer