!lymvtcwDJ7ZA9Npq:lix.systems

Lix Development

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

Load older messages


SenderMessageTime
14 Aug 2025
@emilazy:matrix.orgemily also, I don't think this should be a major consideration, but I suspect that making the negative case error out with nlohmann_json would be a pain 16:51:33
@emilazy:matrix.orgemilybecause it is already a float by the time you see it, because of being a value that does not fit into the integer types16:51:59
@emilazy:matrix.orgemilyI mean I guess you can compare the float but float precision issues may make that weird16:52:13
@emilazy:matrix.orgemilyand you have to determine whether it "could be" an integer16:52:20
@emilazy:matrix.orgemilylet's put it this way16:52:35
@emilazy:matrix.orgemilyif we were going to hard-reject JSON integer values16:52:40
@emilazy:matrix.orgemilyit should be based on the -(2^53)+1 to (2^53)-1 interoperable range16:53:09
@emilazy:matrix.orgemilyand happen on the serialization end as well16:53:18
@emilazy:matrix.orgemily(IMO)16:53:22
@emilazy:matrix.orgemily that would be undesirable though because of fromJSON being abused for general integer-parsing 16:53:32
@emilazy:matrix.orgemilyso we're already outside the bounds of the fully interoperable JSON format16:53:44
@jade_:matrix.orgjade_ also fromJSON may take some json that isn't actually getting operated on in nix except for rearrangement (e.g. the large integers don't actually get touched) 16:54:05
@emilazy:matrix.orgemilywell, the large integers will still get clobbered precision-wise16:54:23
@emilazy:matrix.orgemilythat's sort of inevitable though16:54:32
@emilazy:matrix.orgemilyand why people who put large integers into JSON put them in strings generally16:54:42
@jade_:matrix.orgjade_ yes, i just mean that they had it coming to a degree; having any json parsing error out is unfortunate 16:54:52
@emilazy:matrix.orgemilyNixpkgs just does the funny thing because of Nix's lack of useful parsing functions16:54:53
@emilazy:matrix.orgemilyright16:54:56
@emilazy:matrix.orgemily I will probably prepare a revert of that fromJSON change in the absence of strong objection / someone who wants to try and make it do the same for negative integers 16:55:24
@emilazy:matrix.orgemilyI wish someone had told Douglas Crockford what semantics are16:55:39
@emilazy:matrix.orgemily further context for this is https://github.com/NixOS/nixpkgs/pull/433710 because it turns out that fromTOML is a total mess (working on a stack locally) 16:56:05
@jade_:matrix.orgjade_i would like consistent behaviour with pos/neg integers ideally and i would rather it be a total function. so ya16:56:08
@emilazy:matrix.orgemily btw what's the intended way to update functional2 snapshots with a just-built Lix? 16:57:29
@emilazy:matrix.orgemily PATH=build/… hacks? 16:57:33
@jade_:matrix.orgjade_"did we wire that in yet" -helle16:59:28
@emilazy:matrix.orgemilyhm, seems that doesn't work16:59:29
@emilazy:matrix.orgemily btw, Nix recently started forbidding NUL bytes in string literals, fromJSON, etc.; how do we feel about backporting that? 17:00:18
@emilazy:matrix.orgemilyI know it's "language versioning" kind of territory but the behaviour is also super broken so if they're pulling off the bandaid already…17:00:36
@jade_:matrix.orgjade_ I think it's the _NIX_TEST_ACCEPT=1 thing, and iirc you can just run functional2 with pytest in lix (assuming the fresh lix is in fact in PATH and you've rehashed in zsh etc) 17:00:59
@emilazy:matrix.orgemily yes the problem is getting it in $PATH 17:01:27

Show newer messages


Back to Room ListRoom Version: 10