From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Linus_Bj=C3=B6rnstam?= Newsgroups: gmane.lisp.guile.devel Subject: Re: Functional datatypes in Guile Date: Sun, 05 Mar 2023 13:58:48 +0100 Message-ID: <1bb3eac7-fe3c-43f7-b009-a99c7d31a89c@app.fastmail.com> References: <2682583.mvXUDI8C0e@t480s> <86bklenq75.fsf@posteo.net> <86356ko2h3.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1839"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.9.0-alpha0-183-gbf7d00f500-fm-20230220.001-gbf7d00f5 Cc: "Jessica Tallon" , guile-devel To: pukkamustard , "Thompson, David" Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sun Mar 05 13:59:47 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 1pYnxm-0000D5-He for guile-devel@m.gmane-mx.org; Sun, 05 Mar 2023 13:59:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYnxP-0006ok-Oo; Sun, 05 Mar 2023 07:59:19 -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 1pYnxM-0006oR-RT for guile-devel@gnu.org; Sun, 05 Mar 2023 07:59:16 -0500 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pYnxL-0002Td-1e for guile-devel@gnu.org; Sun, 05 Mar 2023 07:59:16 -0500 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id BE6765C00A6; Sun, 5 Mar 2023 07:59:10 -0500 (EST) Original-Received: from imap51 ([10.202.2.101]) by compute2.internal (MEProxy); Sun, 05 Mar 2023 07:59:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veryfast.biz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1678021150; x=1678107550; bh=7N 0N1JN84CV9D3yHdpSKz5rc3wQDO7Q3Xgr5IG1FHWQ=; b=Y70coxCqmSr40jYQKc C446ARw83sFtRua3dgWV1U0YS8DD4Gx+1i8AAQayWzUKIYbzKlz+PHmLZwWuEXD8 F6C6UybCTjJhsrV4ygrO06BT2r2HWaKDBy2fZ/fyyVFBUtTjMXizgRsW/4ucC+dm i6Aeht96Ok97kCTu7l6lqj9eBX3ilytKFLEsNpu4WPctuvf6OkfJ/udgIIz94PMl j6TLBQFRHYGBrb25ifclXnCnP+kr7nYbovmNyBvKmmAkNb7RP03cJchbeBk+/xA9 /aOepD3y/E+xq6/ZfHww5ExKOFRMMG/k+iznX9CifPZoR2u5qmBRq4MSuJK9BYfX a7Kg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1678021150; x=1678107550; bh=7N0N1JN84CV9D 3yHdpSKz5rc3wQDO7Q3Xgr5IG1FHWQ=; b=ZNGQbtVl1lSFlTZ7XJstr2N1k6KOw 72lE98cXMvVK45MZJozU9iCPDHLJTIDESqhecW8wKodaOA0gf7qEIwpPIALnSYgh 5gV8wSlXgVBxpHFB53B7e6C2d+sQqUTHsNIdtuXXX4sHgwpygNTut1HSGmu072cy SYqTYWZmSDlSWqovbA0gP3JCEFzvGXiHVHNmjMuVijO5arBqW0L73gcAfr7Jz1C8 yl4WhQV7ZaZnhH6zP54PwUJoRa2fE2SjvxnVMuwy0sZ9Wb3lzs8YmNi93oPYOB25 /mcwFMxeF2sidLyhjlJuRFatYZDl6MYm7JeXeZCAmlo5K2riTCGUO8cfA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddtgedggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderreejnecuhfhrohhmpefnihhn uhhsuceujhpnrhhnshhtrghmuceolhhinhhushdrsghjohhrnhhsthgrmhesvhgvrhihfh grshhtrdgsihiiqeenucggtffrrghtthgvrhhnpeegtedttdduieehjedvledvudduhfek hedvudeljeekieegieekvdeiueeuvdevtdenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehlihhnuhhsrdgsjhhorhhnshhtrghmsehvvghrhihf rghsthdrsghiii X-ME-Proxy: Feedback-ID: i51694465:Fastmail Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 66FFBB60086; Sun, 5 Mar 2023 07:59:10 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <86356ko2h3.fsf@posteo.net> Received-SPF: pass client-ip=66.111.4.28; envelope-from=linus.bjornstam@veryfast.biz; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-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:21772 Archived-At: 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:) /Linus