[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Functional datatypes in Guile
From: |
pukkamustard |
Subject: |
Re: Functional datatypes in Guile |
Date: |
Tue, 07 Mar 2023 15:02:35 +0000 |
Linus Björnstam <linus.bjornstam@veryfast.biz> 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