From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Christopher Lemmer Webber Newsgroups: gmane.lisp.guile.user Subject: Functional hashtables Date: Tue, 05 May 2020 14:10:50 -0400 Message-ID: <87r1vyqml1.fsf@dustycloud.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="73073"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.2.0; emacs 26.3 To: guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue May 05 20:11:26 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jW22M-000IsQ-Uc for guile-user@m.gmane-mx.org; Tue, 05 May 2020 20:11:22 +0200 Original-Received: from localhost ([::1]:46956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jW22M-0006hc-0G for guile-user@m.gmane-mx.org; Tue, 05 May 2020 14:11:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jW21t-0006hI-3J for guile-user@gnu.org; Tue, 05 May 2020 14:10:53 -0400 Original-Received: from dustycloud.org ([2600:3c02::f03c:91ff:feae:cb51]:52596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jW21s-00087I-D3 for guile-user@gnu.org; Tue, 05 May 2020 14:10:52 -0400 Original-Received: from twig (localhost [127.0.0.1]) by dustycloud.org (Postfix) with ESMTPS id 1073A265E6 for ; Tue, 5 May 2020 14:10:51 -0400 (EDT) Received-SPF: pass client-ip=2600:3c02::f03c:91ff:feae:cb51; envelope-from=cwebber@dustycloud.org; helo=dustycloud.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 14 X-Spam_score: 1.4 X-Spam_bar: + X-Spam_report: (1.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16428 Archived-At: Hello hello, I'm working on porting a library I've written from Racket to Guile. Some interesting news on that soon. In the meanwhile, I'm trying to figure out what to do about my need for functional hashmaps in Guile. Right now Guile ships with vlist and vhash. Andy also wrote fash.scm, which is what I've generally preferred and used previously. The reason I don't want to use vhashes is specifically this part of vhashes in the Guile manual: > =E2=80=A2 It is _not_ thread-safe. Although operations on vlists are a= ll > =E2=80=9Creferentially transparent=E2=80=9D (i.e., purely functional)= , adding > elements to a vlist with =E2=80=98vlist-cons=E2=80=99 mutates part of= its internal > structure, which makes it non-thread-safe. This could be fixed, > but it would slow down =E2=80=98vlist-cons=E2=80=99. Oop! That's a no-go for me. But maybe there are other reasons to prefer fash.scm too? There's no separate package of guile-fash available anywhere, but it would be easy enough to do if we're just using it with Guix. It's desirable to not have to keep copy-pasta'ing fash.scm around at least. My time in Racket has convinced me that it's an extremely good idea to have a well supported functional hashmap type in the language... extra points if it's "first class" in syntax (my code has improved considerably because of it; no more using alists where they'll bite you later just because it "looks prettier"). Anyway, thoughts? Nice to be back in Guile land! - Chris