Fork me on GitHub
#other-lisps
<
2021-12-01
>
cp4n00:12:31

As I understand it, Clojure does things in the background so that returning new data instead of changing mutable data in place isn't a big drag on performance and garbage collection. Do all lisps do this? Like can you work with Common Lisp or Racket in this way or am I incorrectly assuming similarities because they are also lisps? (disclaimer: have tried neither CL or Racket)

hiredman00:12:06

that understanding is not correct

hiredman00:12:34

clojure's primary data structures are implemented as trees, for sharing the structure of the tree between versions of the data structure, which gives you immutable data structures with better performance than naive copy on write

hiredman00:12:46

there is no "doing things in the background"

hiredman00:12:06

a lot of other languages have libraries these days that provide similar data structures

hiredman00:12:58

(the kind of tree clojure uses for the most part is a hash array mapped trie)

cp4n00:12:51

Oh ok, thank you for the clarification. So basically Clojure was built to do this and other lisps may not be, although libraries could be available

cp4n00:12:28

thank you!

hiredman00:12:53

there is a nice paper from the recent history of programming languages conference https://download.clojure.org/papers/clojure-hopl-iv-final.pdf

1
hiredman00:12:39

What I thought would be a simple matter of shopping for
best-of-breed functional data structures ended up being a search and engineering exercise that
dominated my early Clojure work, as evidenced by the gap in commits during the winter of 2006/7
(figure 2). 

hiredman00:12:31

which is eventual what lead to him settling on hamts, created by, uh, Phil Bagwell I think

cp4n00:12:43

Good stuff, I had just found the Racket one as well when you posted, now that I know what I am looking for. And thanks for the link to the paper. Will read that