From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: pukkamustard Newsgroups: gmane.lisp.guile.devel Subject: Re: Functional datatypes in Guile Date: Tue, 07 Mar 2023 15:02:35 +0000 Message-ID: <864jqwmwmu.fsf@posteo.net> References: <2682583.mvXUDI8C0e@t480s> <86bklenq75.fsf@posteo.net> <86356ko2h3.fsf@posteo.net> <1bb3eac7-fe3c-43f7-b009-a99c7d31a89c@app.fastmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12185"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "Thompson, David" , Jessica Tallon , guile-devel To: Linus =?utf-8?Q?Bj=C3=B6rnstam?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Tue Mar 07 16:04:29 2023 Return-path: Envelope-to: guile-devel@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 1pZYrb-0002vT-QK for guile-devel@m.gmane-mx.org; Tue, 07 Mar 2023 16:04:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZYrA-0005tp-Ie; Tue, 07 Mar 2023 10:04:00 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZYr8-0005rE-7v for guile-devel@gnu.org; Tue, 07 Mar 2023 10:03:58 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZYr6-000640-5J for guile-devel@gnu.org; Tue, 07 Mar 2023 10:03:57 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 3EF042407B4 for ; Tue, 7 Mar 2023 16:03:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1678201432; bh=LRVexv19jfUlZ2hAw71v88rR1q/qdqDwphjuD4I6Vmo=; h=From:To:Cc:Subject:Date:From; b=UPQpoXoEw3rV6jWHJoLhV4LwjGGkr1Qie+KUAM/zk8Q/FkyUB83hW+gA4adljkmb/ /2l8EFu1cgqXDygLwAMxsoXsJoKgOFX1/5CTOGo7JaTTT9KRPUcBQwNU2b0f9OyV5I LgIDcmL2mo1VgJvPro+ew3sQPiOkwJxPOQs0BZuvXR/6kVRUKkTC/I/f6ZSxe9Ocu2 MHi0inPJWeH6DDyxI/t9qfr6W1Z4fOdljw8NqE/k6LgKaO0PvqZf3CXt2fmaD2d5fc vM9Zl8KZmC2Qnd5W66xPeuX4jbVVjd0xz4ijicsJ69Gdi3KpHkf3Qc6EVQboyz+Vi5 jNF63fFGQY/nA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PWJcR0S02z6tsm; Tue, 7 Mar 2023 16:03:48 +0100 (CET) In-reply-to: <1bb3eac7-fe3c-43f7-b009-a99c7d31a89c@app.fastmail.com> Received-SPF: pass client-ip=185.67.36.66; envelope-from=pukkamustard@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21773 Archived-At: Linus Bj=C3=B6rnstam writes: > On Sat, 4 Mar 2023, at 17:38, pukkamustard wrote: >> Hi Dave, >> >> Makes me wonder, are Andy Wingo's fash/fector purely functional? Why do >> they need atomic boxes? Aren't they only necessary for destructive >> updates? > > This is to make sure that transient-fectors/flashes (in-place mutation > with some copying going on to not break the other copies of the sector > being mutated) thread safe. They should only be mutated by the current > thread. > > It is a nice trade off , since you get a lot less copying if you > mutate many values in the same leaf. This is especially good when > building a fector meaning you can fill every tail by just using > vector-set! without copying. Let's just say that it becomes a lot > faster:) Thank you for explaining. That makes a lot of sense! -pukkamustard