unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Linus Björnstam" <linus.bjornstam@veryfast.biz>
To: "Lassi Kortela" <lassi@lassi.io>,
	"Jessica Tallon" <tsyesika@tsyesika.se>,
	 guile-devel@gnu.org
Subject: Re: Clojure support
Date: Sat, 04 Mar 2023 11:28:50 +0100	[thread overview]
Message-ID: <f25cd24a-9643-4705-bc87-dca87f6d3e21@app.fastmail.com> (raw)
In-Reply-To: <dfa81c05-ba5b-01cf-5703-5e97409f8c54@lassi.io>

Regarding data structures, there are some additions that should be made to the standard clojure versions. There would be no reason to implement a regular leftwise-dense persistent vector when there is something like RRB-trees available, which provide no slowdown compared to the leftwise dense vectors when used as such, but can "degrade" to RRB-trees when needed as a means to support amortized O(1) concatenation, insertion, and splitting. 

If a C library is to be used, C-rrb is a very high quality implementation. I tried to implement RRB-trees in guile, but I never quite got the merge algorithm to work as it should. Scalas functional vectors are RRB-trees with some really cool additions to the tail optimization.

Andy already has a fast implementation of functional hashtables ("fash") which are of a particular high quality. They do not support element removal which should be trivial to add.  Other than that it has all the basic functionality needed to build a complex library on top. 

-- 
  Linus Björnstam

On Tue, 28 Feb 2023, at 18:03, Lassi Kortela wrote:
>> I've been thinking how it'd be nice to have available in Guile a number of
>> purely functional datatypes, these being hashmaps, vectors, and sets.
>
> Those are core data types of Clojure. It'd be nice if the canonical 
> Scheme versions of these types have Clojure-compatible semantics. This 
> will make it easy to turn Scheme implementations into partial 
> implementations of Clojure. This is already being attempted in Lokke 
> (https://github.com/lokke-org/lokke).



  reply	other threads:[~2023-03-04 10:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27 13:17 Functional datatypes in Guile Jessica Tallon
2023-02-28  7:47 ` Maxime Devos
2023-02-28  8:22 ` pukkamustard
2023-02-28 16:04   ` Thompson, David
2023-02-28 16:54     ` Philip McGrath
2023-03-04 16:38     ` pukkamustard
2023-03-05 12:58       ` Linus Björnstam
2023-03-07 15:02         ` pukkamustard
2023-06-10 16:47   ` Ludovic Courtès
2023-06-10 18:28     ` Dr. Arne Babenhauserheide
2023-06-16  5:15     ` pukkamustard
2023-06-21 21:53       ` Ludovic Courtès
2023-02-28 17:03 ` Clojure support Lassi Kortela
2023-03-04 10:28   ` Linus Björnstam [this message]
2023-03-04 11:22     ` Philip McGrath
2023-05-07 15:36       ` Linus Björnstam
2023-05-13 22:10   ` Rob Browning
2023-05-20  9:36     ` Maxime Devos
2023-05-21  2:29       ` Rob Browning

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f25cd24a-9643-4705-bc87-dca87f6d3e21@app.fastmail.com \
    --to=linus.bjornstam@veryfast.biz \
    --cc=guile-devel@gnu.org \
    --cc=lassi@lassi.io \
    --cc=tsyesika@tsyesika.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).