* Functional hashtables
@ 2020-05-05 18:10 Christopher Lemmer Webber
2020-05-05 19:45 ` Linus Björnstam
2020-05-16 20:42 ` Ludovic Courtès
0 siblings, 2 replies; 9+ messages in thread
From: Christopher Lemmer Webber @ 2020-05-05 18:10 UTC (permalink / raw)
To: guile-user
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:
> • It is _not_ thread-safe. Although operations on vlists are all
> “referentially transparent” (i.e., purely functional), adding
> elements to a vlist with ‘vlist-cons’ mutates part of its internal
> structure, which makes it non-thread-safe. This could be fixed,
> but it would slow down ‘vlist-cons’.
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Functional hashtables
2020-05-05 18:10 Functional hashtables Christopher Lemmer Webber
@ 2020-05-05 19:45 ` Linus Björnstam
2020-05-06 11:23 ` Christopher Lemmer Webber
2020-05-06 11:24 ` Christopher Lemmer Webber
2020-05-16 20:42 ` Ludovic Courtès
1 sibling, 2 replies; 9+ messages in thread
From: Linus Björnstam @ 2020-05-05 19:45 UTC (permalink / raw)
To: Christopher Lemmer Webber, guile-user
I made a module out of Andy's dash (and added some comfort functions over fash-fold): https://hg.sr.ht/~bjoli/guile-fash/browse/fash.scm?rev=default
What it lacks is a proper way to remove elements..I had a couple of stabs at it, but I fear I was too dumb.
--
Linus Björnstam
On Tue, 5 May 2020, at 20:10, Christopher Lemmer Webber wrote:
> 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:
>
> > • It is _not_ thread-safe. Although operations on vlists are all
> > “referentially transparent” (i.e., purely functional), adding
> > elements to a vlist with ‘vlist-cons’ mutates part of its internal
> > structure, which makes it non-thread-safe. This could be fixed,
> > but it would slow down ‘vlist-cons’.
>
> 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
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Functional hashtables
2020-05-05 18:10 Functional hashtables Christopher Lemmer Webber
2020-05-05 19:45 ` Linus Björnstam
@ 2020-05-16 20:42 ` Ludovic Courtès
2020-05-17 7:31 ` Catonano
1 sibling, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2020-05-16 20:42 UTC (permalink / raw)
To: guile-user
Hi there!
Christopher Lemmer Webber <cwebber@dustycloud.org> skribis:
> 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").
I’ve never used fash, but I’m all for getting it in Guile proper if Andy
is fine with it. In general, I agree that having more functional data
structures in Guile is desirable.
Would someone be willing to turn it into a proper Guile module with a
section in the manual and some tests?
> Nice to be back in Guile land!
Heh, good to see you back here! :-)
Ludo’.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2020-05-17 7:31 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-05 18:10 Functional hashtables Christopher Lemmer Webber
2020-05-05 19:45 ` Linus Björnstam
2020-05-06 11:23 ` Christopher Lemmer Webber
2020-05-06 11:24 ` Christopher Lemmer Webber
2020-05-06 13:32 ` Linus Björnstam
2020-05-06 18:29 ` ArneBab
2020-05-08 18:11 ` Christopher Lemmer Webber
2020-05-16 20:42 ` Ludovic Courtès
2020-05-17 7:31 ` Catonano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).