!lymvtcwDJ7ZA9Npq:lix.systems

Lix Development

424 Members
(Technical) development of Lix, the package manager, a Nix implementation. Please be mindful of ongoing technical conversations in this channel.140 Servers

Load older messages


SenderMessageTime
20 Mar 2026
@piegames:flausch.socialpiegamesyes, the reasonable alternative would be to have JSON objects only exposed as multimaps …10:39:07
@qyriad:katesiria.orgQyriad serde_json even emits duplicate keys, fuck me https://github.com/serde-rs/json/issues/1074 10:39:33
@piegames:flausch.socialpiegamesyes, that's why I said most duplicate keys are a sign of a mistake10:40:14
@kfears:matrix.orgKFears& 🏳️‍⚧️ (they/them)
In reply to @emilazy:matrix.org
yeah, an alternate API would probably have to wrap every value in a list, or realistically you'd potentially care about the order too in that case, so just to a parse tree with lists of key, value pairs
Also could rename keys, like if you have duplicate key "a" it would become "a-0" and "a-1", but it's omega-cursed and also we think we have seen that in NixLang somewhere before
10:40:26
@piegames:flausch.socialpiegamesMurphy's law going strong there10:40:34
@qyriad:katesiria.orgQyriad Yeah, but parsing them into one value is likely to cause problems than parsing them into a composite structure 10:40:53
@qyriad:katesiria.orgQyriad * Yeah, but parsing them into one value is likely to cause fewer problems than parsing them into a composite structure 10:41:00
@qyriad:katesiria.orgQyriad We should almost definitely at least warn on this though 10:41:10
@piegames:flausch.socialpiegameshm, as in, runtime warning?10:41:30
@qyriad:katesiria.orgQyriadYes10:41:37
@piegames:flausch.socialpiegamesfucking hell10:44:41
@piegames:flausch.socialpiegamesthere is a rust crate called ijson10:44:45
@piegames:flausch.socialpiegames which has nothing to do with I_JSON, and is just "an opinionated fork of serde_json by a person whose name starts with i" 10:45:12
@qyriad:katesiria.orgQyriadOf course10:45:32
@coca162:matrix.orgCoca

All the rust json crates I already know of:

Input: {"name": "One", "name": "Two"}
serde_json (serde API): Err(Error("duplicate field `name`", line: 1, column: 22))
serde_json (Value API): Ok(Some(String("Two")))
nanoserde: Ok(Test { name: "Two" })
facet-json: Ok(Test { name: "Two" })
simd-json (serde API): Err(Error { index: 0, character: None, err_type: Serde("duplicate field `name`") })
simd-json (Value API): Ok(Some(Value([String("One")])))
10:46:07
@piegames:flausch.socialpiegames"internet json" surely wins the prize for the least searchable name of the week10:46:08
@coca162:matrix.orgCoca *

All the rust json crates I already know of:

Input: {"name": "One", "name": "Two"}
serde_json (serde API): Err(Error("duplicate field `name`", line: 1, column: 22))
serde_json (Value API): Ok(Some(String("Two")))
nanoserde: Ok(Test { name: "Two" })
facet-json: Ok(Test { name: "Two" })
simd-json (serde API): Err(Error { index: 0, character: None, err_type: Serde("duplicate field `name`") })
simd-json (Value API): Ok(Some(Value([String("One")])))
10:46:15
@piegames:flausch.socialpiegames"cause fewer problems" as in "fail less loudly and prominently"10:47:01
@piegames:flausch.socialpiegamesalso what the fuck on them having different behavior based on which API you use10:47:40
@piegames:flausch.socialpiegamescan we collectively please all go back to XML already?10:48:11
@coca162:matrix.orgCocayeah its certainly something10:48:37
@coca162:matrix.orgCoca actually argh I could be more clear here with serde_json since Value is still parsed using serde traits in serde_json, but in simd-json the Value API is wholly separate from serde 10:51:33
@emilazy:matrix.orgemilybtw I would very strongly caution against doing this without an extremely comprehensive test suite and probably carefully directed fuzzing. it is likely to cause far more "no abort, different results" interoperability issues than duplicate keys ever would. 2.4 switching to nlohmann was part of why it was probably the most hash-breaking release in memory11:22:54
@emilazy:matrix.orgemilysee also toml11 bumps sleepwalking into breaking Nixpkgs lib tests etc.11:23:20
@emilazy:matrix.orgemilyany complete of builtin parser implementation like that should most likely come with a period of running both of them and aborting on any divergence11:24:03
@emilazy:matrix.orgemily(how many hours do you have to learn about XML interoperability issues?)11:25:26
@emilazy:matrix.orgemily(it's a miracle Nix at least only has it as an output format)11:25:40
@emilazy:matrix.orgemily(and I like XML!)11:25:46
@emilazy:matrix.orgemilyI really don't think so. the JSON iceberg is not the Nix iceberg11:27:26
@emilazy:matrix.orgemilya warning about input you don't control is not actionable or going to go anywhere, unless it's a truly unfixable interoperability problem11:28:29

Show newer messages


Back to Room ListRoom Version: 10