From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Aleix_Conchillo_Flaqu=C3=A9?= Newsgroups: gmane.lisp.guile.user Subject: Re: guile-json 2.0.0 released Date: Wed, 19 Dec 2018 10:14:53 -0800 Message-ID: References: <87y38meqbo.fsf@gnu.org> <87lg4lzt9l.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1545243262 18750 195.159.176.226 (19 Dec 2018 18:14:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 19 Dec 2018 18:14:22 +0000 (UTC) Cc: guile-user To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Dec 19 19:14:17 2018 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gZgML-0004kc-59 for guile-user@m.gmane.org; Wed, 19 Dec 2018 19:14:17 +0100 Original-Received: from localhost ([::1]:33462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZgOR-0006NZ-Mt for guile-user@m.gmane.org; Wed, 19 Dec 2018 13:16:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZgNC-0005hs-1v for guile-user@gnu.org; Wed, 19 Dec 2018 13:15:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZgNB-0007sn-A8 for guile-user@gnu.org; Wed, 19 Dec 2018 13:15:10 -0500 Original-Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:34606) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZgN9-0007me-2e; Wed, 19 Dec 2018 13:15:07 -0500 Original-Received: by mail-lj1-x229.google.com with SMTP id u89-v6so7548796lje.1; Wed, 19 Dec 2018 10:15:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=IEVmIDDIwWVNt1xAyWrLsDZN8pb4vxwWccxdVvqzgEw=; b=Y9NB5lYydPWypJKai7J1kwA7nAXNnNMVmaMLWisr+9Xersw5th6L/zwBIaXaP9CEan JrnotYsj1tq1ctCqEkvqqe07yy+Y0Hccc0IPMpJiTIjdFBRWPlVpNeBWhc7wa5b1Risi ug5Uf2jlEqSAm0uYB88clx4YH1ou5XvZBkptJY8rz7frOzKR167wMhRWFwBzm/hFxhFQ R6kU+pwbhCxOSC+ZHUN0AATJ5pY1+X9dqvvUBJzJC5AP6POcHlV5EVEHRGrlI6qb7PVw ryR2re9snGMsF6tMeuLFjs5NTYQjgnEo88NS2JtzqB4gzOeYBmwMWfYu65M6kkX0/DX3 X6Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=IEVmIDDIwWVNt1xAyWrLsDZN8pb4vxwWccxdVvqzgEw=; b=ielHeEfSU2+XI+u6DR+3Wg8vUSLRsA/BEFUqozV43kgvi7bhAwh2WFdna8gmzvcQlF RrDtlhBZ3lvD7kyCazcrBXBod1epF4TxyveWtgsUX+yXq8jksD15OqhAuLSFJfd1LNMC Z/V9L/qhy+k24BdNYCAuDWMi+pNkYaeIc7HhInG7Jutyu8gV172vVliOcNgDtlHGQRoE lkcwFxGwvVdJlaKCr2mv4e9h4cQvsEUh79RGVGnMM+2bcwqOcoCXkQUbbv+j/y5cgR+2 ynZzZ9WoAJbYAswxAmngvVxjvs1apX5LegmfpjKmxdPJ6GLDYUNSRi92XXPzqUxgke/q ZnAA== X-Gm-Message-State: AA+aEWYpSxJDoYa9z1FxSA01C9my4rlUnp/k8TlI7tzaBc25FH4AqMAc +kp0AvnOoGkqzxCqbeFn08BlRHqcK5YVolgCfyXEZQ== X-Google-Smtp-Source: AFSGD/Usl+roaZX/HEolbaB+pHOOEVsnVDspze/h5Fr0JZqv9CwifHuq6xvZplK2HwLpcZL7TuLnOQrGhyh8CQVy0a8= X-Received: by 2002:a2e:3e04:: with SMTP id l4-v6mr12850586lja.148.1545243304925; Wed, 19 Dec 2018 10:15:04 -0800 (PST) In-Reply-To: <87lg4lzt9l.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::229 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15130 Archived-At: On Wed, Dec 19, 2018 at 2:48 AM Ludovic Court=C3=A8s wrote: > > Hi Aleix, > > Aleix Conchillo Flaqu=C3=A9 skribis: > > > Any comments on the discussion between alist/vector vs > > hash-tables/list? How hard would it be for Guix to change to the > > alist/vector approach? I'm just considering options and would like > > input from anyone who uses guile-json, specially Guix who's probably > > the biggest user. > > I sympathize with David=E2=80=99s comments and would have been happy keep= ing the > ability to pass alists as inputs. :-) > Yes, me too. The problem was that guile-json was broken, since there was no way to distinguish json arrays (lists) from json objects (alists) and the code that guile-json had was doing the wrong thing. > I haven=E2=80=99t checked but IIUC quite a bit of code in Guix would have= to be > modified to use =E2=80=98alist->hash-table=E2=80=99. > > As for vectors vs. lists, I suppose Scheme vectors in theory correspond > directly to JS arrays (O(1) access), so that=E2=80=99d be an argument in = favor > of using vectors on the Scheme side. However vectors in Scheme are less > convenient than lists, as John noted, and I=E2=80=99m guessing that often= lists > are good enough. Tricky! > My guess is that most of the time people build objects with JSON so it seems logic to map them to the most convenient way to represent that in Scheme which would be alists. So, I'm really considering switching to alists for objects and vectors for arrays. Thanks! Aleix