From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.lisp.guile.user Subject: Re: guile-json 0.2.0 released Date: Thu, 4 Apr 2013 22:47:33 -0400 Message-ID: References: <871uaqha98.fsf@taylan.dyndns.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b5d88871b20a304d9941d9d X-Trace: ger.gmane.org 1365130087 10114 80.91.229.3 (5 Apr 2013 02:48:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Apr 2013 02:48:07 +0000 (UTC) Cc: guile-user To: Daniel Hartwig Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Apr 05 04:48:35 2013 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UNwhZ-0001CB-Qw for guile-user@m.gmane.org; Fri, 05 Apr 2013 04:48:30 +0200 Original-Received: from localhost ([::1]:47577 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNwhA-0005s4-V9 for guile-user@m.gmane.org; Thu, 04 Apr 2013 22:48:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNwh1-0005rj-Sw for guile-user@gnu.org; Thu, 04 Apr 2013 22:47:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNwh0-0007jm-Kx for guile-user@gnu.org; Thu, 04 Apr 2013 22:47:55 -0400 Original-Received: from mail-pb0-f51.google.com ([209.85.160.51]:51854) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNwh0-0007jc-B7 for guile-user@gnu.org; Thu, 04 Apr 2013 22:47:54 -0400 Original-Received: by mail-pb0-f51.google.com with SMTP id rr4so1767847pbb.10 for ; Thu, 04 Apr 2013 19:47:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=LLG6iswxiRaSh1jJsYExrV2rBob2hMPDBWxoEJqFyBc=; b=ic+hK6eWfFBHUxYZcYBuC1ukhMbkvYeYRPh1bDWMiibhMai0v8/50DSZINSRD+leQR gqnOmfsxX9w//6qYpoQhqwal3HZxIX9+J3oVR2/uFULa0wNYYEzRhh1tHwWK71pB4ys/ /4Mb8p8nrhLUjyGjjMjqarzNptcH6RwjbKvEBSOYPBvUHHEnUbGB3Dx9z5twRElOfY62 HS66zHSCWKC3pLQ9b5H/VFuDzTcrb26opdyUEzrm7ciWZ/rBfQ41T9ZMlLjhmE119uOJ 2Ag2uvtKj1+8CZ4496oGdQv+u0pAdLjvd6v1hA3Fgiq0+mDudqWDKhFMqx3aZQDCFYPO Wrfg== X-Received: by 10.66.222.228 with SMTP id qp4mr12815608pac.113.1365130073544; Thu, 04 Apr 2013 19:47:53 -0700 (PDT) Original-Received: by 10.68.157.42 with HTTP; Thu, 4 Apr 2013 19:47:33 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: 6VSEvvnB5hwr4Ssrudb4d2rd_Vk X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.160.51 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 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-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10238 Archived-At: --047d7b5d88871b20a304d9941d9d Content-Type: text/plain; charset=ISO-8859-1 Hello, I haven't thought about this whole email, but I disagree with this part of your response: On Thu, Apr 4, 2013 at 8:17 PM, Daniel Hartwig wrote: > Hash tables are not just a set of (key, value) pairs, they also > include the particular hash and equality procedures that are used with > them. These could be arbitrary procedures, and procedures can not > generally be converted to a string and back again, so, by extension, > neither can hash tables even if you could do that for their content. > Although hash tables in general do include arbitrary procedures, in Guile's implementation there are only three to choose from, so it should be possible to represent them in syntax. For exactly this reason, I believe that actually "hash table" is a bad name for the data structure. I think of Guile's hash tables as a generic dictionary structure with average O(1)-time lookup, insertion and deletion. It makes sense to me to give this structure an external representation, because it has a lot of common uses. (It seems especially useful to me for configuration files.) That does privilege one sort of generic dictionary structure over other implementations of the same interface - such as hash tables with different hash procedures, as you mentioned. This is fine with me, because I think that use cases fall into two categories. In the common case, the dictionary will not be in a time- or performance-critical part of a program, and programmers should use Guile's built-in dictionary types and not waste time implementing their own. In the rare case, when dictionary lookups are time- or space-critical and must be optimized, *then* it's worth it to design custom hash functions and implement hash tables from vectors and similar things. However, I think that case is sufficiently uncommon that it should not hold back the common case from having convenient syntax. Best, Noah --047d7b5d88871b20a304d9941d9d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello,

I haven't thought about this whole email= , but I disagree with this part of your response:

On Thu, Apr 4, 2013 at 8:17 PM, Daniel = Hartwig <mandyke@gmail.com> wrote:
Hash tables are not just a set of (key, valu= e) pairs, they also
include the particular hash and equality procedures that are used with
them. =A0These could be arbitrary procedures, and procedures can not
generally be converted to a string and back again, so, by extension,
neither can hash tables even if you could do that for their content.

Although hash tables in general do include ar= bitrary procedures, in Guile's implementation there are only three to c= hoose from, so it should be possible to represent them in syntax.

For exactly this reason, I believe that actually "hash = table" is a bad name for the data structure. I think of Guile's ha= sh tables as a generic dictionary structure with average O(1)-time lookup, = insertion and deletion. It makes sense to me to give this structure an exte= rnal representation, because it has a lot of common uses. (It seems especia= lly useful to me for configuration files.)

That does privilege one sort of generic dictionary structure= over other implementations of the same interface - such as hash tables wit= h different hash procedures, as you mentioned. This is fine with me, becaus= e I think that use cases fall into two categories. In the common case, the = dictionary will not be in a time- or performance-critical part of a program= , and programmers should use Guile's built-in dictionary types and not = waste time implementing their own. In the rare case, when dictionary lookup= s are time- or space-critical and must be optimized, *then* it's worth = it to design custom hash functions and implement hash tables from vectors a= nd similar things. However, I think that case is sufficiently uncommon that= it should not hold back the common case from having convenient syntax.

Best,
Noah

--047d7b5d88871b20a304d9941d9d--