Linus Björnstam <linus.bjorns...@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