Subject: Re: [PATCH v5 07/45] guix: node-build-system: Add #:absent-dependencies argument.

From: Philip McGrath <[email-masked]>
Date: Tue, 21 Dec 2021 13:25:50 -0500

Hi,

On 12/21/21 00:20, Liliana Marie Prikler wrote:
> Hi,
> 
> excuse my brevity, but I'll be off to work soon.
> 
> Am Montag, dem 20.12.2021 um 22:59 -0500 schrieb Philip McGrath:
>> My reservation regarding:
>>
>>>
>>> (add-after 'patch-dependencies 'drop-junk
>>>     (lambda _
>>>       (with-atomic-json-replacement "package.json"
>>>         (lambda (json) (delete-dependencies json '("node-tap"))))))
>>>
>>
>> is that `with-atomic-json-replacement` would make (guix build json)'s
>> representation a part of node-build-system's API, which it currently
>> is not. For the reasons I detailed in my last email, I think that
>> would open up a larger can of worms than it might seem.
> That might be a valid concern, but I'd point to the "we don't
> gratuitously change API" shield.  Plus if we do, we'd replace our
> current JSON by Guile-JSON.  If that has a different internal
> representation that would awfully break things, please do tell.

Here are, to the best of my understanding, the differences in 
representation among (guix build json) and the three versions of 
guile-json packaged in Guix. (For guile-json, this is based on my 
relatively-quick reading of the docs, not any direct experience.) An 
extra complication is that some part of Guix's code staging seems to 
incorrectly turn #nil into '(). I will see if I can narrow that down and 
file a bug report.

(guix build json):
   • object -> (Pairof '@ (Listof (Pairof String Json)))
   • array  -> (Listof Json)
   • null   -> #nil
   • string -> String

guile-json-4:
   • object -> (Listof (Pairof (U Symbol Number String) Json))
   • array  -> (Vectorof Json)
   • null   -> 'null ;; configurable by keyword argument
   • string -> (U Symbol String)

guile-json-3:
   • object -> (Listof (Pairof (U Symbol Number String) Json))
   • array  -> (Vectorof Json)
   • null   -> #nil
   • string -> (U Symbol String)

guile-json-1:
   • object -> (U (HashTable (U Symbol String) Json)
                  (Listof (Pairof (U Symbol String) Json)))
   • array  -> (Listof Json)
   • null   -> #nil
   • string -> (U Symbol String)

-Philip