!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
@delroth:delroth.netdelrothwhat a great RFC09:27:04
@raitobezarius:matrix.orgraitobezariusi want to cry09:29:59
@k900:0upti.meK900But JSON fits on a business card!09:30:31
@k900:0upti.meK900Or something09:31:25
@delroth:delroth.netdelroththe business card: "100 microsd cards taped to each other"09:31:36
@thubrecht:matrix.orgthubrecht

That "standard" also says

This specification allows implementations to set limits on the range and precision of numbers accepted

09:36:04
@raitobezarius:matrix.orgraitobezarius8 bits integers09:39:30
@raitobezarius:matrix.orgraitobezariusmax09:39:31
@kfears:matrix.orgKFears& 🏳️‍⚧️ (they/them) https://seriot.ch/software/parsing_json.html 09:42:26
@kfears:matrix.orgKFears& 🏳️‍⚧️ (they/them)This is a very good overview of the JSON ambiguities and which parsers choose which behavior09:42:44
@kfears:matrix.orgKFears& 🏳️‍⚧️ (they/them)Highly recommend for deciding which behavior is preferred09:42:54
@emilazy:matrix.orgemilyI don't think there's any real reason to reject duplicate keys09:50:48
@emilazy:matrix.orgemilythough I guess silently dropping the data is annoying. but numeric precision means that'll happen for some things anyway09:51:03
@emilazy:matrix.orgemilythere's lots of terrible things about the JSON format but it's not invalid to have duplicates09:51:19
@emilazy:matrix.orgemily it's not builtins.fromIJSON 09:51:45
@piegames:flausch.socialpiegamesmy main worry is that different implementations may handle it differently, which may lead to diverging Nix code behavior09:56:52
@emilazy:matrix.orgemilytrue. but aborting vs. handling it is also a difference in behaviour :)09:57:11
@piegames:flausch.socialpiegamesImagine one Nix implementation who always takes the first attribute, on that always takes the last attribute, and one that takes whichever based on some internal hashmap09:57:32
@emilazy:matrix.orgemilyso unless there is existing divergence I wouldn't make it worse without reason09:57:34
@emilazy:matrix.orgemilyyes, for sure. one of a million reasons there needs to be a spec09:57:52
@emilazy:matrix.orgemilybut "imagine one Nix implementation that aborts" is just another possibility in that list too09:58:04
@commentator2.0:elia.gardenRutile (rootile)

Ah, so thats how we get language detection:

{"language": "cppnix", "language": "lix"}
09:58:14
@emilazy:matrix.orgemilyit'd be interesting to see how pre-nlohmann 2.3 handled it though09:58:30
@emilazy:matrix.orgemilythere's other divergences in JSON handling from 2.3 already09:58:36
@piegames:flausch.socialpiegames yes, but on a different domain. Given that aborts cannot be caught, you cannot produce two different Nix inputs that terminate with a different output value 09:59:02
@emilazy:matrix.orgemily(but in practice 2.3 behaviour is just deprecated given that Nixpkgs doesn't support it any more and everyone has diverged from it)09:59:04
@emilazy:matrix.orgemilyright, I agree that abort vs. not is the least bad kind of divergence09:59:26
@emilazy:matrix.orgemilyit's going to be really annoying if you have an RFC-valid JSON document that you simply can't interoperate with from Nix just because it's weird/cursed though, if there is otherwise no divergence10:00:09
@emilazy:matrix.orgemily(and it's not possible to abort on every Nix behaviour that's weird enough that an implementation without a reference spec might get it wrong, because … it's load-bearing weird behaviours all the way down)10:00:35
@piegames:flausch.socialpiegamesTo be honest the root issue is with the RFC itself10:01:04

Show newer messages


Back to Room ListRoom Version: 10