guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clojure support


From: Linus Björnstam
Subject: Re: Clojure support
Date: Sat, 04 Mar 2023 11:28:50 +0100
User-agent: Cyrus-JMAP/3.9.0-alpha0-183-gbf7d00f500-fm-20230220.001-gbf7d00f5

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 via email to

[Prev in Thread] Current Thread [Next in Thread]